You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
ws-055: the factory's readiness rules checked against the work kind's ready and blockedBy #2734
Part of the chud retirement epic #2715. Implements ws-055 (PR #2721).
Change
Compare chud's ready queue (packages/runtime/src/ready.mjs at jhgaylor/chud 43afcf1: approved and in force, dependencies closed, no open unit, met-driver rules) with the work kind's ready and blockedBy:
write each rule the work kind can express as work-item needs;
list each rule it cannot express, with where it lives instead (the runner, or a new work-kind field proposed here).
Acceptance
A table of every ready.mjs rule and its home.
Tests showing the work kind's ready matches chud's queue on a fixture repo, for the expressible rules.
Every rule readyQueue (packages/runtime/src/ready.mjs) and the memberState it calls (drivers.mjs) use to decide a contract is ready, checked against the work kind's ready/blockedBy (work.ts):
ready.mjs / drivers.mjs rule
Home
Notes
depends_on closed: every dependency is met
work-item needs
Direct mapping: a needs id counts closed once its target's state is the kind's done state.
A contract that is itself met leaves the queue (it's done, not ready)
the work item's own state (ready requires state === "open")
Already inherent in the kind's state machine; needs doesn't need to express it.
A dependency that never reaches met (retired) blocks its dependents forever
work-item needs on a dropped item
dropped never turns done, so blockedBy never clears — same effect as a retired dependency.
A dependency (and the contract itself) must be approved before it "counts"
not a needs concept
Belongs to the decision a work item implements, not to needs. The work kind already warns work-implements-undecided when a work item implements a still-proposed decision, but ready doesn't gate on it today — open question below.
A contract must be the newest version of its supersedes chain (enforced)
not applicable to work items
Work items don't revise through a draft → approved chain before they close; supersedes only takes effect between two already-closed records. The nearest analog, a decision's supersededBy, is already excluded from a work item's own ready the same way chud excludes a superseded contract.
"met" also requires no newer failing evidence at the approved sha, re-checked on every read
the runner
needs only ever reads a target's state; once something is done it stays counted as closed. Re-verifying evidence and, if a check regresses, moving state back off done is the runner's job (the thin build layer over chant workspace records amend), not something the work kind computes on read.
No unit may be open against the contract while it's ready (exclusivity/locking)
the runner, specifically the work-item lease ws-055 already decided
Not a dependency at all — it's locking a target while work runs on it. ws-055 (#2717, decided in #2721) already gives this a home: refs/chant/lease/work/<id>, chant workspace work claim|renew|release. Nothing to add here.
A superseded dependency's state is read through its latest version
not applicable
No work-item equivalent: a work item keeps its id and its own state for life; there's no "chase to the newest version" step for a needs link to make.
Expressible today, no new field: dependencies closed, and a met/running item leaving the queue — both proven on a fixture in packages/core/src/workspace/work-readiness-chud.test.ts.
No work-kind field is warranted by this comparison. Everything that isn't a direct needs mapping already has a home: the decision a work item implements, the runner (evidence re-checks, the ws-055 lease), or has no work-item equivalent at all.
Open question, not filed as a field: should a work item's ready also require every implements to be decided? Today it's only a warning (work-implements-undecided). Filed as a follow-up for a product decision, not implemented here.
Activity
lex00 commentedon Sep 25, 2026
Every rule
readyQueue(packages/runtime/src/ready.mjs) and thememberStateit calls (drivers.mjs) use to decide a contract is ready, checked against the work kind'sready/blockedBy(work.ts):depends_onclosed: every dependency ismetneedsneedsid counts closed once its target'sstateis the kind'sdonestate.state(readyrequiresstate === "open")needsdoesn't need to express it.needson adroppeditemdroppednever turnsdone, soblockedBynever clears — same effect as a retired dependency.needsconceptimplements, not toneeds. The work kind already warnswork-implements-undecidedwhen a work item implements a still-proposed decision, butreadydoesn't gate on it today — open question below.enforced)supersedesonly takes effect between two already-closed records. The nearest analog, a decision'ssupersededBy, is already excluded from a work item's ownreadythe same way chud excludes a superseded contract.needsonly ever reads a target'sstate; once something isdoneit stays counted as closed. Re-verifying evidence and, if a check regresses, movingstateback offdoneis the runner's job (the thin build layer overchant workspace records amend), not something the work kind computes on read.refs/chant/lease/work/<id>,chant workspace work claim|renew|release. Nothing to add here.statefor life; there's no "chase to the newest version" step for aneedslink to make.Expressible today, no new field: dependencies closed, and a met/running item leaving the queue — both proven on a fixture in
packages/core/src/workspace/work-readiness-chud.test.ts.No work-kind field is warranted by this comparison. Everything that isn't a direct
needsmapping already has a home: the decision a work itemimplements, the runner (evidence re-checks, the ws-055 lease), or has no work-item equivalent at all.Open question, not filed as a field: should a work item's
readyalso require everyimplementsto be decided? Today it's only a warning (work-implements-undecided). Filed as a follow-up for a product decision, not implemented here.test(workspace): work kind ready/blockedBy vs. chud's ready queue (#2734
test(workspace): work kind ready/blockedBy vs. chud's ready queue (#2734