fix(worker): truthful job states, intel dependency barriers, no overlap, stale-write guard (#8 C1-C4)
C1: a job type the worker does not execute now ends 'skipped' with a reason (it fell through to 'done' with a NULL result, so 'done' meant 'did nothing'); intel outcomes are recorded in result (computed / empty / already_current), a superseded revision is 'skipped', a missing prerequisite is 'blocked', exceptions retry up to _MAX_ATTEMPTS then 'failed'. Production behaviour is unchanged: intel.* jobs execute only for a repository listed in MUSEHUB_INTEL_WORKER_REPOS on a local database (musehub_intel_gate); nothing lists any.
C2: claim_next_job enforces intel.code before the eight index-dependent providers (coupling, entangle, dead, blast_risk, stable, velocity, clones, gravity), refuses to start intel.code while one of them reads the index (no torn reads), and require_index_current blocks a dependent whose revision intel.code has not published. The six snapshot providers do not wait. The created_at stagger stays as a hint only.
C3: one running job per (repository, intel type) across workers; a push that arrives while one runs queues a new pending job instead of being dropped; a pending intel job is refreshed to the newest push instead of keeping a stale head.
C4: persist_intel_results locks the stored row and rejects a result whose revision is a strict ancestor of the stored one (ancestry, never timestamps); divergent revisions have no order and the later completion wins. It returns the types written.
The revision helpers move out of the indexer into musehub_intel_revision so the guard and the indexer share one ancestry implementation.
Semantic Changes
94 symbols
0 comments
muse hub commit comment sha256:1d6f4203c8aefabfff4a51b02e93f64e7b44858566bbcbfc6ce9d5c791691174 --body "your comment"
No comments yet. Be the first to start the discussion.