Tasks: let the gate that precedes the spec run before the spec exists
The last spec artifact (bugfix → design → testing plan → tasks). Derived from the approved
design.mdandtesting-plan.md.
Task list
- [x] 1. The predicate names its exempt actions
_SPEC_DIR_OPTIONAL_ACTIONS = frozenset({"start", "context"})beside_ADOPTING_ACTIONS, carrying the reasoning for each member and each non-member;_guarded'sis_dir()gate consults it. Nothing above it in the gate order moves.- Depends on: none
- Requirements: R1.1, R1.4, R1.5, R1.6
- Test:
T1 — uv run pytest cli/tests/test_graphlink.py -k "spec_directory or skip"(red→green)
- [x] 2. A work item that has not been placed still resolves a context
GraphLink._pending_context;_context_fromdelegates to it instead of returningNone;GraphContext.statusdocumentspendingand why it is notat_human_gate.- Depends on: 1 (the context of an unplaced item is unreachable without the exemption)
- Requirements: R2.1, R2.3, R2.4, R2.6
- Test:
T1 — uv run pytest cli/tests/test_graph_drive.py -k about_to_stand(red→green)
- [x] 3. The
pendingblock says what the session may not dorender_graph_contextshort-circuits onstatus == "pending": the NOT-ENTERED-YET line, the human-gate line when the node's actor ishuman, the trailer — and none of the resume, claim or surface lines that describe an entered node.- Depends on: 2
- Requirements: R2.2, R2.5
- Test:
T2 — uv run pytest cli/tests/test_graphlink_integration.py -k forbids_starting(red→green)
- [x] 4. The reproduction, end to end
- Gherkin-documented scenarios against a real
Dispatcherand a realRuntimeover the shipped graph: a plain-ticket spawn is held atphase-selectionwith the label set and the checklist posted; an unauthorizedthe-loop executemoves nothing; a started graph still reports its real node. Plus_bare_checkoutand an offline provider fixture. - Depends on: 1, 2, 3
- Requirements: R1.1, R1.2, R1.3, R2.3, R4.2
- Test:
T2, T8, T10 — uv run pytest cli/tests/test_graphlink_integration.py
- Gherkin-documented scenarios against a real
- [x] 5. The tests that pinned the old behaviour say what they pin now
test_a_work_item_with_no_spec_directory_is_skipped→…_is_still_started, with the reason the original reading was answered by_awaiting_startall along; the event-log skip test driven by anadvance; thespecDirparity test split across a gated and an exempt action; the scaffold suite's spawn now starts a graph, so it gains an autouse offline provider and assertsgraph-state.jsoninstead of its absence.- Depends on: 1, 2
- Requirements: R1.4, R1.5, R4.1
- Test:
T1 — uv run pytest cli/tests/test_graphlink.py cli/tests/test_harness_config_scaffold_integration.py
- [x] 6. Write it down
docs/capabilities/process-graph.md: which actions require the spec directory and why the split falls there; thependingcontext and its block; a history row.docs/capabilities/webhook-triggers.md: correct the list of when$graph_contextrenders empty; note the exemption beside thespecDirparagraph; a history row.- Depends on: none
- Requirements: R3.1, R3.2, R3.3
- Test:
T12 — make lint
- [x] 7. Verify and evidence
- Run every activity in the testing plan, record the results in it, and file the red run, the green runs, the lint/type-check output and the security review under
evidence/. - Depends on: 1–6
- Requirements: R4.1, R4.2
- Test:
make test,make lint,make typecheck
- Run every activity in the testing plan, record the results in it, and file the red run, the green runs, the lint/type-check output and the security review under
Execution notes
Task 2 depends on task 1 for a reason worth stating: the pending context is only reachable for an unplaced work item once context is exempt from the directory check. Shipping either half alone leaves the bug half-fixed — the graph starting but the prompt still silent, or the prompt describing a node the graph declined to enter.