Skip to content

docs: enforce current documentation lifecycle - #1107

Merged
brokemac79 merged 5 commits into
mainfrom
codex/csw-122-doc-contract-safety
Aug 10, 2026
Merged

docs: enforce current documentation lifecycle#1107
brokemac79 merged 5 commits into
mainfrom
codex/csw-122-doc-contract-safety

Conversation

@brokemac79

@brokemac79 brokemac79 commented Aug 10, 2026

Copy link
Copy Markdown
Contributor

Summary

  • Introduce one exhaustive lifecycle manifest for generated documentation.
  • Keep proposed and historical proof pages intact, but remove them from canonical/indexable discovery and render clear lifecycle warnings.
  • Correct active dashboard guidance for the current operational-health zombie-run semantics introduced by fix: exclude zombie runs from operational health #1101.
  • Add deterministic checks and negative fixtures for lifecycle and health-contract drift.
  • Rebuild Pages when the lifecycle manifest changes.
  • State the 30- and 150-minute alert boundaries inclusively and pin the complete approval-gated field pair.

What Problem This Solves

The CSW-122 audit found that the generated site's llms.txt called immutable proof and an unapproved queue-split proposal “Canonical documentation.” Those pages were also rendered without lifecycle warnings. Separately, the active dashboard runbook still said every queued run older than 30 minutes degrades health, while #1101 excludes runs older than 24 hours as separately reported zombies.

These conflicts can make agents follow historical or proposed material and can make operators misread a healthy dashboard snapshot.

Why This Change Was Made

config/documentation-site.json is now the exhaustive lifecycle source for the public docs build. The generator derives navigation, search, sitemap, and llms.txt from the active allowlist. Historical proof, the historical containment handoff, and the unapproved queue-split proposal keep their stable generated URLs, but receive visible lifecycle banners, noindex, follow, and no canonical discovery entry.

check:docs rejects unclassified or multiply classified pages and ties the documented operational-health thresholds/fields to dashboard/operational-health.ts.

User Impact

Readers and agents see only current documentation in canonical discovery. Preserved evidence remains linkable but cannot be mistaken for current operator guidance. Dashboard operators now see the exact 30-minute-to-24-hour queue window, >24-hour zombie behavior, approval-gated counters, and 150-minute running threshold.

Validation

  • node --test test/check-docs.test.ts test/docs-site-theme.test.ts — 17/17 passed
  • pnpm run check:docs — passed
  • pnpm run check:limits — passed
  • pnpm run build:all — passed
  • pnpm run check:active-surface — passed
  • pnpm run check:dashboard-queue-boundary — passed
  • focused oxfmt --check — passed
  • git diff --check — passed
  • dirty-patch Codex review — no actionable findings
  • committed Codex review against origin/main — no actionable findings
  • local ClawSweeper review --local-range against origin/mainkeep_open, high confidence, no GitHub mutation

Real Behavior Proof

Claim: The real generated documentation output preserves non-current pages while excluding them from canonical discovery, labels them visibly and with noindex, and retains active current pages. The health documentation remains tied to the runtime constants and public field names.

Exercised surface: Exact pushed head f6fcd47d3736ffcbf527680a17dfdfd9a883d536; the production docs generator; Pages path trigger; generated navigation, sitemap, llms.txt, proposal/historical/proof HTML; check:docs; focused checker/site tests.

Scenario: A clean GitHub clone of the pushed branch was built inside Docker-backed Crabbox. The proof asserted that live-dashboard.html remains canonical; queue split, containment history, and proof URLs are absent from canonical discovery; preserved pages contain noindex, follow and lifecycle banners; all focused negative and positive tests pass.

Command/environment: Crabbox 0.40.0, explicit repository-required provider=local-container, image node:24-bookworm, --no-hydrate --no-sync; the script cloned the exact pushed public branch because two normal sync attempts failed before execution with rsync protocol code 12.

Observed result: CSW122_PR1_HEAD=f6fcd47d3736ffcbf527680a17dfdfd9a883d536, 17/17 tests passed, Documentation checks passed, manifest path trigger present, CSW122_PR1_PROOF=PASS, exit 0.

Artifact/trace: Lease cbx_cf906987454d (pearl-hermit), provider local-container, image node:24-bookworm, runStatus=succeeded, command 18.302s, lease stopped. Local harness: C:\clawsweeper-work\notes\csw-122-pr1-proof.sh.

Review disposition: Accepted the Pages-trigger finding, the inclusive 30/150-minute wording finding, the request to pin oldest_approval_gated_minutes, and the request to bind all four documented health fields to the exported runtime type with a removed-field negative test. All are implemented at this head; no finding was rejected.

Limits: This proves exact-head generation and lifecycle/contract assertions in a real Linux container. It does not deploy the site, mutate Cloudflare, change runtime health classification, or test search-engine recrawl timing.

OpenClaw Bay Impact

No Bay runtime, data contract, artwork, or controls change. The dashboard documentation now explains status fields already emitted by #1101. Bay remains observer-only.

Risks and Rollback

  • Risk: a current page omitted from the manifest now fails generation/checks instead of silently appearing. This is intentional fail-closed behavior.
  • Risk: non-current pages remain directly reachable, but are visibly classified and excluded from canonical discovery.
  • Rollback: revert this PR as one unit; there is no data, queue, deployment, or runtime migration.

Non-goals

  • No historical proof content is rewritten.
  • No queue-split proposal is approved.
  • No runtime, route, deployment logic, gate, queue, or state behavior changes; the only workflow change is the Pages input path trigger.
  • Remaining CSW-122 operator API/config/governance gaps are reserved for a stacked follow-up PR.

Stack / Order

This is PR 1 of the CSW-122 remediation. PR 2 will stack on this lifecycle manifest and will avoid the current #1105 limits/scheduler/target-dispatcher overlap. Merge this PR first.

Related

@clawsweeper

clawsweeper Bot commented Aug 10, 2026

Copy link
Copy Markdown
Contributor

🦞👀
ClawSweeper picked this up.

Pull request received. I will update this pull request when review starts.

@brokemac79
brokemac79 force-pushed the codex/csw-122-doc-contract-safety branch from b5b6176 to f2715f1 Compare August 10, 2026 18:32
@clawsweeper clawsweeper Bot added P3 Low-risk cleanup, docs, polish, ergonomics, or speculative feature. rating: 🦪 silver shellfish Thin PR readiness signal; proof, validation, or implementation needs work. status: 📣 needs proof The PR needs real behavior proof before ClawSweeper can clear the contributor ask. labels Aug 10, 2026
@clawsweeper

clawsweeper Bot commented Aug 10, 2026

Copy link
Copy Markdown
Contributor

Codex review: needs maintainer review before merge. Reviewed August 10, 2026, 3:40 PM ET / 19:40 UTC.

ClawSweeper review

What this changes

This PR makes a documentation lifecycle manifest control generated-site discovery, labels retained historical pages as noncanonical, and checks dashboard-health documentation against runtime constants and fields.

Merge readiness

⚠️ Ready for maintainer review - 2 items remain

Keep open: current main lacks this lifecycle manifest and its generator/checker integration, while the final head resolves the prior field-contract finding and has sufficient exact-head behavior proof. No actionable patch defect was found; this remains a draft awaiting normal maintainer review.

Priority: P2
Reviewed head: f6fcd47d3736ffcbf527680a17dfdfd9a883d536

Review scores

Measure Result What it means
Overall readiness 🐚 platinum hermit (4/6) The exact-head proof is strong and the focused implementation is sound, with normal maintainer review still warranted for public discovery behavior.
Proof confidence 🦞 diamond lobster (5/6) Sufficient (terminal): The PR body provides exact-head Docker-backed generated-site proof showing canonical discovery, lifecycle banners, noindex metadata, and passing focused checks.
Patch quality 🐚 platinum hermit (4/6) No actionable review findings were identified.

Verification

Check Result Evidence
Real behavior Verified Sufficient (terminal): The PR body provides exact-head Docker-backed generated-site proof showing canonical discovery, lifecycle banners, noindex metadata, and passing focused checks.
Evidence reviewed 6 items Current-main gap: The lifecycle manifest is new on this branch, so current main does not yet provide its exhaustive classification or generated-discovery behavior.
Canonical discovery implementation: The generator builds navigation from manifest sections and limits sitemap and llms.txt to the resulting canonical page set; noncanonical pages receive noindex lifecycle metadata.
Resolved prior finding: The final commit adds a negative fixture proving that removal of a documented approval-gated field from OperationalHealth is reported by the checker.
Findings None None.
Security None None.

How this fits together

The documentation generator turns repository Markdown and a lifecycle manifest into the public site’s navigation, sitemap, and agent-facing index. The documentation checker validates those classifications and selected dashboard-health claims against the runtime contract.

flowchart LR
  A[Repository documentation] --> B[Lifecycle manifest]
  B --> C[Documentation generator]
  C --> D[Navigation sitemap and agent index]
  A --> E[Documentation checker]
  F[Dashboard health contract] --> E
  E --> G[Drift findings]
Loading

Before merge

  • Resolve merge risk (P1) - Changing the lifecycle manifest now triggers Pages deployment, so an accidental canonical-page classification can alter public discovery; the checker and exact-head generated-output proof reduce but do not eliminate that review risk.
  • Complete next step (P2) - No discrete automated repair is indicated; the remaining action is ordinary maintainer review of this proof-backed draft.
Agent review details

Security

None.

Review metrics

Metric Value Why it matters
Lifecycle enforcement footprint 8 files affected; production +243/-45, tests +101/-1 The manifest, generator, checker, and Pages trigger change together, with focused tests covering the new enforcement path.

Root-cause cluster

Relationship: canonical
Canonical: #1107
Summary: This PR is the lifecycle foundation for a separately scoped stacked documentation PR.

Members:

Proposal only: this assessment does not dispatch repair, suppress jobs, mutate sibling items, close, or merge anything.

Merge-risk options

Maintainer options:

  1. Review the manifest before landing (recommended)
    Accept the Pages-trigger risk after a maintainer confirms that the listed canonical pages are the intended public discovery set and marks the draft ready.

Technical review

Best possible solution:

After confirming the manifest’s canonical set, land this focused lifecycle foundation first, then retarget the dependent operator-contract work in #1108.

Do we have a high-confidence way to reproduce the issue?

Not applicable: this is a documentation and generator change, and the PR provides an exact-head generated-output proof rather than a bug reproduction.

Is this the best way to solve the issue?

Yes: one manifest drives canonical discovery while retained evidence pages stay reachable but visibly noncanonical, and the checker guards both lifecycle and health-contract drift.

AGENTS.md: found and applied where relevant.

Codex review notes: model internal, reasoning high; reviewed against e13791786799.

Labels

Label changes:

  • add rating: 🐚 platinum hermit: Overall readiness is 🐚 platinum hermit; proof is 🦞 diamond lobster and patch quality is 🐚 platinum hermit.
  • add status: 👀 ready for maintainer look: ClawSweeper has no concrete contributor-facing blocker left for this PR. Sufficient (terminal): The PR body provides exact-head Docker-backed generated-site proof showing canonical discovery, lifecycle banners, noindex metadata, and passing focused checks.
  • remove status: ⏳ waiting on author: Current PR status label is status: 👀 ready for maintainer look.
  • remove rating: 🦐 gold shrimp: Current PR rating is rating: 🐚 platinum hermit, so this older rating label is no longer current.

Label justifications:

  • P2: This is a bounded operator-documentation and generated-site change with normal maintainer impact.
  • merge-risk: 🚨 automation: The PR changes the Pages workflow trigger and makes generated-site discovery fail closed on lifecycle drift.
  • rating: 🐚 platinum hermit: Overall readiness is 🐚 platinum hermit; proof is 🦞 diamond lobster and patch quality is 🐚 platinum hermit.
  • status: 👀 ready for maintainer look: ClawSweeper has no concrete contributor-facing blocker left for this PR. Sufficient (terminal): The PR body provides exact-head Docker-backed generated-site proof showing canonical discovery, lifecycle banners, noindex metadata, and passing focused checks.
  • proof: sufficient: Contributor real behavior proof is sufficient. The PR body provides exact-head Docker-backed generated-site proof showing canonical discovery, lifecycle banners, noindex metadata, and passing focused checks.

Evidence

What I checked:

  • Current-main gap: The lifecycle manifest is new on this branch, so current main does not yet provide its exhaustive classification or generated-discovery behavior. (config/documentation-site.json:1, f6fcd47d3736)
  • Canonical discovery implementation: The generator builds navigation from manifest sections and limits sitemap and llms.txt to the resulting canonical page set; noncanonical pages receive noindex lifecycle metadata. (scripts/build-docs-site.mjs:46, f6fcd47d3736)
  • Resolved prior finding: The final commit adds a negative fixture proving that removal of a documented approval-gated field from OperationalHealth is reported by the checker. (test/check-docs.test.ts:147, f6fcd47d3736)
  • Runtime-contract alignment: The current health implementation treats runs older than 24 hours as zombies and includes queue pressure from 30 minutes through that inclusive boundary, matching the revised documentation. (dashboard/operational-health.ts:105, 35b5f622c968)
  • Feature history: Current documentation navigation was introduced by the merged documentation-architecture change, and the checker was introduced by the merged drift-check change. (scripts/check-docs.mjs:81, 0559e03857fa)
  • Current-head proof: The PR body records a Docker-backed Crabbox run at the exact head with generated-output assertions, 17 focused tests passing, and check:docs passing. (test/docs-site-theme.test.ts:42, f6fcd47d3736)

Likely related people:

  • Martin Cleary: Merged current-main history attributes the documentation architecture and deterministic documentation checker to Martin Cleary. (role: introduced the documentation generator and checker foundations; confidence: high; commits: 2f547841c459, 0559e03857fa; files: scripts/build-docs-site.mjs, scripts/check-docs.mjs, docs/README.md)
  • Peter Steinberger: The merged zombie-run health change establishes the runtime boundaries and fields this PR binds into documentation checks. (role: introduced the operational-health behavior being documented; confidence: high; commits: 35b5f622c968; files: dashboard/operational-health.ts, docs/live-dashboard.md)

Rating scale

Score Internal tier Crab rank Meaning
6/6 S 🦀 challenger crab Exceptional readiness
5/6 A 🦞 diamond lobster Very strong readiness
4/6 B 🐚 platinum hermit Good normal PR; ordinary maintainer review
3/6 C 🦐 gold shrimp Useful, but confidence is limited
2/6 D 🦪 silver shellfish Proof or implementation needs work
1/6 F 🧂 unranked krab Not merge-ready
N/A NA 🌊 off-meta tidepool Rating does not apply

Overall follows the weaker of proof and patch quality.
Shiny media proof means a screenshot, video, or linked artifact directly shows the changed behavior. Runtime, network, CSP, and security claims still need visible diagnostics.

Workflow

  • ClawSweeper keeps one durable marker-backed review comment per issue or PR.
  • Re-runs edit this comment so the latest verdict, findings, and automation markers stay together instead of adding duplicate bot comments.
  • A fresh review can be triggered by eligible @clawsweeper re-review comments, exact-item GitHub events, scheduled/background review runs, or manual workflow dispatch.
  • PR/issue authors and users with repository write access can comment @clawsweeper re-review or @clawsweeper re-run on an open PR or issue to request a fresh review only.
  • Maintainers can also comment @clawsweeper review to request a fresh review only.
  • Fresh-review commands do not start repair, autofix, rebase, CI repair, or automerge.
  • Maintainer-only repair and merge flows require explicit commands such as @clawsweeper autofix, @clawsweeper automerge, @clawsweeper fix ci, or @clawsweeper address review.
  • Maintainers can comment @clawsweeper explain to ask for more context, or @clawsweeper stop to stop active automation.

History

Review history (5 earlier review cycles)
  • reviewed 2026-08-10T18:36:19.652Z sha f2715f1 :: needs real behavior proof before merge. :: none
  • reviewed 2026-08-10T18:49:53.532Z sha f2715f1 :: needs changes before merge. :: [P2] Trigger Pages when the lifecycle manifest changes
  • reviewed 2026-08-10T19:05:00.392Z sha 2c5e8ed :: needs changes before merge. :: [P2] State the inclusive alert thresholds
  • reviewed 2026-08-10T19:21:11.101Z sha 3df1b25 :: needs real behavior proof before merge. :: none
  • reviewed 2026-08-10T19:27:27.252Z sha 3df1b25 :: needs changes before merge. :: [P2] Validate documented health fields against the source

@brokemac79

Copy link
Copy Markdown
Contributor Author

@clawsweeper review

@clawsweeper

clawsweeper Bot commented Aug 10, 2026

Copy link
Copy Markdown
Contributor

🦞🧹
ClawSweeper re-review requested.

I asked ClawSweeper to review this item again.
Action: item re-review queued (workflow sweep.yml, event repository_dispatch).
Result: when the review finishes, ClawSweeper will create the durable review comment if needed or update the existing comment in place.

Re-review progress:

@clawsweeper clawsweeper Bot added merge-risk: 🚨 automation 🚨 Merging this PR could break CI, automerge, proof capture, label sync, or automation. P2 Normal priority bug or improvement with limited blast radius. proof: sufficient Contributor real behavior proof is sufficient. rating: 🦐 gold shrimp Decent PR readiness signal, but merge confidence is limited. status: ⏳ waiting on author ClawSweeper has contributor-facing work open and is waiting for author action. and removed P3 Low-risk cleanup, docs, polish, ergonomics, or speculative feature. status: 📣 needs proof The PR needs real behavior proof before ClawSweeper can clear the contributor ask. rating: 🦪 silver shellfish Thin PR readiness signal; proof, validation, or implementation needs work. labels Aug 10, 2026
@brokemac79

Copy link
Copy Markdown
Contributor Author

@clawsweeper re-review

@clawsweeper

clawsweeper Bot commented Aug 10, 2026

Copy link
Copy Markdown
Contributor

🦞🧹
ClawSweeper re-review requested.

I asked ClawSweeper to review this item again.
Action: item re-review queued (workflow sweep.yml, event repository_dispatch).
Result: when the review finishes, ClawSweeper will create the durable review comment if needed or update the existing comment in place.

Re-review progress:

@brokemac79
brokemac79 force-pushed the codex/csw-122-doc-contract-safety branch from 2c5e8ed to 3df1b25 Compare August 10, 2026 19:16
@clawsweeper clawsweeper Bot added status: 📣 needs proof The PR needs real behavior proof before ClawSweeper can clear the contributor ask. and removed status: ⏳ waiting on author ClawSweeper has contributor-facing work open and is waiting for author action. proof: sufficient Contributor real behavior proof is sufficient. labels Aug 10, 2026
@brokemac79

Copy link
Copy Markdown
Contributor Author

@clawsweeper re-review

@clawsweeper

clawsweeper Bot commented Aug 10, 2026

Copy link
Copy Markdown
Contributor

🦞🧹
ClawSweeper re-review requested.

I asked ClawSweeper to review this item again.
Action: item re-review queued (workflow sweep.yml, event repository_dispatch).
Result: when the review finishes, ClawSweeper will create the durable review comment if needed or update the existing comment in place.

Re-review progress:

@clawsweeper clawsweeper Bot removed the status: 📣 needs proof The PR needs real behavior proof before ClawSweeper can clear the contributor ask. label Aug 10, 2026
@clawsweeper clawsweeper Bot added proof: sufficient Contributor real behavior proof is sufficient. status: ⏳ waiting on author ClawSweeper has contributor-facing work open and is waiting for author action. labels Aug 10, 2026
@brokemac79

Copy link
Copy Markdown
Contributor Author

@clawsweeper re-review

@clawsweeper

clawsweeper Bot commented Aug 10, 2026

Copy link
Copy Markdown
Contributor

🦞🧹
ClawSweeper re-review requested.

I asked ClawSweeper to review this item again.
Action: item re-review queued (workflow sweep.yml, event repository_dispatch).
Result: when the review finishes, ClawSweeper will create the durable review comment if needed or update the existing comment in place.

Re-review progress:

@clawsweeper clawsweeper Bot added rating: 🐚 platinum hermit Good normal PR readiness with ordinary maintainer review expected. status: 👀 ready for maintainer look ClawSweeper has no concrete contributor-facing blocker left for this PR. and removed status: ⏳ waiting on author ClawSweeper has contributor-facing work open and is waiting for author action. rating: 🦐 gold shrimp Decent PR readiness signal, but merge confidence is limited. labels Aug 10, 2026
@brokemac79
brokemac79 marked this pull request as ready for review August 10, 2026 19:48
@brokemac79
brokemac79 requested a review from a team as a code owner August 10, 2026 19:48
@brokemac79
brokemac79 merged commit 2b5b345 into main Aug 10, 2026
21 checks passed
@brokemac79
brokemac79 deleted the codex/csw-122-doc-contract-safety branch August 10, 2026 19:48
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

merge-risk: 🚨 automation 🚨 Merging this PR could break CI, automerge, proof capture, label sync, or automation. P2 Normal priority bug or improvement with limited blast radius. proof: sufficient Contributor real behavior proof is sufficient. rating: 🐚 platinum hermit Good normal PR readiness with ordinary maintainer review expected. status: 👀 ready for maintainer look ClawSweeper has no concrete contributor-facing blocker left for this PR.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant