Skip to content

armgit / Pulse

Public Imported from GitHub
0

Real-time monitoring dashboard for Proxmox VE, PBS, Docker, Kubernetes, TrueNAS and vSphere. Self-hosted, with alerts for failed backups, full disks, unhealthy containers and offline nodes.

Add canonical agent preflight gate

rcourtmana4e2de310c27
diff --git a/docs/release-control/internal/AGENT_VALUES.md b/docs/release-control/internal/AGENT_VALUES.md
new file mode 100644
index 0000000000..567abab2df
--- /dev/null
+++ b/docs/release-control/internal/AGENT_VALUES.md
@@ -0,0 +1,135 @@
+# Pulse Agent Values
+
+This file is the canonical high-level values layer for Pulse agents.
+
+It exists so agent-facing guidance can stay short, stable, and principle-led
+while the detailed operating rules live in the control plane, active profile,
+status model, subsystem contracts, audits, and guardrails.
+
+This file is not a second protocol.
+It should explain what good behavior means, not restate the detailed steps
+that already belong to the canonical system.
+
+## Purpose
+
+1. Give agents a small, durable values layer before the detailed machinery
+ takes over.
+2. Keep prompt-level guidance principle-led instead of turning prompts into a
+ duplicate policy engine.
+3. Make the canonical system, not the prompt, carry the detailed operating
+ burden.
+
+## Values
+
+1. Follow the source of truth.
+ When governance, ownership, or current priority is unclear, resolve it from
+ the canonical control files instead of improvising local rules.
+2. Prefer one truth over repeated instruction.
+ If the same rule must keep being restated in prompts or chat, the system is
+ still too interpretive and should be strengthened at the canonical layer.
+3. Let values guide and let systems enforce.
+ Prompt-like guidance should express posture, priorities, and decision heuristics;
+ detailed enforcement should live in code, contracts, audits, schemas, and
+ governed control files.
+4. Make the right path the easy path.
+ Improve discovery, proof routing, and guardrails so agents naturally land
+ on the canonical path instead of needing verbose procedural reminders.
+5. Reduce drift, not just symptoms.
+ Fix the underlying source-of-truth, ownership, or audit gap before adding
+ more prompt detail.
+6. Prefer durable fixes over local success.
+ A patch is not complete if it only succeeds on the inherited path while the
+ canonical system remains weak or bypassable.
+7. Normalize durable direction.
+ When the user states a lasting product truth, consistency rule, or change
+ in priority, record it in the owning governance surface instead of leaving
+ it as chat.
+8. Keep prompts light.
+ Prompt text should set the agent in motion and point it at the canonical
+ system; it should not try to encode the whole operating manual.
+9. Route quietly.
+ Canonical resolution, lane mapping, claim checks, and similar governance
+ setup should happen as internal plumbing by default. Surface that machinery
+ only when it materially changes scope, blockers, or what the user needs to
+ understand next.
+10. Treat guardrail work as support work.
+ Proof routing, registry cleanup, contract ratchets, and guardrail-only test
+ additions can strengthen a lane, but they do not count as substantive lane
+ progress by themselves. Advancing lane state should normally require an
+ owned runtime or product-surface delta in the same slice unless the lane's
+ remaining gap is explicitly governance-only.
+11. Keep legacy support at the boundary.
+ Backward compatibility is acceptable only where a real external boundary,
+ migration edge, upgrade path, or explicit interoperability obligation still
+ requires it. Do not preserve or polish legacy-primary internal paths when a
+ canonical v6 path exists.
+12. Prefer the largest coherent slice.
+ When a claimed lane is already moving through one clear behavior arc on one
+ surface, prefer the largest same-surface slice that still has one coherent
+ proof story. Split work only when there is a real risk, concept, or proof
+ boundary, not merely because smaller residue items can be named.
+13. Treat scores and evidence as signals, not targets.
+ Lane scores, missing evidence references, and proof counts are diagnostic
+ signals that help identify the real runtime, product, ownership, or
+ governance gap. They are not the work item by themselves. Fix the actual
+ gap first, then record the proof that the gap is closed.
+14. Use worktrees when a mutating slice needs physical isolation.
+ Claims and lane ownership reduce logical overlap, but they do not isolate
+ hooks, dirty state, or staged scope. Use a dedicated worktree when a slice
+ needs that isolation — for example when a subagent needs to mutate
+ independently and land back cleanly. A shared checkout is fine for normal
+ single-session work.
+15. Let the active target choose the default queue.
+ When the active target is a lane-expansion initiative and
+ `status_audit.py --pretty` exposes an `available_candidate_lane_queue`,
+ treat that queue as the default next-pick surface.
+ Cleanup, presentation polish, and guardrail-only residue should normally
+ support a selected candidate lane or an active blocker rather than
+ displacing the queue.
+16. Make every governed slice explicit.
+ A mutating slice should carry exactly one active `work_claim` naming the
+ lane, candidate lane, coverage gap, or narrower governed item it advances.
+ If the slice is support-only plumbing, claim the owning governed surface
+ and say why that plumbing is required in the claim summary.
+ Before replacing or releasing the claim, record any same-lane residual in
+ the owning lane completion or follow-up surface instead of letting the task
+ disappear as informal context.
+
+## Delegation Rule
+
+Use this file for values and posture only.
+
+Use the detailed canonical system for specifics:
+
+1. `docs/release-control/CONTROL_PLANE.md`
+2. `docs/release-control/control_plane.json`
+3. the active profile's `SOURCE_OF_TRUTH.md`
+4. the active profile's `status.json`
+5. the active profile's development protocol
+6. subsystem registry and subsystem contracts
+7. audit scripts and guardrail tests
+
+If the values here and the detailed canonical system ever seem to disagree,
+the detailed canonical system is the path that must be corrected or clarified.
+Do not paper over that mismatch by expanding prompt-like guidance further.
+Use `python3 scripts/release_control/control_plane.py --agent-entrypoint --pretty`
+to print the canonical ordered bundle directly instead of reconstructing it
+from memory.
+Do that resolution quietly unless the result materially changes the plan,
+scope, or user-visible outcome.
+Use `python3 scripts/release_control/work_claim.py --kind ... --id ... --summary ... --agent-id ... --pretty`
+to reserve or renew exactly one governed slice without hand-editing
+`status.json`.
+
+## Current State
+
+1. Pulse now treats this file as the evergreen values entry point for agent
+ behavior.
+2. Prompt-level guidance should stay principle-led and delegate detailed rules
+ to the canonical control-plane and profile-specific surfaces.
+3. In concrete terms: prompt-like guidance should express posture, priorities, and decision heuristics.
+4. In concrete terms: the canonical system, not the prompt, carry the detailed operating burden.
+5. In concrete terms: governance routing should usually be automatic and mostly invisible to the user.
+6. In concrete terms: run `python3 scripts/release_control/agent_preflight.py --pretty`
+ as the first executable preflight, then reserve a claim and rerun it with
+ `--require-active-claim` before mutating a governed slice.
diff --git a/docs/release-control/v6/internal/CANONICAL_DEVELOPMENT_PROTOCOL.md b/docs/release-control/v6/internal/CANONICAL_DEVELOPMENT_PROTOCOL.md
new file mode 100644
index 0000000000..30a863d846
--- /dev/null
+++ b/docs/release-control/v6/internal/CANONICAL_DEVELOPMENT_PROTOCOL.md
@@ -0,0 +1,495 @@
+# Pulse v6 Canonical Development Protocol
+
+This is the canonical development protocol for the active v6 release profile.
+The evergreen Pulse control plane now lives in `docs/release-control/`.
+
+This protocol exists to make the repo constrained instead of interpretive.
+Future work should be difficult to do in the wrong shape.
+
+## Core Rule
+
+Each important concern in Pulse v6 must have:
+
+1. one canonical truth
+2. one obvious extension path
+3. explicit forbidden paths
+4. completion obligations when that truth changes
+5. at least one executable guardrail where practical
+
+If a subsystem does not satisfy those five properties, it is drift-prone.
+
+## V6 Modernization Invariants
+
+Every governed v6 slice inherits these rules, including lanes that already
+exist:
+
+1. identify the canonical v6 model for the surface before changing it
+2. route through unified resources when that is the canonical shape
+3. prefer canonical shared types, APIs, and paths over lane-local variants
+4. remove or isolate legacy host-era terminology, adapters, and compatibility
+ shims from primary runtime paths
+5. update subsystem ownership, path policies, and proof routing when runtime
+ ownership moves
+6. record any unavoidable modernization residual explicitly instead of treating
+ local improvement on a legacy path as lane completion
+
+These rules are retrospective.
+When an existing lane is touched, reviewed, or reopened, judge it against the
+same modernization bar as new lane work rather than assuming earlier work
+closed it permanently.
+
+## Required Operating Files
+
+For v6 work, agents must treat these startup files as the execution entry
+point:
+
+1. `docs/release-control/AGENT_VALUES.md`
+2. `docs/release-control/CONTROL_PLANE.md`
+3. `docs/release-control/control_plane.json`
+4. `docs/release-control/v6/SOURCE_OF_TRUTH.md`
+5. `docs/release-control/v6/CANONICAL_DEVELOPMENT_PROTOCOL.md`
+
+Use derived startup commands before escalating into the heavier machine control
+files:
+
+1. `python3 scripts/release_control/control_plane.py --agent-entrypoint --pretty`
+2. `python3 scripts/release_control/agent_preflight.py --pretty`
+3. `python3 scripts/release_control/status_audit.py --pretty`
+4. `python3 scripts/release_control/status_lookup.py --lane <LANE_ID> --pretty`
+5. `python3 scripts/release_control/status_lookup.py --assertion <ASSERTION_ID> --pretty`
+6. `python3 scripts/release_control/status_lookup.py --release-gate <GATE_ID> --pretty`
+7. `python3 scripts/release_control/status_lookup.py --followup <FOLLOWUP_ID> --pretty`
+8. `python3 scripts/release_control/status_lookup.py --work-claim <CLAIM_ID> --pretty`
+9. `python3 scripts/release_control/work_claim.py --kind ... --id ... --summary ... --agent-id ... --pretty`
+10. `python3 scripts/release_control/subsystem_lookup.py <path> [<path> ...] --pretty`
+
+Escalate into these raw machine files only when the current task genuinely
+needs their full detail:
+
+1. `docs/release-control/v6/status.json`
+2. `docs/release-control/v6/status.schema.json`
+3. `docs/release-control/v6/subsystems/registry.json`
+4. `docs/release-control/v6/subsystems/registry.schema.json`
+5. the relevant subsystem contract in `docs/release-control/v6/subsystems/`
+
+The startup files answer values, active target, profile selection, release
+priority, and stable operating rules.
+`AGENT_VALUES.md` is the values-only layer: it should stay small and
+principle-led, and prompt-like guidance should stay close to that layer rather
+than restating the detailed operating manual.
+`python3 scripts/release_control/control_plane.py --agent-entrypoint --pretty`
+is the executable way to print this ordered guidance bundle when discovery or
+repo entrypoint is not obvious.
+`python3 scripts/release_control/agent_preflight.py --pretty` is the first
+machine check after the control-plane bundle; it keeps the branch and target
+check visible before any mutation.
+After reserving a governed claim, rerun
+`python3 scripts/release_control/agent_preflight.py --require-active-claim --agent-id <AGENT_ID>`
+to verify that the claim is actually persisted before editing.
+That bundle should stay command-first: use `status_audit.py --pretty` and the
+`status_lookup.py` selectors to answer current-state questions before opening
+raw `status.json` or `registry.json`.
+`python3 scripts/release_control/work_claim.py --kind ... --id ... --summary ... --agent-id ... --write`
+is the executable way to reserve a governed work claim once the slice is
+chosen.
+In normal user-facing work, that resolution should stay quiet unless it
+materially changes the plan, the scope boundary, or the blocker story.
+`CONTROL_PLANE.md` and `control_plane.json` own the evergreen governance model
+and the active target.
+`scripts/release_control/control_plane_audit.py --check` is the stale-target
+guard for that evergreen layer.
+`SOURCE_OF_TRUTH.md` owns profile-specific governance, scope, locked decisions,
+and the readiness-assertion design rules.
+`status.json` owns live lane state, lane-to-subsystem ownership, lane
+completion records, the active readiness assertion catalog, readiness
+derivation rules, executable proof commands, structured evidence references,
+typed lane/subsystem decision records, active work claims, and the canonical machine-readable
+workspace repo catalog.
+Lane scores reaching target in `status.json` mean the tracked architecture and
+governance work for those lanes is at target; they are not, by themselves,
+approval to cut an RC or promote stable/GA if phase-blocking readiness
+assertions, `open_decisions`, or `release_gates` still remain.
+When the agent starts from a sibling repo or the shared workspace root, these
+same files are still authoritative; resolve them from `pulse/docs/release-control/v6/`
+rather than recreating release control in the current repo.
+Use `python3 scripts/release_control/status_audit.py --pretty` for the current
+machine-derived repo/governance, `rc_ready`, and `release_ready` summary. Use
+`docs/release-control/v6/HIGH_RISK_RELEASE_VERIFICATION_MATRIX.md` as the
+human runbook for clearing the manual high-risk gates represented in
+`status.json.release_gates`.
+Use `python3 scripts/release_control/status_lookup.py` for id-scoped lane,
+assertion, release-gate, followup, and work-claim views instead of printing
+the whole status audit when only one governed surface matters.
+`status.schema.json` owns the machine-readable status contract.
+`subsystems/registry.schema.json` owns the machine-readable subsystem registry
+contract, including explicit shared-runtime ownership declarations for
+intentionally multi-owner files.
+The protocol, subsystem registry, and subsystem contracts answer how work must
+be done.
+Readiness assertions are not a parallel checklist. They are the release truths
+written on top of those governed subsystem surfaces; `status.json.readiness_assertions`
+declares the active assertion catalog, proof references, and executable proof
+commands, while this protocol and `SOURCE_OF_TRUTH.md` define how that layer
+must behave.
+If the agent still needs repeated detailed prompt instruction to follow this
+system, that is a governance-system gap to fix here, not a reason to keep
+growing prompt prose.
+Likewise, if the agent keeps narrating setup or governance plumbing instead of
+using it quietly, that is a behavior-layer gap to fix here rather than a cue
+to accept process-diary output as normal.
+
+`scripts/release_control/status_audit.py --check` is the machine audit entry
+point for validating live lane evidence references, readiness assertion proof
+linkage, typed decision records, and derived evidence health. It also enforces
+canonical list ordering inside `status.json` so repo scope, lanes, readiness
+assertions, evidence references, and decision timelines do not drift into
+noisy, hand-arranged variants.
+`scripts/release_control/registry_audit.py --check` is the machine audit entry
+point for validating subsystem ownership, proof routing, registry lane
+bindings, canonical ordering for unordered registry lists, and path-policy
+reachability under first-match precedence.
+`scripts/release_control/contract_audit.py --check` is the machine audit entry
+point for validating structured contract metadata, section presence/order,
+registry/status linkage, explicit cross-subsystem dependency declarations, and
+canonical path references and shared-boundary declarations inside subsystem
+contracts.
+
+## Subsystem Contracts
+
+Each major subsystem contract must define:
+
+1. `Contract Metadata`
+2. `Purpose`
+3. `Canonical Files`
+4. `Shared Boundaries`
+5. `Extension Points`
+6. `Forbidden Paths`
+7. `Completion Obligations`
+8. `Current State`
+
+Current required subsystem contracts:
+
+1. `docs/release-control/v6/subsystems/alerts.md`
+2. `docs/release-control/v6/subsystems/api-contracts.md`
+3. `docs/release-control/v6/subsystems/cloud-paid.md`
+4. `docs/release-control/v6/subsystems/frontend-primitives.md`
+5. `docs/release-control/v6/subsystems/monitoring.md`
+6. `docs/release-control/v6/subsystems/organization-settings.md`
+7. `docs/release-control/v6/subsystems/patrol-intelligence.md`
+8. `docs/release-control/v6/subsystems/performance-and-scalability.md`
+9. `docs/release-control/v6/subsystems/security-privacy.md`
+10. `docs/release-control/v6/subsystems/unified-resources.md`
+
+If a major subsystem is refactored and does not have one of these files, the
+work is incomplete.
+
+The machine-readable ownership map for those subsystem contracts lives in
+`docs/release-control/v6/subsystems/registry.json`.
+Each contract must also carry structured metadata that binds the markdown file
+to its registry subsystem id, owning lane in `status.json`, and exact declared
+cross-subsystem dependencies implied by its canonical-file and extension-point
+references.
+If a runtime file is intentionally owned by multiple subsystems, that overlap
+must be declared explicitly in `registry.json` and mirrored in the contract's
+`Shared Boundaries` section; accidental overlap is not an allowed registry
+state. Shared-boundary entries must use the exact registry-derived sentence
+shape rather than freeform wording.
+
+## Task Completion Protocol
+
+Every substantial task must finish by checking these questions:
+
+1. Did I change a canonical contract?
+ If yes: update the relevant subsystem contract.
+2. Did I change live lane state, lane completion records, coverage-gap records, readiness derivation rules, readiness assertion proof routes, evidence references, or typed operational decision records?
+ If yes: update `status.json`.
+ This includes `lane_followups` when a bounded residual becomes concrete
+ enough to name directly without making it a blocker.
+ It also includes `coverage_gaps` when the current lane map no longer
+ models a durable product surface cleanly enough.
+ It also includes `candidate_lanes` when the intended lane split, lane
+ addition, or lane expansion shape is clear enough to name explicitly.
+3. Did I change stable governance, scope, evergreen readiness assertions, or lock a new architectural/release decision?
+ If yes: update `SOURCE_OF_TRUTH.md`.
+4. Did I replace an old path with a new canonical path?
+ If yes: add or tighten a guardrail so the old path cannot silently return.
+5. Did I add a new extension point?
+ If yes: record exactly where future work must attach to it.
+6. Did I leave compatibility code in runtime paths?
+ If yes: either remove it now or explicitly classify it as a boundary-only exception.
+7. Did the user state a durable product truth or change the current priority?
+ If yes: classify it as a readiness assertion, release gate, open decision,
+ or active-target update and record it in the owning control file instead of
+ leaving it as chat.
+ Treat casual phrases about consistency, seamlessness, drift, bypass
+ resistance, or things that "should always be true" as candidate governance
+ input, not only explicit requests to update the control system.
+8. Did the user casually raise a new quality bar or product invariant?
+ If yes: before ending the task, either normalize it into the control plane
+ or explain clearly why existing governance already covers it.
+8a. Am I about to narrate canonical setup that the user does not need?
+ If the information does not materially change the next action, blocker
+ state, or scope boundary, keep it internal and continue the work.
+9. Did I learn that the current lane map is hiding a durable product surface?
+ If yes: record a `coverage_gaps` entry with evidence, an explicit coverage
+ impact deduction, and the intended promotion path instead of burying the
+ discovery inside generic residual text.
+ When the intended destination is already clear, also add or update the
+ matching `candidate_lanes` record so the lane-expansion plan is typed,
+ machine-readable, and pointed at the owning control-plane target.
+ Once a lane-shaping gap (`new-lane`, `lane-split`, or `lane-expansion`)
+ has a typed `candidate_lanes` record, move that `coverage_gaps` entry to
+ `planned`; do not mark such a gap `planned` before the matching
+ `candidate_lanes` record exists.
+ `target-update` coverage gaps must stay out of `candidate_lanes`.
+10. Am I stopping because the lane is actually coherent, or only because the
+ first passing check landed?
+ If the result still has obvious same-lane gaps that make it feel partial,
+ fragile, or not realistically shippable, continue the slice or record the
+ remaining blocker/open decision before stopping.
+10a. Am I treating support work like product progress?
+ Guardrail-only proof routing, contract wording, registry cleanup, and
+ audit/test ratchets can support a lane, but they do not count as
+ substantive lane movement by themselves.
+ If the lane state is being advanced in `status.json`, the same slice
+ should normally also change an owned runtime or product surface for that
+ lane unless the remaining lane gap is explicitly governance-only.
+10aa. Am I treating score or evidence deltas as the task instead of as
+ diagnostics?
+ Missing evidence items, current-vs-target score, and proof counts are
+ signals that help locate the real same-lane gap.
+ They are not the work item by themselves unless the remaining gap is
+ explicitly governance-only.
+ For ordinary lane work, identify the runtime, product, ownership, or
+ behavior-coherence gap first, then prove that gap is closed.
+10ab. Did I check this lane against the canonical v6 model rather than only the
+ local path it already had?
+ Confirm whether the surface should now run through unified resources,
+ canonical shared types and APIs, explicit subsystem ownership, or retired
+ legacy terminology and shims.
+ If the lane still depends on a pre-v6-primary path, do not stop at local
+ cleanup; modernize it or record the remaining modernization gap explicitly.
+10ac. Am I preserving legacy internals when only boundary compatibility is
+ justified?
+ Legacy support is allowed only for explicit boundaries such as migrations,
+ upgrades, imports, external contracts, or wire compatibility that still
+ genuinely exist.
+ If I am improving an old internal path just to keep it alive alongside the
+ canonical v6 path, that is drift. Retire it or record the exception
+ explicitly as boundary-only compatibility rather than treating it as normal
+ lane progress.
+11. Is the remaining work still part of this lane?
+ If not, stop cleanly and normalize it into the next target, another lane,
+ or an explicit open decision instead of letting this task expand forever.
+12. If I am recording a bounded residual, do the tracking references point to
+ the same lane and stay genuinely unresolved?
+ Pair lane `status` and `completion.state` coherently: `complete` goes with
+ `target-met`, `bounded-residual` goes with `partial`, and `open` must not
+ be paired with `target-met`.
+ `partial` means measurable progress, so it must not sit at zero score.
+ `not-started` means zero score and `open`. `blocked` remains an `open`
+ lane below target rather than a residual or complete state.
+ Blocked lanes must declare typed same-lane blocker references to unresolved
+ readiness assertions, release gates, or open decisions.
+ `completion.tracking` is only for bounded residuals; if the lane is still
+ `open` or already `complete`, leave that list empty until the lane reaches
+ its current floor and the remaining work becomes a governed residual.
+ Do not keep a lane in `bounded-residual` by pointing at already-passed
+ assertions, cleared release gates, or completed targets.
+ Bounded residual tracking must use a lane followup, readiness assertion,
+ release gate, or open decision rather than a broad target reference.
+ Treat `lane_followups` as active residual records rather than loose backlog
+ notes: each one should stay referenced by the owning lane's
+ `bounded-residual` `completion.tracking`.
+ Once a lane followup is no longer active residual work, remove it from
+ `lane_followups` instead of leaving it behind with a completed status.
+
+This is the minimum update set for canonical work:
+
+1. implementation
+2. verification
+3. contract update
+4. guardrail/ratchet update when an old path is retired
+
+This minimum update set is a floor.
+It does not mean the task should stop at the first minimally valid patch when
+the next obvious same-lane work is still required for a coherent outcome.
+When a lane reaches its current target but still has intentionally bounded
+residual work, the same slice must record that residual in
+`status.json.lanes[*].completion` with a short rationale and explicit tracking
+references to the governing lane followup, readiness assertion, release gate,
+or open decision that owns the follow-up.
+When feature work fits an existing lane, reopen that lane's completion state or
+score instead of pretending the map is still complete.
+Existing lanes are not grandfathered out of the modernization rules.
+If a previously touched lane still relies on a non-canonical v6 path, lower
+its claimed completeness and continue from the canonical model rather than
+treating the earlier local improvement as sufficient.
+Do not preserve legacy-primary internal flows under the label of
+compatibility. Legacy support belongs at explicit boundaries only; when the
+primary internal mechanism is still old-path-first, the lane remains
+incomplete unless that exception is explicitly governed.
+Within an active claimed lane, prefer the largest coherent same-surface slice
+that still has one proof story.
+Do not break one modernization or canonicalization arc into many tiny residue
+commits unless there is a real risk boundary, concept boundary, or proof
+boundary that makes the split necessary.
+When feature work does not fit any existing lane cleanly, record a
+`coverage_gaps` entry so the lane map itself can evolve.
+When the durable future lane shape is clear, express that promotion path in
+`status.json.candidate_lanes` instead of leaving it only in prose.
+Before starting governed work in a multi-agent session, record a lease-style
+`status.json.work_claims` entry for the governed item you are taking and do
+not pick an item that already has an active claim.
+Once the slice is chosen, record that claim immediately before deeper
+investigation, targeted test execution, or code changes on that slice.
+Prefer `scripts/release_control/work_claim.py` for that reservation flow
+rather than hand-editing `status.json`.
+Support-only slices are not exempt from this rule: claim the owning lane or
+the narrower governed item they unblock, and say in the claim summary why the
+plumbing is necessary for that governed surface.
+When the slice is mutating and another mutating agent is already active,
+prefer `scripts/release_control/worktree_base.py` first so the canonical clean
+landing worktree for the base branch exists,
+then prefer `scripts/release_control/worktree_claim.py` so the claim is reserved
+and the branch/worktree are isolated in one step.
+When an isolated mutating slice is finished and the base branch worktree is
+clean, prefer `scripts/release_control/worktree_finish.py` to land the scoped
+commit(s) back onto the base branch worktree instead of leaving manual merge
+cleanup for later.
+If you are continuing straight from one governed slice to another, replace the old claim with the new claim in the same `status.json` edit so the live claim
+set never passes through a temporary unclaimed window.
+If you are stopping without finishing the lane, record the remaining same-lane
+residual in `status.json.lanes[*].completion`, `status.json.lane_followups`,
+`status.json.coverage_gaps`, or another owning governed surface before you replace or release the claim.
+Treat a broad lane claim as blocking narrower same-lane blocker or follow-up
+claims until that broad claim is released or expires.
+Treat lane completion, lane coverage, and coverage planning as separate
+derived signals.
+`status_audit.py --pretty` may derive a lane-completion score from
+`current_score/target_score`, a lane-coverage score from unresolved
+`coverage_gaps`, a coverage-planning score from unresolved `coverage_gaps`
+that still lack explicit `candidate_lanes`, and a conservative
+governed-surface score as the lower of completion and coverage.
+Treat those scores and any missing evidence counts as diagnostic summaries,
+not as the task itself.
+Use them to choose the real remaining gap on the owned surface rather than
+optimizing directly for score movement or evidence-count closure unless the
+remaining work is explicitly governance-only.
+When lane-expansion work is the intended target, that same audit output may
+also derive a ranked `candidate_lane_queue` so agents can take the highest
+impact valid candidate lane first.
+That same audit output may also derive `available_candidate_lane_queue`,
+active-versus-expired `work_claims`, and claim-conflict records so agents have
+an executable "do not overlap" surface instead of only prose.
+Those claim surfaces reduce logical overlap.
+For lane followups, readiness assertions, release gates, and open decisions,
+those tracking references must also reference the same lane; unrelated
+governance objects are not valid residual placeholders.
+
+This protocol is enforced locally at commit time by the canonical completion
+guard in `scripts/release_control/canonical_completion_guard.py` and by the
+governance guardrail tests in `internal/repoctl`.
+Local pre-commit governance checks must evaluate staged v6 control-file content
+rather than unstaged working-tree noise.
+Executable readiness assertion proofs must also follow the active target phase
+from `docs/release-control/control_plane.json`; repo-ready proof runs alone are
+not sufficient once the active target advances to an RC or GA promotion phase.
+Local pre-commit must also reject any unstaged working-tree edits for
+hook-sensitive governance files under `docs/release-control/v6/`,
+`scripts/release_control/`, `internal/repoctl/`, `.husky/pre-commit`, and
+`.github/workflows/canonical-governance.yml`, because those local checks still
+execute or structurally read the working-tree versions. Partial staging is one
+instance of this broader prohibition.
+Local formatter steps must also stay scoped to staged files so the hook does not
+mutate unrelated dirty worktree state.
+When formatting staged Go files, the formatter must operate on staged blobs in
+the git index rather than rewriting the whole repo or restaging whole files.
+
+For runtime subsystem changes, the same commit must now include:
+
+1. the matching subsystem contract update
+2. any dependent subsystem contract whose `Canonical Files`, `Shared Boundaries`, or `Extension Points` explicitly reference a touched runtime path
+3. at least one matching verification artifact update
+
+A staged contract file only counts when the staged diff changes a substantive
+contract section such as `Purpose`, `Canonical Files`, `Shared Boundaries`, `Extension Points`,
+`Forbidden Paths`, `Completion Obligations`, or `Current State`. Metadata-only
+edits are not sufficient completion proof for runtime changes.
+
+Verification artifacts are subsystem-specific. The allowed proof classes are
+defined in `docs/release-control/v6/subsystems/registry.json` and may include
+explicit guardrail files, contract tests, benchmark/SLO/query-plan artifacts,
+approved test-prefix matches, non-test contract/type files, or same-subsystem
+tests only when the registry explicitly allows them.
+
+Cross-subsystem contract dependencies are not advisory. If a touched runtime
+path is named in another subsystem contract's `Canonical Files`,
+`Shared Boundaries`, or `Extension Points`, the canonical completion guard now requires that dependent
+contract to be staged in the same slice.
+
+`status.json` evidence references must use repo-qualified relative paths.
+Absolute machine-local paths are forbidden.
+
+When a subsystem defines ordered `path_policies`, each touched runtime file must
+satisfy the first matching proof policy for that file. The v6 registry requires
+explicit path-policy coverage for every governed subsystem, and default
+subsystem verification is no longer a supported governed path. New owned
+runtime files must therefore be added to a concrete proof route instead of
+inheriting subsystem-default verification.
+
+## Guardrails
+
+Canonical architecture is not considered real until the repo can enforce it.
+
+Preferred guardrail types:
+
+1. code standards tests that ban deprecated paths
+2. contract tests that lock payload/wire shapes
+3. query-plan and performance tests for hot paths
+4. parity tests during migrations
+5. drift tests for generated or embedded artifacts
+
+Documentation alone is not sufficient when a rule can be made executable.
+
+The canonical completion guard is the default repo-level enforcement point for
+subsystem contract updates and proof-of-change verification updates.
+That enforcement must run both in local hooks and in CI; bypassable local-only
+governance is not sufficient.
+
+## How To Extend Pulse
+
+Before adding new behavior, the author must answer:
+
+1. Which subsystem contract owns this change?
+2. Which canonical files are allowed to carry the truth?
+3. Which extension point should be used?
+4. Which paths are forbidden for this kind of change?
+5. Which tests or guardrails must change with it?
+
+If those answers are not obvious in under a minute, the subsystem still needs
+architectural hardening.
+
+Use `python3 scripts/release_control/subsystem_lookup.py <path> [<path> ...]`
+to ask the repo which subsystem, contract, proof route, live lane context,
+relevant decision records, and dependent contract-update obligations apply to a
+file set before editing.
+
+## Boundary Rule
+
+Compatibility is allowed only at explicit boundaries:
+
+1. migration loaders
+2. persisted upgrade readers
+3. temporary API translation layers with a removal plan
+
+Compatibility is not allowed to become the runtime source of truth.
+
+## Expected End State
+
+Pulse v6 should be:
+
+1. canonical by default
+2. extension-oriented instead of patch-oriented
+3. enforced by tests and guardrails
+4. obvious for both humans and agents to continue correctly
diff --git a/docs/release-control/v6/internal/SOURCE_OF_TRUTH.md b/docs/release-control/v6/internal/SOURCE_OF_TRUTH.md
index 075ae48b14..be2c992c13 100644
--- a/docs/release-control/v6/internal/SOURCE_OF_TRUTH.md
+++ b/docs/release-control/v6/internal/SOURCE_OF_TRUTH.md
@@ -204,7 +204,8 @@ Assertion design rules:
or target update, remove it from `coverage_gaps` instead of leaving it
behind as historical noise.
17. Before coding begins on a governed slice, record a `status.json.work_claims`
- entry for the chosen slice.
+ entry for the chosen slice, then verify it with
+ `python3 scripts/release_control/agent_preflight.py --require-active-claim --agent-id <AGENT_ID>`.
The claim is an audit trail: it records what is being worked on and
prevents accidental overlap if the same surface is resumed or handed off.
Expired claims no longer mark active work; remove them when encountered so
diff --git a/scripts/release_control/agent_preflight.py b/scripts/release_control/agent_preflight.py
new file mode 100644
index 0000000000..90b118f5ef
--- /dev/null
+++ b/scripts/release_control/agent_preflight.py
@@ -0,0 +1,139 @@
+#!/usr/bin/env python3
+"""Mechanical preflight for v6 agent sessions.
+
+The goal is to make the canonical checks executable so future sessions do not
+depend on chat memory:
+- confirm the active branch
+- confirm the active control plane target
+- confirm a persisted work claim when mutating a governed slice
+"""
+
+from __future__ import annotations
+
+import argparse
+import json
+import subprocess
+import sys
+from datetime import datetime, timezone
+from typing import Any
+
+from control_plane import active_control_plane
+from repo_file_io import REPO_ROOT
+from status_audit import load_status_payload
+from work_claim import split_claims_by_state
+
+DEFAULT_AGENT_ID = "codex"
+
+
+def current_branch() -> str:
+ result = subprocess.run(
+ ["git", "-C", str(REPO_ROOT), "branch", "--show-current"],
+ check=True,
+ capture_output=True,
+ text=True,
+ )
+ return result.stdout.strip()
+
+
+def audit_preflight(
+ *,
+ agent_id: str,
+ require_active_claim: bool,
+ staged: bool = False,
+) -> dict[str, Any]:
+ control_plane = active_control_plane(staged=staged)
+ status_payload = load_status_payload(staged=staged)
+ now = datetime.now(timezone.utc)
+ active_claims, expired_claims = split_claims_by_state(
+ status_payload.get("work_claims", []),
+ now_utc=now,
+ )
+ agent_active_claims = [
+ claim for claim in active_claims if str(claim.get("agent_id")) == agent_id
+ ]
+
+ errors: list[str] = []
+ branch = current_branch()
+ expected_branch = str(control_plane["prerelease_branch"])
+ if branch != expected_branch:
+ errors.append(
+ f"current branch {branch!r} does not match active prerelease branch {expected_branch!r}"
+ )
+ if require_active_claim and len(agent_active_claims) != 1:
+ errors.append(
+ f"expected exactly one active work claim for agent {agent_id!r}, "
+ f"found {len(agent_active_claims)}"
+ )
+
+ return {
+ "branch": branch,
+ "expected_branch": expected_branch,
+ "active_profile_id": control_plane["active_profile_id"],
+ "active_target_id": control_plane["active_target_id"],
+ "agent_id": agent_id,
+ "require_active_claim": require_active_claim,
+ "active_claim_count": len(active_claims),
+ "agent_active_claim_count": len(agent_active_claims),
+ "expired_claim_count": len(expired_claims),
+ "active_claim_ids": [str(claim.get("id")) for claim in active_claims],
+ "agent_active_claim_ids": [str(claim.get("id")) for claim in agent_active_claims],
+ "errors": errors,
+ }
+
+
+def render_pretty(report: dict[str, Any]) -> str:
+ lines = [
+ "agent_preflight:",
+ f" branch={report['branch']}",
+ f" expected_branch={report['expected_branch']}",
+ f" active_profile_id={report['active_profile_id']}",
+ f" active_target_id={report['active_target_id']}",
+ f" active_claim_count={report['active_claim_count']}",
+ f" expired_claim_count={report['expired_claim_count']}",
+ f" agent_id={report['agent_id']}",
+ f" agent_active_claim_count={report['agent_active_claim_count']}",
+ f" require_active_claim={report['require_active_claim']}",
+ ]
+ if report["active_claim_ids"]:
+ lines.append(f" active_claim_ids={', '.join(report['active_claim_ids'])}")
+ if report["agent_active_claim_ids"]:
+ lines.append(f" agent_active_claim_ids={', '.join(report['agent_active_claim_ids'])}")
+ if report["errors"]:
+ lines.append(" errors:")
+ lines.extend(f" - {error}" for error in report["errors"])
+ else:
+ lines.append(" status=passed")
+ return "\n".join(lines)
+
+
+def parse_args(argv: list[str] | None = None) -> argparse.Namespace:
+ parser = argparse.ArgumentParser(description="Run the canonical v6 agent preflight.")
+ parser.add_argument(
+ "--agent-id",
+ default=DEFAULT_AGENT_ID,
+ help="Agent id to verify against active work claims (default: codex).",
+ )
+ parser.add_argument(
+ "--require-active-claim",
+ action="store_true",
+ help="Fail unless the agent has exactly one active claim.",
+ )
+ parser.add_argument("--staged", action="store_true", help="Read staged repo JSON if available.")
+ parser.add_argument("--pretty", action="store_true", help="Print a human-readable summary.")
+ return parser.parse_args(argv)
+
+
+def main(argv: list[str] | None = None) -> int:
+ args = parse_args(argv)
+ report = audit_preflight(
+ agent_id=args.agent_id,
+ require_active_claim=args.require_active_claim,
+ staged=args.staged,
+ )
+ output = render_pretty(report) if args.pretty else json.dumps(report, indent=2, sort_keys=True)
+ print(output)
+ return 0 if not report["errors"] else 1
+
+
+if __name__ == "__main__":
+ raise SystemExit(main(sys.argv[1:]))
diff --git a/scripts/release_control/agent_preflight_test.py b/scripts/release_control/agent_preflight_test.py
new file mode 100644
index 0000000000..012fdeed86
--- /dev/null
+++ b/scripts/release_control/agent_preflight_test.py
@@ -0,0 +1,69 @@
+import unittest
+from unittest.mock import patch
+
+import agent_preflight
+
+
+class AgentPreflightTest(unittest.TestCase):
+ def test_audit_preflight_passes_when_branch_and_active_claim_match(self) -> None:
+ control_plane = {
+ "prerelease_branch": "pulse/v6-release",
+ "active_profile_id": "v6",
+ "active_target_id": "v6-rc-stabilization",
+ }
+ status_payload = {
+ "work_claims": [
+ {
+ "id": "codex-lane-l13",
+ "agent_id": "codex",
+ "work_item": {"kind": "lane", "id": "L13"},
+ "claimed_at": "2026-03-20T10:00:00Z",
+ "expires_at": "2026-03-20T12:00:00Z",
+ }
+ ]
+ }
+
+ with patch.object(agent_preflight, "active_control_plane", return_value=control_plane), patch.object(
+ agent_preflight, "load_status_payload", return_value=status_payload
+ ), patch.object(agent_preflight, "current_branch", return_value="pulse/v6-release"):
+ report = agent_preflight.audit_preflight(agent_id="codex", require_active_claim=True)
+
+ self.assertEqual(report["errors"], [])
+ self.assertEqual(report["active_claim_count"], 1)
+ self.assertEqual(report["agent_active_claim_count"], 1)
+
+ def test_audit_preflight_requires_active_claim_for_agent(self) -> None:
+ control_plane = {
+ "prerelease_branch": "pulse/v6-release",
+ "active_profile_id": "v6",
+ "active_target_id": "v6-rc-stabilization",
+ }
+ status_payload = {"work_claims": []}
+
+ with patch.object(agent_preflight, "active_control_plane", return_value=control_plane), patch.object(
+ agent_preflight, "load_status_payload", return_value=status_payload
+ ), patch.object(agent_preflight, "current_branch", return_value="pulse/v6-release"):
+ report = agent_preflight.audit_preflight(agent_id="codex", require_active_claim=True)
+
+ self.assertTrue(report["errors"])
+ self.assertIn("expected exactly one active work claim", report["errors"][0])
+
+ def test_audit_preflight_flags_branch_mismatch(self) -> None:
+ control_plane = {
+ "prerelease_branch": "pulse/v6-release",
+ "active_profile_id": "v6",
+ "active_target_id": "v6-rc-stabilization",
+ }
+ status_payload = {"work_claims": []}
+
+ with patch.object(agent_preflight, "active_control_plane", return_value=control_plane), patch.object(
+ agent_preflight, "load_status_payload", return_value=status_payload
+ ), patch.object(agent_preflight, "current_branch", return_value="main"):
+ report = agent_preflight.audit_preflight(agent_id="codex", require_active_claim=False)
+
+ self.assertTrue(report["errors"])
+ self.assertIn("does not match active prerelease branch", report["errors"][0])
+
+
+if __name__ == "__main__":
+ unittest.main()
diff --git a/scripts/release_control/control_plane.py b/scripts/release_control/control_plane.py
index 5e7aff75a9..95cff697d7 100644
--- a/scripts/release_control/control_plane.py
+++ b/scripts/release_control/control_plane.py
@@ -315,6 +315,7 @@ def agent_entrypoint(*, staged: bool = False) -> dict[str, Any]:
resolved["registry_schema_rel"],
]
startup_commands = [
+ "python3 scripts/release_control/agent_preflight.py --pretty",
"python3 scripts/release_control/status_audit.py --pretty",
]
targeted_lookup_commands = []
diff --git a/scripts/release_control/control_plane_audit_test.py b/scripts/release_control/control_plane_audit_test.py
index ef8acb5fe5..a21522fc85 100644
--- a/scripts/release_control/control_plane_audit_test.py
+++ b/scripts/release_control/control_plane_audit_test.py
@@ -96,7 +96,10 @@ class ControlPlaneAuditTest(unittest.TestCase):
)
self.assertEqual(
entrypoint["startup_commands"],
- ["python3 scripts/release_control/status_audit.py --pretty"],
+ [
+ "python3 scripts/release_control/agent_preflight.py --pretty",
+ "python3 scripts/release_control/status_audit.py --pretty",
+ ],
)
if entrypoint["active_target_id"] == "v6-product-lane-expansion":
self.assertEqual(entrypoint["default_pick_surface"], "available_candidate_lane_queue")