Jobs and versions
In the proposed model, every generation creates a separate version, while the permanent link points to the latest published one.
A job, a version and a publication are three different states.
This is a model design, not the names of existing tables or API enums.
What we save
| Entity | Purpose |
|---|---|
| Project | Permanent site, owner, original request and materials |
| Job | Requested action, source version, attempt state and error |
| Version | Complete files, provenance, check results |
| Publication | Version currently served at the site's address |
| Domain | Verified address-to-project binding and HTTPS state |
Ready versions are immutable. An edit creates the next one; a rollback selects an earlier one. Git history can be part of the implementation but does not replace explicit publication state.
Job lifecycle
Accepted → Waiting → Running → Checking → Ready
└──────────────→ Failed / CancelledThe proposed starting point stores jobs in PostgreSQL and gives a worker a time-limited execution lease. Lease renewal, attempt counts and recovery of stuck jobs are required. A queue library will be selected after evaluation; Redis is not mandatory in the design yet.
Repeating an HTTP request with the same idempotency key does not create a second site. Retrying execution may call AI again, so cost and attempt limits are accounted for separately. There is no promise of exactly-once execution; result writes must be protected against repeated application.
Concurrent edits
For the first version, we propose processing a project's edits sequentially. Each command records its starting version. If that version is stale, show a conflict and offer to retry on the new version; silently overwriting another change is not allowed.
Cancellation stops further actions and prevents publication of the cancelled attempt's result. It does not mean an already submitted provider request will not be billed.
Publication
- Upload every version file to a separate location.
- Check files, links, mobile layout and the call to action.
- Record version readiness.
- On the owner's command, switch the publication pointer while checking the source version.
- Refresh the address cache and verify delivery.
Failure before switching leaves visitors on the previous version. If a problem occurs afterward, restore the pointer and refresh the cache again. Garbage collection must not delete files still referenced by publication or rollback.
Unpublishing removes public delivery and cache, but does not necessarily delete the project. Project deletion and backup retention need a separate policy. An old link must not pass to another owner. Domain rules.