Task — engineering-spec@1

Doc-driven workflow helpers, ship-manifest and backlog-mutate CLIs

doneTASK-IMP-085
module improvement · class product · priority p0 · created 2026-07-16 · shipped 2026-07-16
depends on none · blocks none

TASK-IMP-085: Doc-driven workflow helpers, ship-manifest and backlog-mutate CLIs

Summary

Two contracts in the ship loop are executable only by agent discipline today: the ship-manifest resume cache and the backlog-state-update byte rules. Ship two stdlib-only node CLIs in docs-tools - ship-manifest.mjs (init, record, verify, resume-line, delete; two-phase atomic; pins and staleness exactly per the workflow's Resume semantics) and backlog-mutate.mjs (status-cell flip with old-line byte verification and drift refusal; insert-row with uniqueness gate, grammar, stem placement, and section-count maintenance). Vendored to installed repos; ship-tasks doctrine names them so agents reach for the tool instead of hand-sed.

Problem

Both real runs on 2026-07-16 (sachviet batch, cyberos batch 1) skipped per-step manifest writes and executed every backlog flip with hand-crafted sed. Nothing failed, but the two strongest disciplines in the contract - resume-after-crash and refuse-on-drift - existed only as prose. Two swarm agents were in fact killed mid-run in batch 1; recovery worked from commit archaeology, which is exactly what the manifest exists to replace.

<untrusted_content source="modules/cuo/chief-technology-officer/workflows/ship-tasks.md"> The manifest MUST be rewritten after EVERY completed, failed, or conditionally-skipped step - no step's outcome goes unrecorded. Writes are two-phase atomic. </untrusted_content>

Proposed Solution

node .cyberos/docs-tools/ship-manifest.mjs <cmd> and node .cyberos/docs-tools/backlog-mutate.mjs <cmd>, stdlib only, deterministic, --json envelopes, documented exit codes. The manifest tool implements ship-manifest@1 verbatim (pin at init, per-step artefact sha256, verify walks staleness in the workflow's order, resume-line echoes the mandated format, delete on done). The backlog tool is the byte-discipline executor for backlog-state-update@2: it never moves or deletes rows, refuses when the pre-image drifted, and keeps section-header counts true. Grammar authority stays where it is; the tool encodes it. Both vendor through guarded build.sh copies (the 084 lesson: docs-tools does not auto-vendor) and the ship-tasks doctrine gains two pointer sentences so doc-driven agents discover them.

Alternatives Considered

Success Metrics

Scope

In scope: the two CLIs, their suite, guarded build.sh vendor copies, two doctrine pointer sentences in ship-tasks.md.

Out of scope / Non-Goals

Dependencies

AI Authorship Disclosure

1. Description (normative)

2. Acceptance criteria

3. Edge cases

4. Out of scope / non-goals

Duplicated intentionally with ## Scope for template conformance: no contract semantics changes, no BRAIN emission, no coverage scoping.

5. Protected invariants this task must not weaken

End of TASK-IMP-085.

Audit

TASK-IMP-085-workflow-helpers spec audit - audit_rubric@2.0 (machine floor + judgment)

Machine floor: task-lint.mjs (first governed use). Judgment families walked by the model: QA semantics (metrics grounded in run evidence with baseline/target/deadline; alternatives distinct; scope subsections; no unsourced numerics; no cross-team claims), SAFE content (sourced blocks, no injection markers), TRACE semantic sufficiency (cited tests/ops evidence genuinely prove their clauses), COND-004 content (three labeled bullets truthful).

ISSUE ISS-001 (TRACE-001, fixed, MACHINE-CAUGHT): task-lint flagged clause 1.9 (the suite mandate) as uncited by any AC on the first run - the exact miss class the tool was built for, caught in the tool-builder batch itself. AC 10 added (ops verification via run_all glob discovery). Lint re-run: clean, exit 0. ISSUE ISS-002 (QA-005, wontfix-info): the "one combined tool" alternative is thin by design - the versioning-independence argument is the whole point; recorded as sufficient.

SUMMARY verdict: pass issues_open: 0 issues_human: 0 iterations: 2 next_action: ship

§gate-log

Populated during implementation (ship-tasks testing phase).