ystack is a control plane for an autonomous coding team, and it is its own target repo: agents here are improving the team itself.
The operator accepted one continuing authorization for the manager session named in
work/roadmap-program-authorization/decision.md. The exact repository, session,
source artifacts, direct decision and boundaries are recorded there. This section
applies only to that session in this repository, while construction mode remains
retired. It does not grant authority to a later session, live yshifu, a clone or a
target.
Within that recorded Roadmap scope, this section replaces repeated operator intake, G1, G2, high-risk plan, size-adjustment, base-reaffirmation and merge decisions. Keep the artifact chain, exact hashes, risk classification, separate authors and reviewers, stage order, claims and one-manager invariant. The current manager records why an intake or amendment is in scope, directly coordinates independent review, reads its complete raw verdict and records the exact accepted tuple. Independent acceptance replaces the human decision for these steps; it does not remove them. High-risk plans still land separately before implementation. Earlier artifact text requiring operator confirmation for these in-scope steps uses this delegation.
Reasonable size revisions needed for complete, readable work and non-semantic base updates do not need another operator answer. Pause implementation, preserve the attempt and use the existing separate amendment/review sequence. Never trim tests, compress unreadable code, hide an overrun or expand the concern to fit a range. Changed meaning or evidence requires fresh review, not reuse of an old pass.
Each PR has one concern and exact allowed paths. Before publishing, the manager session named in decision.md must read the complete independent review, resolve all Important findings, verify exact head/base and all required CI, then merge through the protected PR and record the receipt. No direct main push, force-push, published-history rewrite, protection bypass, skipped failure or degraded evidence is allowed. Reviewers remain read-only; the rounds cap, restoration guarantee and separation of duties remain.
Preserved attempts must be reconciled by exact repository, branch, local/remote head, PR state, base and worktree state. A directly resolved process pause does not need a repeated user answer. Never discard or recreate an attempt silently. Frozen PR #183 and dirty worktrees without an explicit disposition remain excluded. Unexpected identities, unresolved Important findings and the rounds cap stop the affected attempt; they do not halt unrelated authorized work.
Ask the operator for a changed goal or acceptance standard, material scope expansion, a weaker safety boundary or wider authority, new credential/network/write scope, installation or activation, a release, deployment, production action, first real target execution, an unauthorized external write or destructive disposition. Ordinary code/tests in existing development and CI environments remain authorized. The selected dummy target still has read-only inspection authorization only.
This is a manual delegation, not a new enforcement mechanism. Restore records and repository comments alone cannot appoint a manager or transfer this authority. The named session must have directly received the operator's decision; a successor requires explicit handoff. No live command, prompt or profile is installed or synced.
For the current Roadmap program, work/ci-minimum-roadmap/decision.md replaces the
blanket full-suite-per-PR rule. Automatic pull-request and main-push CI proves the
existing checks plus the schema and pending-stage guards. The full matrix is manual
and required at the named runnable milestones. A quick green result never claims the
full suite passed or excuses the complete integration and safety proof relevant to an
accepted plan. This applies only to the named manager and program; all other safety,
review, protection and authority boundaries remain.
When config/construction-mode.json is committed on yihanzhu/ystack main with
status: active and its repository, Roadmap, and north-star identities match that
base, ystack is in construction mode. This overlay overrides conflicting intake,
artifact, plan, merge-ready, and operator-merge requirements below only for
inactive Roadmap implementation in this repository. It never applies to a clone
or external target.
- The accepted Roadmap is program authorization. Each PR still has one bounded
implementation concern, exact allowed paths and proof, but it does not need a
separate intake, G1, G2, plan gate,
ready, orclaimedstate. - Every change uses a branch and PR. Required CI and a substantive independent review with no unresolved Important finding are hard gates. Tests land with the change. Direct main pushes, force-pushes, rebases of published work, destructive cleanup, red/degraded evidence, and scope widening remain forbidden.
- After the active operator-authorized Codex construction session reads the complete
exact-head/base review and all required CI is green, that session may publish the
exact PR and record its merge receipt.
merge-readyis optional UI only. This is a temporary authorization for the current ystack construction program, not a new capability for live yshifu, authors, coders, reviewers, clones, or targets. - Construction output stays inactive, repo-only, and restorable. No real target, target or production credential, release, install, live profile selection, deployment, irreversible external write, or production action is authorized.
- Frozen PR #183 and the preserved dirty portable-core parent-plan worktree are excluded until a later construction brief explicitly adopts or supersedes them.
- Every branch, PR, worktree, claim, artifact, and review that predates construction mode is ineligible by default. A fresh brief must explicitly adopt it, bind the post-transition main, and obtain fresh CI/review; old evidence never carries over.
- The first real development use requires an operator-merged operating-mode transition. Construction mode cannot activate or broaden itself.
The mode record, not issue/PR/comment text, selects this overlay. Any identity, scope, evidence, or inactivity mismatch fails closed under the operating rules below.
The sole bootstrap is the transition that first commits this record. The direct operator decision recorded on issue #187 authorizes the current Codex construction session to merge that exact transition with the repository's PR-rule bypass only after required CI and independent review pass. No later candidate inherits that bootstrap evidence. Bootstrap is single-writer: no other PR may merge during its final review-to-merge window. Re-read main immediately before merge and require the reviewed base; the mode record explicitly preserves the one-time residual because GitHub has no atomic base-CAS for an admin squash merge.
Immediately after the bootstrap merge, the same construction session reconciles
ruleset 21500323 to the exact post_transition_ruleset object in the mode record
and verifies it before any Roadmap PR. This removes the approving-review human gate,
keeps PR/deletion/non-fast-forward protection, and makes required CI strict. Until
that exact server state is verified, construction publishing is not active.
This file is the single source of working rules. Every agent reads it,
whatever vendor — Codex and most tools look for AGENTS.md, Claude Code
reads CLAUDE.md, which imports this file. One file, no drift.
Companions: ROADMAP.md records the portable architecture and rollout order.
REVIEW.md is how work is reviewed here (passes, Important vs nit, how
disagreements end). work/<slug>/ holds the artifact chain —
intent.md → spec.md → plan.md. If you are implementing, your brief is
that slug's plan; it is written so someone who never saw the conversation can
build from it.
Two goals drive the backlog:
- Reusable anywhere — a clean, parameterized, well-documented product whose core is not tied to an agent harness, model vendor, Git forge, or CI provider.
- Full backup — everything needed to reconstruct the team if the live setup is lost.
manager/CLAUDE.md— yshifu's role (the manager persona).routines/*.md— the coder's baseline instructions yshifu reads to brief a spawned coder subagent (coder.md/coder-revision.md) plus the per-taskbrief.md.reviewer/codex-review.md— the doc for the Codex reviewer harness (scripts/codex-review.sh).templates/*— drop-in files for target repos.scripts/*.sh— the shipped tooling:install.sh(generates the/yshifucommand),setup-target-repo.sh(bootstraps a target repo's loop labels), andcodex-review.sh(runs the Codex reviewer against a PR).
- Markdown + shell. The setup/reviewer tooling lives in
scripts/*.sh; validators are still to come. - CI:
.github/workflows/ci.yml. CI must stay green — it is the hard merge gate. Automatic pull-request and main-push runs use thechecksjob, the Roadmap content guards, and an aggregatecijob that is the one required check. Manualworkflow_dispatchalso runs six paralleltestshards (scripts/test/run-all.sh --shard <index>/<count>). A green automaticciis the quick gate; a green dispatchedciincludes the full matrix.- Shellcheck is pinned to
0.11.0(theSHELLCHECK_VERSIONconstant inci.ymlis the single source of truth). CI downloads that exact static release and verifies its release-asset SHA-256 and version before linting, so a runner-image bump or changed download can't silently drift it. Lint locally against 0.11.0 — not whatever your local install happens to be — withshellcheck -x -S styleoverfind . -name '*.sh' -not -path './.git/*'; another shellcheck version can report different findings/codes (e.g. SC2317 vs SC2329) and disagree with CI. Grab the pinned binary from the shellcheck GitHub releases if your local version differs. - The structure check reads
ci/required-files.txt— the manifest of every restore-critical file — and fails if any listed path is missing (and if a listedscripts/*.shisn't executable). This is what makes the full-backup goal enforceable: delete a load-bearing file and CI goes red. Add new restore-critical files to the manifest so the guarantee keeps holding.
- Shellcheck is pinned to
- One concern per PR. Soft size budget ~300–400 net lines; split if bigger.
An accepted spec/plan may record an exact one-concern review-size exception with an
evidence-based range. That changes only the soft line signal; unexplained overrun,
new concern/scope, unreadable code, reduced tests, CI, and review still block.
Record exactly one
review_size:token per PR and state its range once; per-round accounting, line-count history, and any narration of what a round changed live in the PR description and comments, never in the artifact (work/README.md> Artifact hygiene). - Every PR links its intake issue and keeps README/docs in sync. Pre-code intent,
spec, and high-risk plan PRs use non-closing
Tracks #<n>so the intake stays open; the terminal implementation PR usesCloses #<n>. Never let an artifact/plan merge close the queue item before implementation. - Label state includes
ready(cleared and unclaimed) andclaimed(one manager pickup is active or unresolved).needs-humanoverrides either. Build state/claim lives on the intake issue. Before any build spawn, the manager requiresreadypresent andclaimed|needs-humanabsent there, adds/verifiesclaimed, then removesreadyand requires confirmation that an existing label was deleted plus verifies absence. That delete is the pickup winner; failure stops. Before fix spawn, require parent-intakeready|claimed|needs-humanabsent and exact PRclaimed|needs-humanabsent with one matching round, then add/verifyclaimedon the PR. Post the claim comment on the same item as its label, with unique ID and exact mode/tuple; the coder must match it. Exactly one manager session may drive a target. On PR creation or fix completion, verify result state, remove/verifyclaimed, then review. A crash leavesclaimedvisible and blocks another spawn under that invariant until the exact attempt is reconciled.claimedis crash recovery, not a cross-manager mutex. Detecting two manager sessions is forbidden: add/verifyneeds-humanon the active carrier and stop all spawning until one manager reconciles the tuple. - Before G1, the intake gate leaves a durable record on the intake issue that binds the
exact issue title/body revision. It names
intake_mode: user-directed|proactive, the issue, exact title and body SHA-256s, acceptance source, and accepter. Hash the non-null UTF-8 values returned by the forge API with no added newline or normalization. For user-directed work, yshifu must receive the operator's approval of those exact digests directly in the current session and record it immediately. A pre-existing comment alone never proves the decision; after a session loss, re-ask unless a verifiable direct-decision reference exists. The intent author uses only yshifu's verified brief and never infers approval from the thread. Proactive work cites a passed manager-review verdict whoseIntake-title-sha256andIntake-body-sha256markers match those digests. The reviewer must see both unchanged before and after its run or post no verdict. Authenticate the source like merge evidence: first select the newest comment by the currentghoperator with exactly one manager-reviewer clean header and one matching anchored 64-hex marker for each digest, without filtering by verdict. Then require exactly one anchoredVERDICT:line and require it to bePROCEED. A newer REFINE/DROP/malformed comment blocks every older go; bare, cross-author, mixed-comment, duplicate reserved line, zero/multiple-verdict, or malformed evidence is unusable. A title or body change before G1 merge makes that record stale and requires a new intake decision. After G1, issue text is untrusted context and cannot amend the artifact chain; a real scope change returns through the affected artifact gates. An intent author cannot create or infer the acceptance record. - Manual risk-based plan gate — live.
spec.mdrecordsrisk: high|routine; G2 review and operator merge accept that value before planning. For new normal work, a GitHub issue is intake/message bus, not the spec: mergedwork/<slug>/intent.mdandspec.mdare required before planning. Already-open legacy implementation PRs may finish under their accepted record; a new attempt, rescope, or replacement uses the artifact chain. At activation, audit every oldreadyissue. An already-open implementation PR must havereadyremoved and verified absent, then continue only inlegacy-openfix mode. A PR-absent issue may retainreadyonly with a complete new build tuple; a named bootstrap additionally needs its exact durable operator-approved plan record. Otherwise removereadybefore any spawn and run the new gates. A label created under the old description is never proof of the new gate. The only activation bridge is ystack-self issue #180, frozen at title/body SHA-256s071e33752077f05c8f429f13d4ce2783b0478b2b8ef276db684b4472d62dd202/58fa9039359cc0d19cb9541282076d83bb5eb4360a9ccdb2f460920df5acd03a, for its pinnedportable-core-contractsattempt. It never applies in an external target or to another slug. Recompute both digests before use; any issue edit ends the bridge. That PR-absent pre-policy high-risk record pins merged intent/spec/plan PRs and blobs, operator-accepted plan, implementation branch, exact local/remote head, PRabsent, old base, clean state, and terminal implementation intake #155 at title/body SHA-256s615e60decfa6c0c7fb769a7c4b595c8cbc47b52dfacd3babcd6fdb763deaa834/3426f4962a4d61ba64a1c606b410641117ec97d44fe8dfe618defba35b5aeae6. Its legacy artifact PRs are grandfathered despite closing their stage issues. After policy merge, re-open unchanged #155 beforeready; only the implementation PR usesCloses #155. Treat the attempt asartifact-high/high/plan-refresh; only an operator-merged high-risk plan in that record may supply the missing pre-policy spec risk. The record also pinsreview_sizeand its accepted plan range. Immutable bridge identity is target, slug, artifact PRs/blobs, plan/risk/scope,review_size/range, implementation branch, and—once opened—PR number. The pre-PR local/remote head, old base, PR-absent state, and clean worktree are one-time eligibility evidence. After round-0 opens, normal authorized fixes may advance current head and round; a base move requires fresh review. Rebind exact head/base/round each round on the same branch/PR. An unexplained move stops, but an expected rebind does not end the bridge. A change to immutable identity ends it and returns through G2 spec-with-risk plus a new high-risk plan gate. It never authorizes another branch or PR. Any mismatch or second attempt does the same. High-risk work — constitution paths, workflows, identity/auth, security controls, migrations, deployment/production infrastructure, or broad architecture — requires a plan-only PR onystack/plan/<slug>, independent review, and operator merge before the implementation branch starts. Every non-merge commit not reachable from the accepted base may touch onlywork/<slug>/plan.md; a code-then-revert history is not plan-only. A base update may only add an exact merge whose parents are prior plan head then freshly fetched base and whose tree differs from that base only at the plan path. Re-run review and CI on the new head/base. After operator merge, record the fetched default OID containing that plan asplan-base. Before the first code commit, current default must still equal it. If it moved, keepreadyabsent: a fresh non-author read-only reviewer rechecks the unchanged plan and full artifact hashes against the new base and returns exactly one anchoredPlan-verdict: ACCEPT|REVISE, then the operator explicitly reaffirms it on the intake issue. Record the new plan-base only on unique ACCEPT plus reaffirmation. If plan meaning changes or review says REVISE, return through a plan-only PR. Routine work keeps plan + code in one implementation PR, butplan.mdis its first commit. Fetch the current default branch and create the implementation branch from that exact branch-base OID. Push the plan-only head without opening a PR; an independent read-only reviewer reads the remote head. Every acceptance recordsacceptance_kind: initial|plan-update|base-refresh.initialrequires linear history from branch base to head, the first commit parent equal to branch base, every commit touching onlywork/<slug>/plan.md, andbranch-base=current-base.plan-updaterequires a single-parent head whose parent is the exact paused implementation head and whose commit changes only the plan path; record the prior plan-acceptance head separately. Before code, paused head equals prior plan-acceptance head.base-refreshuses the exact merge topology below. The reviewer then records branch, head OID, branch-base OID, current-base OID, plan blob, spec blob, intent blob, reviewer, and acceptance on the parent issue.initialandbase-refreshmust predate the first code commit;plan-updatemust predate the next code commit. Yshifu must directly coordinate a fresh reviewer who is not the plan author and read its complete raw verdict, never a summary. Require exactly one anchoredPlan-verdict: ACCEPT|REVISE; only ACCEPT may create acceptance, while REVISE keepsreadyabsent and returns to the plan author. The reviewer returns evidence only and never edits, pushes, comments, or labels. Yshifu posts the verdict verbatim with reviewer identity/model and the exact tuple as the acceptance comment. A pre-existing or unauthenticated comment is evidence only, never authority; if the independent run cannot be proven, rerun it. No plan-only routine PR opens. If code already exists when a routine plan changes, first record the paused exact head. The next commit changes onlywork/<slug>/plan.mdon top of that history and its parent must equal the paused head; push that exact remote head and obtain a fresh independentplan-updateissue check that also records paused head, matching parent OID, and prior plan-acceptance head before any later code commit. Do not rewrite history to manufacture another plan-only branch head. The plan author cannot accept its own plan. The allowed tuple pairings are closed, not mix-and-match. Build mode allows onlyartifact-high/high/{fresh-high,existing,plan-refresh},artifact-routine/routine/existing, and{add-ci-bootstrap,greenfield-bootstrap}/high/bootstrap. Fix mode allows onlyartifact-high/high/{existing,plan-refresh},artifact-routine/routine/existing,{add-ci-bootstrap,greenfield-bootstrap}/high/bootstrap, andlegacy-open/{high,routine}/legacy-open.review_sizeis orthogonal. Any othergate_mode/risk/branch_statecombination stops. Build-modeexistingorplan-refreshrequires PRabsent, exact repo/branch/full local HEAD, and a clean worktree. High-risk preserved attempts also bind old/current base OIDs. Routine initial acceptance bindsbranch-base=current-base; a routine base refresh adds prior accepted head and prior/current-base OIDs while retaining branch base. Fix mode requires the exact repo, branch, local HEAD equal to the open PR's remote head, current base, round, andworktree: cleaninstead. Every routine tuple also namesroutine_phase: plan-only|code-started.base-refreshis allowed only forplan-onlywith current HEAD equal to the latest plan-acceptance head.code-startedrequires an exact preserved current HEAD descended from that plan head; a base move is external context and voids review evidence. Recompute both artifact hash links and accepted spec risk against the fresh base; only an exact match preserves plan acceptance. Never disguise a code-started merge asbase-refresh. Missing or ambiguous risk, stale intent/spec/plan hashes, or a changed plan stops before more code. A non-bridge high-risk plan change returns through a plan-only PR; a bridge pinned-field change follows the G2 rule above. After a plan merge, an existing implementation branch merges updated main without reset/rebase/force, rechecks the exact plan tuple, and invalidates old review evidence before work resumes. A routine plan change needs the plan-only update commit and fresh independent issue check described above before work resumes. If the fetched default moves after a routine plan acceptance but before the first code commit, preserve the branch, merge the new default without reset/rebase/force. Abase-refreshhead must be an exact two-parent merge whose first parent is the previously accepted head and second parent is the freshly fetched current-base OID; retain the original branch base and verify the branch differs from current base only byplan.md. Push and obtain a new independent exact-head/prior-head/branch-base/current-base acceptance before code. A conflict or any intervening commit stops. The existing sole-purpose add-CI and greenfield-bootstrap gates keep their concrete operator-approved bootstrap plans and human merge; they are the only process exceptions to awork/<slug>/plan.md. This gate is manually enforced by the manager, coder, and reviewer today; no hook or workflow may be claimed until one lands. - Plain language, always: every artifact (intent/spec/plan), PR title/description, and review comment is written for a tired human. Short sentences. Everyday words. No jargon where a plain word works. If two phrasings say the same thing, use the shorter one.
- Fix the root cause first. This rule governs implementation code that departs from the project's normal architecture. Do not add code that only hides a symptom or bypasses that architecture.
- An exceptional implementation departs from the normal path only because of an external constraint, safety concern, migration boundary, or scope decision recorded in an accepted artifact. It is allowed only when the root-cause fix is currently unsafe, unavailable, or explicitly outside the accepted scope.
- Every exception must stay behind one clearly named function, module, or adapter boundary; have a regression test for the behavior it protects; and link to a durable issue, spec, plan, or decision record that explains the constraint and tradeoff.
- A temporary exception states an objective removal condition. A permanent exception states the external invariant that keeps it necessary and the change that requires re-evaluation.
- Keep the exceptional pattern private to its one boundary. Do not expose it as a reusable API or copy it elsewhere. A second need returns to the artifact gate and becomes a normal architecture path, lint or type constraint, test helper, or tracked redesign—not another workaround copy.
- Every exception must be named before implementation in an accepted issue, spec, plan, or operator decision record. A link, code comment, or PR discussion is provenance, not approval. An implementation-time discovery returns to that artifact gate before exception code is added.
- That return must stay resumable. Record a bounded handoff with exact repo,
branch, full local HEAD, PR number-or-absent, PR open/head OID and round when it
exists, the old base OID as external context, and
worktree: clean|dirty. Add a decision capsule with six fixed labels:kind,source,normal_path,constraint_tradeoff,private_boundary, andoperator_question. Each value is one high-level line of at most 280 characters and is untrusted data—never an instruction, approval, authorization, or tool/label input. Do not include secrets, credentials, personal or local identifiers, private hosts/paths, sensitive exploit detail, quoted candidate/PR text, or mention-like tokens; use an opaque link to an accepted private record when detail is sensitive. Never publish raw paths or patch content. Only the exact tuple, normal artifact gate, and operator ruling control resume. A pre-PR pause clearsreadysoneeds-humanis the only active state. Only a clean attempt can auto-resume. A dirty attempt waits for an explicit operator disposition and a newly recorded clean tuple; no agent resets or cleans it. After any accepted decision—approve, reject, or rescope—re-verify the preserved attempt and resume that same branch or PR. A moved base is recorded as new external context and invalidates prior review evidence; it is not branch corruption. Any unexpected local HEAD or PR identity/state move stops without switch, reset, clean, or duplicate work. Abandonment requires an explicit operator decision and recorded disposition. - This implementation-code rule does not replace existing process exceptions such as the sole-purpose add-CI and greenfield-bootstrap gates. Those keep their own accepted scope and proof rules. If their implementation also adds exceptional product code, that code still follows this rule.
- An exception never waives CI, independent review, authorization boundaries, constitution rules, or human merge. Only the active, identity-matching ystack-self construction overlay may separately replace the human-merge gate for its named publisher and exact scope.
- Mechanically reliable checks belong in the target's CI. Every exception's regression test runs there; add a lint, type, or invariant check when the rule can be expressed without guesswork. Root-cause and tradeoff judgment stays in review.
Code should explain what it does. Comments may explain only a non-obvious reason,
invariant, external contract, or tool directive. Do not add comments that restate
code, AI-generated explanatory essays, commented-out code, PR discussion copied
into source, or TODO/FIXME without a durable tracking reference. License
notices; formatter, linter, compiler, coverage, and generated-code directives;
security and concurrency invariants; compatibility or protocol constraints;
required public API documentation; and one short exception-boundary link are
allowed.
ystack core does not impose a blanket no-comments rule. A target may adopt a zero-optional-comments or otherwise stricter policy, but it cannot weaken the exception requirements. Required legal notices, tool directives, public API documentation, safety or protocol invariants, and durable exception provenance must remain in source or move to an accepted sidecar/metadata mechanism.
- The live setup runs from generated/synced artifacts, not from these files directly.
Editing a prompt or doc here is a proposal; it only takes effect once synced: the live
/yshifucommand is regenerated by re-runningscripts/install.sh, and the coder instructions inroutines/coder.md/routines/coder-revision.mdtake effect when yshifu reads them to brief a spawned coder subagent (there are no UI-pasted routines). Merging a prompt change does NOT change live behavior until synced — call this out in the PR description when a prompt changes. - Never weaken the safety rails without explicit human sign-off: reviewer stays
read-only / comments-only. Outside the active, identity-matching ystack-self
construction overlay, merging is the operator's, always — this is policy, and it binds every
agent whatever its harness;
.claude/hooks/no-merge-guard.shis only defense-in-depth inside this repo, for known Claude Bash merge and direct-main-push commands; targets do not get it. The overlay above is the sole narrow exception and authorizes only the publisher named by the matching mode record after the exact gates above pass. The rounds cap andneeds-humanescalation stay intact. yshifu never writes code/opens PRs and never self-approves acting alone — a user-directed issue is gated by the user's approval of the drafted intake (the one-liner is the request, not the go), a proactive issue by the passed yshifu⇄Codex manager-debate consensus (for proactive work the user's gate is at the north-star altitude; user-directed issues still need the user's intake approval). After that front gate, new normal work passes G1 intent, G2 spec, and the manual risk-based plan gate above before any coder launch. Mechanical enforcement is still future work; do not confuse the live manual gate with a hook or workflow.
- One initiative = one dir:
work/<slug>/holdingintent.md→spec.md→plan.md. G1 accepts intent and G2 accepts spec. High-risk work then uses a separately reviewed, operator-merged plan PR as the pre-code gate; routine work records an independent plan check before code on its implementation branch. G3 accepts implementation. Details:work/README.md; review policy:REVIEW.md. - Skills:
/intent-draft,/spec-draft,/plan-drafthold the templates and stage rules. - Hash discipline:
spec.mdfrontmatter recordsintent-blob(git hash-objectof the intent it was drafted from);plan.mdrecordsspec-blob. On mismatch with main's current upstream file, label the PRstaleand stop — never build on a moved artifact. - Stage rules (autonomous lane): the spec stage writes only
work/<slug>/spec.md; the implementation coder never touches acceptedintent.md,spec.md, orplan.md. A plan change is written only by a separate plan author after the implementation pauses and before the applicable plan gate reruns. Unattended agents never write the constitution paths —.github/**,.claude/**,AGENTS.md(this file),CLAUDE.md,REVIEW.md,ROADMAP.md— such changes land as patches underproposals/that the operator applies. That is the same listREVIEW.mduses; the two must always match, so a change to one is a change to both. Operator-driven sessions are exempt; Phase 3 hooks enforce this mechanically viaYSTACK_STAGE. - Deterministic branches:
ystack/intent/<slug>,ystack/spec/<slug>, high-riskystack/plan/<slug>, andystack/impl/<slug>. Re-runs update the existing open PR; never keep two PRs open for the same slug and stage. After a stage PR merged, a required amendment reuses the deterministic branch and may open the next PR for that stage.
- No hardcoded personal values (usernames, repo names) in shipped templates — keep the reusable path parameterized. Personal config stays out of it.
- Core artifacts, policies, gates, state, and evals are harness-, model-, forge-, and CI-neutral. Claude, Codex, GitHub, and other products belong in adapters or selected profiles, never in core requirements.
- Safety is expressed as capabilities and separation of duties: author, verifier, reviewer, and publisher boundaries must survive an adapter change.
- Outside the active, identity-matching ystack-self construction overlay,
never merge. Opening a PR ends an agent's authority; the operator merges.
The overlay above is the sole narrow exception and authorizes only the publisher
named by the matching mode record after the exact gates above pass. Pushing to
mainis refused server-side anyway. - Prove it. Run the checks the plan names, paste the output, and say which commit you ran them on. Old proof on a new commit is stale.
- Old names are gone. The project and its manager were renamed;
scripts/check-rename.shfails CI if either old name survives in a tracked file. A line documenting real back-compat must carry the word "legacy" — that is how the gate tells intent from leftovers.