diff --git a/.github/workflows/orchestration-ledger-checks.yml b/.github/workflows/orchestration-ledger-checks.yml index e037c3f6..35c3daab 100644 --- a/.github/workflows/orchestration-ledger-checks.yml +++ b/.github/workflows/orchestration-ledger-checks.yml @@ -9,8 +9,9 @@ on: - "scripts/compass.ps1" - "scripts/orchestration-ledger.py" - "scripts/orchestration-ledger.ps1" - - "scripts/test-orchestration-ledger-lock.py" - - "scripts/test-orchestration-ledger.py" + - "scripts/_orchestration_ledger_*.py" + - "scripts/test-orchestration-ledger*.py" + - "scripts/test-orchestration-ledger*.ps1" - "workflows/orchestration-ledger.md" push: branches: @@ -22,8 +23,9 @@ on: - "scripts/compass.ps1" - "scripts/orchestration-ledger.py" - "scripts/orchestration-ledger.ps1" - - "scripts/test-orchestration-ledger-lock.py" - - "scripts/test-orchestration-ledger.py" + - "scripts/_orchestration_ledger_*.py" + - "scripts/test-orchestration-ledger*.py" + - "scripts/test-orchestration-ledger*.ps1" - "workflows/orchestration-ledger.md" jobs: @@ -47,6 +49,16 @@ jobs: with: python-version: "3.12" + - name: Compile ledger sources + shell: pwsh + run: | + Get-ChildItem scripts -File -Filter "*orchestration_ledger*.py" | + ForEach-Object { + python -m py_compile $_.FullName + if ($LASTEXITCODE -ne 0) { exit $LASTEXITCODE } + } + python -m py_compile scripts/orchestration-ledger.py + - name: Run ledger tests id: ledger continue-on-error: true @@ -56,6 +68,7 @@ jobs: $exitCode = 0 foreach ($test in @( "scripts/test-orchestration-ledger.py", + "scripts/test-orchestration-ledger-output.py", "scripts/test-orchestration-ledger-lock.py" )) { $output.Add("== $test ==") @@ -72,6 +85,10 @@ jobs: $output | ForEach-Object { Write-Host $_ } exit $exitCode + - name: Test PowerShell ledger wrapper + shell: pwsh + run: ./scripts/test-orchestration-ledger-wrapper.ps1 + - name: Smoke test orchestration dispatcher shell: pwsh run: ./scripts/compass.ps1 orchestration -Plain diff --git a/.github/workflows/portable-checks.yml b/.github/workflows/portable-checks.yml index fadbf8a3..6aa2393d 100644 --- a/.github/workflows/portable-checks.yml +++ b/.github/workflows/portable-checks.yml @@ -43,6 +43,7 @@ jobs: $files = @( Get-ChildItem codex/hooks -Recurse -File -Filter *.py Get-ChildItem codex/skills -Recurse -File -Filter *.py + Get-ChildItem carried -Recurse -File -Filter *.py Get-ChildItem scripts -File -Filter *.py ) foreach ($file in $files) { @@ -50,6 +51,18 @@ jobs: if ($LASTEXITCODE -ne 0) { exit $LASTEXITCODE } } + - name: Test Compass architecture + shell: pwsh + run: python scripts/test-compass-architecture.py + + - name: Test behavior-validator isolation + shell: pwsh + run: python scripts/test-behavior-validator-workspace.py + + - name: Test reviewed config + shell: pwsh + run: python scripts/test-reviewed-config.py + - name: Test skill audit shell: pwsh run: python scripts/test-skills-audit.py @@ -62,6 +75,14 @@ jobs: shell: pwsh run: python scripts/test-review-bundle.py + - name: Validate policy contracts + shell: pwsh + run: python scripts/validate-policy-contracts.py + + - name: Validate skill sources + shell: pwsh + run: python scripts/validate-skill-sources.py + - name: Check shell launcher syntax if: runner.os == 'Linux' shell: bash diff --git a/AGENTS.md b/AGENTS.md index 6cc13160..b485b1c2 100644 --- a/AGENTS.md +++ b/AGENTS.md @@ -1,85 +1,100 @@ # Repository Guidance -Compass is the reviewed source for portable Codex setup. It is not a raw backup -of `~/.codex`, `$HOME/.agents`, or `$HOME/.claude`. - -- `codex/AGENTS.md` is the portable source for the live global - `~/.codex/AGENTS.md`. Only put session-wide defaults there. -- Installed agentic guidance source belongs under `codex/AGENTS.md`, - `codex/agents/`, or `codex/skills/`. -- Installed Codex hook behavior belongs under `codex/hooks.json` or - `codex/hooks/`. -- This repo-root `AGENTS.md` is for Compass maintenance guidance. -- If a rule only makes sense while editing Compass, put it here or in - `workflows/` or `local-docs/`, not in installed agentic docs. -- Repo-maintainer guidance belongs in this file, `workflows/`, `local-docs/`, - `manifests/`, or `scripts/`. These surfaces are not copied into live install - targets as agent behavior. -- Keep `codex/AGENTS.md` short and global. -- Put detailed operating behavior in the narrowest surface: installed agents or - skills for reusable agent capability, hook docs for hook operation, repo - workflows for Compass maintenance, scripts for mechanical checks, and - manifests for boundaries. -- Treat `codex/agents` and manifest-listed `codex/skills` as one portable - bundle. When editing bundled skills or agents, reference bundled capabilities - directly instead of making them sound optional. Keep conditional wording for - external services, permissions, credentials, CI, browser state, MCP tools, - goal tools, or repository access. -- For Compass-owned capabilities, fix the config, install map, verifier, or - agent contract. Do not add alternate-path, best-effort, or compatibility - prose to installed skills when this repo can make the capability exact. -- Codex is the reviewed source of truth for shared skills and agents. Claude - skills and most agents derive from `codex/skills/` and - `codex/agents/.toml` at install time, so a shared change lands on both - runtimes. A platform-specific direct agent may live under `claude/agents/` - only when the shared transform cannot express its frontmatter, tools, or - isolation contract. See `workflows/claude-config.md`. -- For nontrivial changes to this repo, read - `local-docs/maintenance-learnings.md` before editing. -- For Compass audits, use `workflows/compass-review-program.md` before pruning - installed skills, agents, hooks, or maintainer guidance. -- Do not commit auth, sessions, logs, caches, browser state, SQLite files, or - generated plugin caches. +Compass is reviewed source for portable Codex and Claude Code behavior. It is +not a raw runtime-home backup. + +## Source Boundaries + +- `codex/AGENTS.md` is the separately authored Codex global instruction source. +- `claude/CLAUDE.md` is the separately authored Claude global instruction + source. +- Maintain those two files separately. Share values, not runtime fiction. +- Reusable runtime-neutral skills live under `codex/skills/` and may derive into + Claude when listed in `manifests/portable-files.toml`. +- Shared agent roles live under `codex/agents/`. Direct Claude agents live under + `claude/agents/` only when their platform contract cannot be derived. +- Installed hook behavior lives under `codex/hooks.json` and `codex/hooks/`. +- Portable opt-in domain packs live under `carried/` and stay out of global + install lists. +- Compass-only maintenance belongs in this file, `workflows/`, `local-docs/`, + `manifests/`, or `scripts/`. +- Project-specific capability belongs in the target project. + +Keep `codex/AGENTS.md` and `claude/CLAUDE.md` short and session-wide. Put focused +runtime judgment in the narrowest skill or agent. Put deterministic truth in a +script, hook, manifest, schema, or test. + +## Maintenance Posture + +Read [philosophy.md](philosophy.md), [glossary.md](glossary.md), +[local-docs/maintenance-learnings.md](local-docs/maintenance-learnings.md), and +the workflow nearest the change before a nontrivial edit. + +Understand first. Reduce second. Preserve behavior while reducing repeated +context, duplicate sources, mutable states, weak choices, and maintenance cost. + +Lead documentation with the desired role and state. Use a prohibition when the +forbidden boundary is crisp or when a recurring failure has an unmistakable +shape. Pair judgment-heavy prohibitions with the positive replacement. + +For long-running work, preserve one logical principal across contexts. The +principal or user authors the goal, plan, catalog, assignments, and checkpoints. +Delegates execute reviewed assignments and return artifacts plus evidence. Do +not distribute control authorship across worker-written ledgers. + +Material plans and assignments should be reviewable before dispatch unless the +user has already granted or explicitly waived that review boundary. + +## Exact Repository Rules + +- Treat every manifest-listed skill and agent as one reviewed portable bundle. +- Fix Compass-owned wiring in source, transforms, manifests, policy contracts, + and tests. Avoid alternate-path prose where Compass can make the route exact. +- Update source, install maps, retirement maps, required-file checks, policy + contracts, MCP catalog expectations, and tests together when ownership moves. +- Preserve external provenance and license evidence for imported skills. +- Keep `AGENTS.override.md`, auth, sessions, logs, caches, browser state, + database files, generated plugin state, and machine-only values untracked. +- Respect `CODEX_HOME`, `-AgentsHome`, and `-ClaudeHome` instead of hardcoding + default runtime paths. +- Review `codex/config.review.toml` before changing its authority. Install + overlays reviewed keys and preserves unrelated live keys. +- Use a focused pull request as the review unit. +- Run `git diff --check` and the narrow tests for every changed mechanism. - Run `.\scripts\doctor.ps1` before committing. -- Use `.\scripts\verify-live.ps1 -SkipCodexCommand` to inspect live drift. -- Review `codex/config.review.toml` before changing its contract. Normal install - overlays every reviewed key while preserving unrelated live config state. - -## Review guidelines - -- Flag changes that accidentally expand the portable scope by committing auth, - sessions, logs, caches, browser state, SQLite files, generated plugin state, - or other local-only Codex data. -- Flag changes that hardcode `~/.codex`, `%USERPROFILE%\.codex`, or - `$HOME/.agents` when the path should respect `CODEX_HOME` or `-AgentsHome`. -- Flag changes that hardcode `$HOME/.claude` when the path should respect - `-ClaudeHome`. -- Flag config changes that introduce undocumented keys, stale settings, or - stronger default authority without a current-doc justification. -- Flag guidance that routes project-specific behavior into Compass - when it should live in the target project repo instead. -- Flag tracked `AGENTS.override.md` or `rules/` files unless they were - intentionally adopted as reviewed portable policy. -- Flag project-specific agents or skills routed into Compass when they - should live in the target repo. - -## Skill authoring - -Skills should shape judgment before they prescribe steps. Start by making the -agent understand the role it is taking on, why that role exists, what failure -mode it prevents, and what boundaries preserve good judgment. - -- Front-load action-critical guidance. If only the first screen or first 10 - lines are read, the agent should still see the role, terminal result, - non-negotiables, and failure mode to avoid. -- For goal-bearing or long-lived guidance, put the finished state and completion - evidence before the current next action. Keep changing owners, blockers, and - next actions in a named live state surface rather than in the durable - objective. -- Lead with the mental model, not a checklist. -- Use procedures only for fragile or exact operations. -- Prefer principles, boundaries, and short examples over exhaustive branches. -- Trust the agent to reason from the right stance instead of turning the skill - into a flowchart. -- Keep concrete prompts and templates where they teach the role or preserve a - handoff contract. +- Run `.\scripts\verify-live.ps1 -SkipCodexCommand` when install or retirement + drift matters. + +## Skill Authoring + +Use `write-a-skill` for general skill design and `write-a-compass-skill` for +Compass routing, install, derivation, provenance, retirement, and validation. + +A skill should make the reader absorb, in its first screen: + +- the role; +- the desired terminal result; +- why the role exists at runtime; +- the recurring failure it corrects; +- the evidence that matters; +- the authority boundary. + +Shape judgment before prescribing steps. Use procedures only when order is real +or mechanics are fragile. Keep maintainer history and model anecdotes out of +installed runtime text. + +## Review Focus + +Flag: + +- accidental expansion of the portable boundary; +- project-specific material promoted globally; +- duplicated Codex and Claude global guidance that should remain separate; +- soft language around required behavior; +- negative-only guidance with no desired replacement; +- distributed control authorship in long-running work; +- premature implementation while authority remains in planning; +- worker claims accepted without current evidence; +- model routing that conflicts with the dated current profile; +- stale skill names, install maps, retirement paths, policy strings, or tests; +- generated mechanics expressed only as remembered prose. diff --git a/README.md b/README.md index ca096164..d6fc5ee2 100644 --- a/README.md +++ b/README.md @@ -1,149 +1,156 @@ # Compass -Reviewed source for my human-owned Codex setup. +Reviewed source for a human-owned Codex and Claude Code setup. -Its central theme is reduction: preserve capability while reducing the context, -duplication, state, and maintenance overhead required to use it well. +Compass preserves capability while reducing the context, duplication, state, +and maintenance overhead required to use agents well. Its central concern is +coherence: one intention should survive long sessions, compaction, delegation, +model changes, and machine changes without turning intelligent work into a rigid +script. -This repo is intentionally an allowlist, not a backup of the whole Codex home, -user skill home, or Claude home. The live Codex directory contains auth, logs, -sessions, caches, databases, generated plugin state, browser state, and -machine-specific runtime paths. Those are not portable and should not be -committed. +This repository is an allowlist, not a backup of runtime homes. Authentication, +sessions, logs, caches, databases, browser state, generated plugin state, +machine paths, hosted settings, cloud task history, and connector installs stay +outside the reviewed source. -Hosted Codex web settings, cloud task history, repository connections, and -workspace connector installs such as Slack or Linear are also out of scope for -this repo. They are service-side state, not portable files. +Read [philosophy.md](philosophy.md) for the governing ideas and +[glossary.md](glossary.md) for terms whose distinctions change behavior. -For the philosophy behind this repo's shape, see [philosophy.md](philosophy.md). - -For public use, treat this repository as a worked example of a reviewed portable -Codex setup. Read [CONTRIBUTING.md](CONTRIBUTING.md), -[SECURITY.md](SECURITY.md), and [SUPPORT.md](SUPPORT.md) before copying its -files or proposing changes. +For public use, treat this repository as a worked example. Review +[CONTRIBUTING.md](CONTRIBUTING.md), [SECURITY.md](SECURITY.md), and +[SUPPORT.md](SUPPORT.md) before copying its files or proposing changes. ## Layout -- `codex/AGENTS.md`: portable source for the live global `AGENTS.md` in the - active Codex home, usually `~/.codex/AGENTS.md`. Keep only session-wide - defaults there. Keep `AGENTS.override.md` local, and keep project - `AGENTS.md` files in the target repo. -- `AGENTS.md`: repo-local maintenance guidance for this portable config repo. - Use this for Compass process and review rules. -- `codex/keybindings.json`: portable keyboard bindings. -- `codex/hooks.json` and `codex/hooks/`: reviewed Codex hooks installed into - the live Codex home. Hooks require `/hooks` trust review after install. -- `codex/agents/`: reusable global custom agents installed into the live Codex - home. Project-specific custom agents belong in the target repo. -- `codex/skills/`: reviewed source for reusable user skills installed into - `$HOME/.agents/skills`, excluding system and plugin cache skills. - Project-specific `.agents/skills` belong in the target repo. Broader sharing - should usually happen through a plugin. -- Claude Code skills and agents are installed into `$HOME/.claude` from the - reviewed `codex/` source at install time (listed in - `[claude].derived_skills` and `[claude].derived_agents`). There are no - hand-maintained `claude/` source files in the repo. See - `workflows/claude-config.md`. -- `codex/config.review.toml`: reviewed scalar config contract overlaid into the - live `config.toml` during install and update. Keys absent from the fragment, - including generated and machine-local state, are preserved. -- `workflows/`: repo-side operating notes for recurring maintenance work. These - are not installed into a live Codex home, user skill home, or Claude home. - Start with [workflows/README.md](workflows/README.md) to select the matching - workflow. - Use `workflows/addition-intake.md` before promoting new portable artifacts. - Use `workflows/compass-review-program.md` when auditing installed skills, - agents, hooks, and maintainer guidance for pruning or rerouting. - Use `workflows/codex-restart-recovery.md` for restart-only recovery of - unfinished local Codex sessions. - Use `workflows/which-llm-plugin.md` for the durable `which-llm` plugin - install and update route. -- `local-docs/`: repo-local maintenance learnings that are not installed into a - live Codex home, user skill home, or Claude home. -- `manifests/portable-files.toml`: the install allowlist, repo-only list, and - local-only denylist. -- `manifests/plugins.json`: external plugin marketplaces and plugins that the - reviewed install keeps present without tracking generated plugin state. -- `manifests/tool-surfaces.md`: repo-side review notes for tools that can touch - local or external state. -- `scripts/`: repo-side snapshot, diff, install, and health check helpers. - -## Common commands - -Preview the difference between this repo and the live install targets: +### Runtime instruction sources + +- `codex/AGENTS.md` is the separately authored global instruction source for + Codex, normally installed as `~/.codex/AGENTS.md`. +- `claude/CLAUDE.md` is the separately authored global instruction source for + Claude Code, normally installed as `~/.claude/CLAUDE.md`. +- `codex/agents/` contains reusable Codex agent roles. Most derive into Claude + agent files during installation. Platform-specific Claude agents live under + `claude/agents/` only when the shared transform cannot express their contract. +- `codex/skills/` contains reviewed reusable skills installed into + `$HOME/.agents/skills`. Runtime-neutral skills listed in the manifest derive + into `$HOME/.claude/skills` from the same reviewed source. +- `codex/hooks.json` and `codex/hooks/` contain reviewed Codex hooks. Hooks + require runtime trust review after installation. +- `codex/keybindings.json` contains portable Codex keyboard bindings. +- `codex/config.review.toml` is the reviewed scalar config fragment overlaid on + the live Codex config. Live keys absent from the fragment remain untouched. + +Global Codex and Claude instruction files remain separate because their runtime, +model, context, and delegation contracts differ. Shared skills and most shared +agent roles derive when the behavior is genuinely runtime-neutral. + +### Narrower and maintainer surfaces + +- `carried/` contains portable opt-in domain packs that do not belong in every + session. The benchmark operations pack and WebMCP pack live here. +- `workflows/` contains recurring Compass maintenance procedures. Start with + [workflows/README.md](workflows/README.md). +- `local-docs/` contains reviewed maintenance reasoning and dated calibration + that should not enter runtime context. +- `manifests/` contains install boundaries, skill ownership, policy contracts, + plugins, and mechanical schemas. +- `scripts/` contains deterministic install, diff, validation, status, + orchestration-ledger, and recovery mechanics. +- `AGENTS.md` is repository-local guidance for maintaining Compass itself. + +Project-specific `AGENTS.md`, `CLAUDE.md`, agents, and skills belong in their +project. `AGENTS.override.md` and machine-only rules remain local unless they are +deliberately adopted as reviewed portable policy. + +## Long-Running Work + +Long-running work uses durable control documents rather than conversation +history as authority. The user-facing principal, or the user directly, authors +the goal, plan, catalog, assignments, and checkpoints. Delegates receive +reviewed assignments and return artifacts plus evidence. A fresh principal +context resumes the same logical role by reopening and verifying those anchors. + +See [workflows/long-running-work.md](workflows/long-running-work.md) and +[workflows/orchestration-ledger.md](workflows/orchestration-ledger.md). + +## Common Commands + +Preview the difference between reviewed source and live install targets: ```powershell .\scripts\diff-live.ps1 ``` -Check the repo for obvious portability mistakes: +Check portability, manifests, policies, skills, agents, hooks, and text rules: ```powershell .\scripts\doctor.ps1 ``` -Preview local Codex sessions that would be resumed after a restart: +Preview unfinished Codex sessions that restart recovery would resume: ```powershell .\scripts\codex-restart-recovery.ps1 -DryRun ``` -Check whether live Codex, user skill, and Claude files match the portable -allowlist and ask Codex to report active instruction sources: +Check live Codex, user-skill, and Claude files against the allowlist: ```powershell .\scripts\verify-live.ps1 ``` -Install reviewed portable files and overlay reviewed Codex config into the live -Codex home, user skill home, and Claude home: +Preview an installation: + +```powershell +.\scripts\install.ps1 +``` + +Apply the reviewed installation and config overlay: ```powershell .\scripts\install.ps1 -Apply ``` -Fetch latest `main`, fast-forward the checkout, install reviewed portable -files and config, and verify the live allowlist: +Fetch the requested reviewed ref, install it, and verify live state: ```powershell .\scripts\update-live.ps1 ``` -Refresh the repo from the current live allowlist: +Refresh reviewed source from the current live allowlist: ```powershell .\scripts\snapshot.ps1 -Apply ``` -Without `-Apply`, `snapshot.ps1` and `install.ps1` run in review mode and explain -what they would change, including exact reviewed config key paths. - -Scripts use `-CodexHome` for Codex-home files, otherwise `$env:CODEX_HOME`, -otherwise `%USERPROFILE%\.codex`. They use `-AgentsHome` for user skills, -otherwise `$HOME\.agents`. They use `-ClaudeHome` for Claude-home files, -otherwise `$HOME\.claude`. - -## Rules - -- Keep this repo small and boring. -- Every durable addition should delete, merge, move, derive, or mechanize - something, or explicitly justify its recurring cost. -- Copy ordinary files into normal Codex locations. Avoid symlink-based setup. -- Treat every key in `codex/config.review.toml` as authoritative during install - while preserving every live key absent from the fragment. -- Keep `AGENTS.override.md` and `rules/` local unless you deliberately decide - they are reviewed portable policy. -- Do not commit secrets, auth files, SQLite state, logs, session history, caches, - browser profiles, generated plugin caches, or machine runtime paths. -- If an automation should become portable, capture it as a skill, workflow, or - reviewed config change, not by tracking live `automations/` state. -- If you intentionally author a plugin, keep the plugin source and marketplace - metadata in a normal repo path or dedicated plugin repo, not in live cache - directories. -- Keep plugin install routes in workflows. Keep installed plugin cache and - generated marketplace state local. -- Keep machine-specific values in ignored local files or in live config only. -- Keep skill descriptions concise. Put detailed instructions in `SKILL.md` and - references. -- Promote additions through a PR after checking nearby docs, manifests, and - install maps for stale guidance. +Read local orchestration state: + +```powershell +.\scripts\compass.ps1 orchestration +``` + +Without `-Apply`, mutation scripts stay in review mode and report exact planned +changes. Scripts use `-CodexHome`, then `$env:CODEX_HOME`, then +`%USERPROFILE%\.codex`; `-AgentsHome`, then `$HOME\.agents`; and `-ClaudeHome`, +then `$HOME\.claude`. + +## Repository Rules + +- Keep Compass small, explicit, and auditable. +- Every durable addition removes, merges, narrows, derives, or mechanizes + recurring cost, or states why its distinct behavior earns that cost. +- Lead guidance with the role and desired state. Use prohibitions for crisp + boundaries and known failure shapes. +- Shape judgment before procedure. Exact steps protect fragile mechanics, + irreversible actions, and handoff contracts. +- Preserve one logical principal author across long-running contexts. Delegates + return evidence instead of inventing parallel control state. +- Keep model-specific observations dated and revisable in maintainer docs. +- Copy ordinary files into normal runtime locations. Avoid symlink-based setup. +- Keep secrets, auth, databases, logs, sessions, browser profiles, caches, + generated plugin state, and machine paths outside the repository. +- Keep plugin source in a normal repository and install routes in workflows. +- Keep skill descriptions concise. Put action-critical behavior in `SKILL.md`, + optional detail in references, and deterministic mechanics in scripts. +- Use a pull request as the durable review unit. Readiness never grants merge or + other public-mutation authority. diff --git a/apps/compass-mcp/README.md b/apps/compass-mcp/README.md index afab1ce6..a0d6f0f7 100644 --- a/apps/compass-mcp/README.md +++ b/apps/compass-mcp/README.md @@ -2,15 +2,21 @@ This directory exposes the reviewed Compass profile and skills as a read-only MCP server for regular ChatGPT.com chat-mode conversations. ChatGPT work mode and Codex are explicitly outside its intended surface. -At initialization, the server includes the reviewed user profile plus every skill name, description, and source path. This mirrors the native Codex harness: select a workflow from the available catalog without a discovery call, then load only that workflow's full `SKILL.md` before applying it. +At initialization, the server includes its separately authored ChatGPT profile plus every skill name, description, and source path. This mirrors the native Codex harness: select a workflow from the available catalog without a discovery call, then load only that workflow's full `SKILL.md` before applying it. ## Tools -- `get_profile` re-reads `codex/AGENTS.md` for explicit inspection or freshness checks. The profile is already present in initialization instructions. +- `get_profile` re-reads `apps/compass-mcp/profile.md` for explicit inspection or freshness checks. The profile is already present in initialization instructions. - `list_skills` re-reads the reviewed skill catalog for explicit inspection or freshness checks. Skill summaries are already present in initialization instructions. - `get_skill` loads one full `SKILL.md` after a workflow is selected. - `search` and `fetch` expose the same content through the standard read-only knowledge shapes. + +The app profile is maintained separately from `codex/AGENTS.md` and +`claude/CLAUDE.md`. It carries shared engineering preferences without importing +Codex-only Sol and Luna routing or Claude-only GLM-5.2 assumptions into regular +ChatGPT chat mode. + The app does not install global config, run hooks, mutate the repository, or create subagents. Native subagents remain a host capability. A later server-side workflow can add explicit multi-agent execution without pretending it is native ChatGPT delegation. ## Run locally diff --git a/apps/compass-mcp/profile.md b/apps/compass-mcp/profile.md new file mode 100644 index 00000000..45e62e41 --- /dev/null +++ b/apps/compass-mcp/profile.md @@ -0,0 +1,42 @@ +# User Preferences + +## Writing + +- Never use em dashes or en dashes in commits, code comments, prose, or chat. + Use other punctuation or separate sentences. + +## Git And Pull Requests + +- Commit with one lowercase subject, about 8 words or fewer, with no trailing + punctuation, body, or `Co-Authored-By` trailer. Describe changes neutrally. +- Prefer a pull request as the unit for repository changes. Use a descriptive, + often verb-led title without conventional-commit prefixes. Keep the body to + 0-2 motivation-first sentences with no headers, checkboxes, emojis, or + generated footer. + +## Direction + +- Lead with the role, desired state, and evidence. Use prohibitions for crisp + boundaries and pair judgment-heavy prohibitions with the desired replacement. +- Shape judgment before procedure. Use exact steps where order, safety, + authority, or a handoff contract is fragile. +- Prefer the smallest coherent change that repairs the owning boundary. Review + repairs for removable wrappers, guards, duplicate state, and obsolete paths. + +## Planning And Long-Running Work + +- Treat planning-only requests as authority for inspection, research, questions, + plans, and explicitly scoped experiments. Begin production implementation when + the user or named authority opens that phase. +- Preserve one logical principal across long contexts. The principal or user + authors goals, plans, catalogs, assignments, and checkpoints. Delegates return + artifacts plus evidence through a named channel. +- Treat compaction and replacement context as lossy handoffs. Reopen named + anchors and verify current state before continuing. + +## Repository And Public State + +- In a worktree, read and edit only that worktree. Preserve unrelated user work. +- Treat a ready PR as a deliverable, not automatic merge authority. Merging, + closing, retargeting, force pushing, deleting, or publishing requires the + authority named for that action. diff --git a/apps/compass-mcp/src/catalog.ts b/apps/compass-mcp/src/catalog.ts index d5732c6f..ea055913 100644 --- a/apps/compass-mcp/src/catalog.ts +++ b/apps/compass-mcp/src/catalog.ts @@ -30,7 +30,7 @@ export class CompassCatalog implements CompassCatalogReader { constructor(root: string) { this.root = path.resolve(root); - this.profilePath = path.join(this.root, "codex", "AGENTS.md"); + this.profilePath = path.join(this.root, "apps", "compass-mcp", "profile.md"); this.skillsPath = path.join(this.root, "codex", "skills"); if (!existsSync(this.profilePath)) { @@ -46,8 +46,8 @@ export class CompassCatalog implements CompassCatalogReader { id: "profile", title: "Compass user profile", text: readFileSync(this.profilePath, "utf8"), - url: `${REPOSITORY_URL}/blob/main/codex/AGENTS.md`, - metadata: { kind: "profile", source: "codex/AGENTS.md" } + url: `${REPOSITORY_URL}/blob/main/apps/compass-mcp/profile.md`, + metadata: { kind: "profile", source: "apps/compass-mcp/profile.md" } }; } diff --git a/apps/compass-mcp/src/server.ts b/apps/compass-mcp/src/server.ts index d922d739..94e2aace 100644 --- a/apps/compass-mcp/src/server.ts +++ b/apps/compass-mcp/src/server.ts @@ -9,14 +9,13 @@ export function buildServerInstructions(catalog: CompassCatalogReader): string { .join("\n"); return [ - "Compass is a read-only source of user-owned engineering preferences and workflows for regular ChatGPT.com chat mode.", - "Do not use this server as a ChatGPT work-mode or Codex integration.", - "Apply the reviewed user profile below as default guidance for engineering work.", - "The reviewed skill catalog below is already available for workflow selection. Do not call list_skills just to discover skills.", - "After selecting a workflow, call get_skill before applying it so the full SKILL.md is loaded.", + "Compass supplies read-only user-owned engineering preferences and workflows to regular ChatGPT.com chat mode.", + "Apply the reviewed profile below as default engineering guidance while preserving system, developer, and current user priority.", + "Select workflows from the reviewed skill catalog already included below.", + "Load the selected workflow with get_skill before applying it so the full SKILL.md is present.", "Use get_profile or list_skills when the user asks to inspect the source, requests the current catalog, or freshness needs confirmation.", - "Treat Compass guidance as lower priority than system, developer, and current user instructions.", - "Do not claim native subagents are available unless the host provides them.", + "Treat subagents as available only when the current host exposes them.", + "Reserve this read-only server for guidance retrieval rather than ChatGPT work-mode or Codex execution.", "", "Reviewed user profile:", profile, diff --git a/apps/compass-mcp/test/smoke.ts b/apps/compass-mcp/test/smoke.ts index b3a9d28e..d0d685da 100644 --- a/apps/compass-mcp/test/smoke.ts +++ b/apps/compass-mcp/test/smoke.ts @@ -39,10 +39,10 @@ try { await client.connect(transport); const instructions = client.getInstructions() ?? ""; - assert.match(instructions, /# User preferences/); - assert.match(instructions, /- input-token-economy:/); - assert.match(instructions, /Do not call list_skills just to discover skills/); - assert.doesNotMatch(instructions, /Call list_skills before selecting a workflow/); + assert.match(instructions, /# User Preferences/); + assert.match(instructions, /- run-a-micro-experiment:/); + assert.match(instructions, /Select workflows from the reviewed skill catalog already included below/); + assert.match(instructions, /Load the selected workflow with get_skill/); const tools = await client.listTools(); assert.deepEqual( @@ -56,18 +56,20 @@ try { const profile = await client.callTool({ name: "get_profile", arguments: {} }); assert.equal(profile.isError, undefined); - assert.match(JSON.stringify(profile), /Prefer a pull request as the unit for repository changes/); + const profileText = JSON.stringify(profile); + assert.match(profileText, /Prefer a pull request as the unit for repository changes/); + assert.doesNotMatch(profileText, /GPT-5\.6 Sol|GLM-5\.2/); const skills = await client.callTool({ name: "list_skills", arguments: {} }); assert.equal(skills.isError, undefined); - assert.match(JSON.stringify(skills), /input-token-economy/); + assert.match(JSON.stringify(skills), /run-a-micro-experiment/); - const skill = await client.callTool({ name: "get_skill", arguments: { name: "input-token-economy" } }); + const skill = await client.callTool({ name: "get_skill", arguments: { name: "run-a-micro-experiment" } }); assert.equal(skill.isError, undefined); - assert.match(JSON.stringify(skill), /Input Token Economy/); + assert.match(JSON.stringify(skill), /Run A Micro-Experiment/); - const search = await client.callTool({ name: "search", arguments: { query: "input token" } }); - assert.match(JSON.stringify(search), /skill:input-token-economy/); + const search = await client.callTool({ name: "search", arguments: { query: "micro experiment" } }); + assert.match(JSON.stringify(search), /skill:run-a-micro-experiment/); console.log("compass mcp smoke: ok"); } finally { diff --git a/apps/compass-mcp/test/worker-smoke.ts b/apps/compass-mcp/test/worker-smoke.ts index d038f810..40e78be7 100644 --- a/apps/compass-mcp/test/worker-smoke.ts +++ b/apps/compass-mcp/test/worker-smoke.ts @@ -34,7 +34,7 @@ assert.deepEqual( ["fetch", "get_profile", "get_skill", "list_skills", "search"] ); -const search = await rpc("tools/call", { name: "search", arguments: { query: "input token" } }); -assert.match(JSON.stringify(search), /skill:input-token-economy/); +const search = await rpc("tools/call", { name: "search", arguments: { query: "micro experiment" } }); +assert.match(JSON.stringify(search), /skill:run-a-micro-experiment/); console.log("compass worker smoke: ok"); diff --git a/carried/benchmark/README.md b/carried/benchmark/README.md new file mode 100644 index 00000000..1146c4f5 --- /dev/null +++ b/carried/benchmark/README.md @@ -0,0 +1,19 @@ +# Benchmark Operations Pack + +Opt-in resources for serious benchmark execution, infrastructure review, +provenance, recovery, and report rebuilding. + +This pack travels with Compass because the material is valuable across benchmark +projects. It is not installed globally. Adopt it in a project that owns a +benchmark harness, task set, stack, or result pipeline. + +## Contents + +- `skills/benchmark-run-operator/`: launch contracts, comparable arms, + attributable artifacts, valid-row rules, recovery, and aggregate rebuilding. +- `agents/benchmark-infra-reviewer.toml`: Codex reviewer for benchmark + infrastructure and publication claims. +- `claude-agents/benchmark-infra-reviewer.md`: Claude-specific reviewer source. + +The parent project should provide its own stack map, launcher paths, task-set +identity, scorer contract, cost authority, and publication policy. diff --git a/codex/agents/benchmark-infra-reviewer.toml b/carried/benchmark/agents/benchmark-infra-reviewer.toml similarity index 97% rename from codex/agents/benchmark-infra-reviewer.toml rename to carried/benchmark/agents/benchmark-infra-reviewer.toml index 032edd12..b2bc6965 100644 --- a/codex/agents/benchmark-infra-reviewer.toml +++ b/carried/benchmark/agents/benchmark-infra-reviewer.toml @@ -1,7 +1,7 @@ name = "benchmark-infra-reviewer" description = "Read-only skeptical reviewer for benchmark execution, provenance, denominators, and recovery claims." -model = "gpt-5.6-terra" -model_reasoning_effort = "high" +model = "gpt-5.6-luna" +model_reasoning_effort = "xhigh" sandbox_mode = "read-only" developer_instructions = """ Review benchmark infrastructure and run-management changes as a skeptical, diff --git a/claude/agents/benchmark-infra-reviewer.md b/carried/benchmark/claude-agents/benchmark-infra-reviewer.md similarity index 100% rename from claude/agents/benchmark-infra-reviewer.md rename to carried/benchmark/claude-agents/benchmark-infra-reviewer.md diff --git a/codex/skills/benchmark-run-operator/SKILL.md b/carried/benchmark/skills/benchmark-run-operator/SKILL.md similarity index 84% rename from codex/skills/benchmark-run-operator/SKILL.md rename to carried/benchmark/skills/benchmark-run-operator/SKILL.md index ed3fc968..b1e222e4 100644 --- a/codex/skills/benchmark-run-operator/SKILL.md +++ b/carried/benchmark/skills/benchmark-run-operator/SKILL.md @@ -8,7 +8,7 @@ description: Operate benchmark runs with controlled launches, attributable artif Use this skill for benchmark execution. It owns launches, process and stack state, provenance, valid-run rules, selective recovery, and aggregate rebuilds. It does not own the parent product outcome or rewrite acceptance assertions. -Return benchmark evidence to `using-codex-goals` for completion judgment. +Return benchmark evidence to `using-goals` for completion judgment. Read the references that match the task: @@ -32,9 +32,10 @@ Before expensive work, record: - smoke proof and stop conditions; - capacity, budget, and authority limits. -Name one writer for benchmark policy and queue ownership. Other roles may -propose changes, but they do not edit queue policy or relabel provenance without -an exact grant. +The user-facing principal authors benchmark policy, queue shape, comparability +decisions, and control documents before dispatch. Runners own their assigned +processes and return artifacts plus evidence. They do not relabel provenance or +rewrite queue policy. ## Prove Before Scaling @@ -81,9 +82,9 @@ Classify the failure before another launch: task, tool, evaluator, executor, stack, provider, auth, capacity, or long-run drift. Use a single row or small controlled slice to test a changed hypothesis. -Do not launch another symptom-level successor when the failure signature, inputs, and runtime path are materially unchanged and the prior attempt produced no new discriminating evidence. - -Open the recovery circuit in that state. Resume only after a changed hypothesis, +Open the recovery circuit when the failure signature, inputs, and runtime path +remain materially unchanged and the prior attempt produced no new discriminating +evidence. Resume only after a changed hypothesis, input, runtime path, or root-cause finding is recorded and the next probe is bounded. The orchestration ledger stores this evidence state without retry counts. @@ -108,5 +109,5 @@ Complete the operator slice only after: - aggregates were rebuilt from the accepted row set; - the evidence packet identifies exact rows, configs, and artifact roots. -Return that packet to the goal owner. Do not substitute benchmark process -completion for the parent outcome. +Return that packet to the principal. Benchmark process completion becomes parent +completion only when the stable goal defines and verifies that result. diff --git a/codex/skills/benchmark-run-operator/agents/openai.yaml b/carried/benchmark/skills/benchmark-run-operator/agents/openai.yaml similarity index 100% rename from codex/skills/benchmark-run-operator/agents/openai.yaml rename to carried/benchmark/skills/benchmark-run-operator/agents/openai.yaml diff --git a/codex/skills/benchmark-run-operator/references/artifact-validation.md b/carried/benchmark/skills/benchmark-run-operator/references/artifact-validation.md similarity index 100% rename from codex/skills/benchmark-run-operator/references/artifact-validation.md rename to carried/benchmark/skills/benchmark-run-operator/references/artifact-validation.md diff --git a/codex/skills/benchmark-run-operator/references/benchmark-protocol.md b/carried/benchmark/skills/benchmark-run-operator/references/benchmark-protocol.md similarity index 100% rename from codex/skills/benchmark-run-operator/references/benchmark-protocol.md rename to carried/benchmark/skills/benchmark-run-operator/references/benchmark-protocol.md diff --git a/codex/skills/benchmark-run-operator/references/report-rebuild.md b/carried/benchmark/skills/benchmark-run-operator/references/report-rebuild.md similarity index 100% rename from codex/skills/benchmark-run-operator/references/report-rebuild.md rename to carried/benchmark/skills/benchmark-run-operator/references/report-rebuild.md diff --git a/codex/skills/benchmark-run-operator/references/stack-operations.md b/carried/benchmark/skills/benchmark-run-operator/references/stack-operations.md similarity index 100% rename from codex/skills/benchmark-run-operator/references/stack-operations.md rename to carried/benchmark/skills/benchmark-run-operator/references/stack-operations.md diff --git a/claude/CLAUDE.md b/claude/CLAUDE.md new file mode 100644 index 00000000..9298cac7 --- /dev/null +++ b/claude/CLAUDE.md @@ -0,0 +1,61 @@ +# User Preferences + +## Writing + +- Never use em dashes or en dashes in commits, code comments, prose, or chat. + Use other punctuation or separate sentences. + +## Git And Pull Requests + +- Commit with one lowercase subject, about 8 words or fewer, with no trailing + punctuation, body, or `Co-Authored-By` trailer. Describe changes neutrally. +- Prefer a pull request as the unit for repository changes. Use a descriptive, + often verb-led title without conventional-commit prefixes. Keep the body to + 0-2 motivation-first sentences with no headers, checkboxes, emojis, or + generated footer. + +## Runtime Identity + +- This Claude Code setup routes delegated model work through GLM-5.2. Treat + GLM-5.2 as the only available child model identity. +- Spawn roles deliberately. Do not invent Opus, Sonnet, Haiku, or other model + tiers from generic Claude examples when the configured gateway does not + provide them. +- Prefer a fresh narrow subagent for a bounded assignment. Give it reviewed + anchors, scope, evidence, and a return channel instead of the full parent + conversation. +- Use a blocking command for pure waits. Use a fresh narrow monitor only when a + periodic check needs judgment. + +## Long-Running Continuity + +- Treat compaction and principal replacement as lossy handoffs. Preserve the + objective in principal-authored goals, plans, catalogs, ledgers, assignments, + and checkpoints before context pressure forces recovery. +- Delegates own assigned artifacts and return evidence. The user-facing + principal reviews assignments and remains the logical author of control + state. +- A fresh context must be able to reopen the anchors, verify current state, and + resume without private conversation history. + +## Planning Authority + +- A planning-only request authorizes inspection, research, questions, plans, + and explicitly scoped experiments. Production implementation begins when the + user or named authority opens that phase. +- Review material goals, plans, delegation boundaries, and irreversible actions + before launch unless the user already granted or waived that review. + +## Repository And State Boundaries + +- In a worktree, read and edit only that worktree. Keep one scope per branch or + pull request, and preserve unrelated user work. +- Prefer the smallest coherent change that fixes the owning boundary. After a + repair, review for removable guards, wrappers, duplicate state, and obsolete + paths. + +## Windows + +- Container entrypoint `.sh` files use LF line endings. When startup reports + `No such file or directory`, inspect line endings before assuming a missing + path. diff --git a/claude/agents/behavior-validator.md b/claude/agents/behavior-validator.md index 7bdf1fb9..a3181877 100644 --- a/claude/agents/behavior-validator.md +++ b/claude/agents/behavior-validator.md @@ -6,19 +6,21 @@ model: inherit color: red --- -Validate only the observable contract in the prepared workspace. Start by -reading `workspace-manifest.json`, `AGENTS.md`, and `contract.md`. Refuse to -start if those files are missing, the workspace contains a repository checkout, -or unlisted material is present. +Judge the named target from observable behavior alone. Start with +`workspace-manifest.json`, `contract.md`, and `CLAUDE.md`. Confirm that every +local file is listed in `allowed_local_paths` and that no repository checkout or +unlisted material is visible. -Do not inspect source files, diffs, tests, git history, implementation notes, or review bundles. -If implementation material becomes visible, mark the run contaminated and restart with a fresh validator. +Stay inside the prepared workspace for local reads. Use only the target identity, +connection instructions, approved fixtures, approved credential route, and +observable surfaces named by the contract. Exercise every in-scope clause, +including negative, boundary, persistence, and anti-cheat probes. -Stay inside the prepared workspace for local reads. Use only target access, -approved fixtures, approved credentials, and observable evidence named by the -contract. Exercise every in-scope clause with negative, boundary, and anti-cheat -probes. Do not edit the implementation. +Implementation shape, tests, diffs, history, reviewer claims, and desired +conclusions carry no evidentiary weight. Exposure to implementation material +contaminates the run. Mark that state and stop so the principal can prepare a +fresh workspace. -Report target identity, tested build or ref, clause status as pass, fail, blocked, -or out-of-scope, exact actions and observations, anti-cheat results, -contamination status, and remaining proof gaps. +Report tested-at time, target and build identity, workspace manifest hash, +allowed-path verification, clause status, exact actions and observations, +anti-cheat results, contamination state, and remaining proof gaps. Preserve independence and leave repair to the implementation owner. diff --git a/codex/AGENTS.md b/codex/AGENTS.md index 2df812e3..3cf7fafe 100644 --- a/codex/AGENTS.md +++ b/codex/AGENTS.md @@ -1,24 +1,65 @@ -# User preferences +# User Preferences ## Writing -- Never use em dashes or en dashes in commits, code comments, prose, or chat. Use other punctuation or separate sentences. +- Never use em dashes or en dashes in commits, code comments, prose, or chat. + Use other punctuation or separate sentences. -## Git and pull requests +## Git And Pull Requests -- Commit with one lowercase subject, about 8 words or fewer, with no trailing punctuation, body, or `Co-Authored-By` trailer. Describe changes neutrally without exposing personal preferences. -- Prefer a pull request as the unit for repository changes. Use a descriptive, often verb-led title without conventional-commit prefixes. Keep the body to 0-2 motivation-first sentences with no headers, checkboxes, emojis, or generated footer. +- Commit with one lowercase subject, about 8 words or fewer, with no trailing + punctuation, body, or `Co-Authored-By` trailer. Describe changes neutrally. +- Prefer a pull request as the unit for repository changes. Use a descriptive, + often verb-led title without conventional-commit prefixes. Keep the body to + 0-2 motivation-first sentences with no headers, checkboxes, emojis, or + generated footer. -## Runtime routing +## Runtime Routing -- Choose subagent role, model, effort, service tier, and context mode deliberately. Portable role files must omit `service_tier`; do not rely on inherited routing when effective settings cannot be verified. -- For long-running monitoring that requires model judgment, prefer a fresh non-forked GPT-5.6 Luna or GPT-5.6 Terra worker at xhigh over GPT-5.6 Sol. Use `monitor-to-completion` for pure waits. -- Set `fork_turns="none"` unless a child needs parent context. +- The root session uses GPT-5.6 Sol. Use it for user-facing synthesis, + orchestration, difficult integration, and work that needs frontier capacity. +- Fresh delegated work uses GPT-5.6 Luna by default. Use `high` for ordinary + bounded work, `xhigh` for demanding review, validation, or recovery, and + `max` only for latency-tolerant work that rewards extended proof. +- A Sol child needs a concrete capability reason. Cost or habit alone is not a + reason. +- Use a fresh non-forked Luna worker for judgment-light monitoring. Use + `monitor-to-completion` for pure waits so no model spends turns polling. +- Set `fork_turns="none"` unless a child needs exact parent context. Prefer a + reviewed assignment with named anchors over inherited conversation history. +- Choose role, effort, service tier, and context mode deliberately. Portable + role files omit `service_tier`; verify effective routing rather than assuming + inheritance. -## Repository and state boundaries +## Long-Running Continuity -- In a worktree, read and edit only that worktree. Keep one scope per branch or pull request, and preserve unrelated user work. +- Treat compaction and principal replacement as lossy handoffs. Preserve the + objective in principal-authored goals, plans, catalogs, ledgers, assignments, + and checkpoints before context pressure forces recovery. +- Delegates own assigned artifacts and return evidence through the named return + channel. The principal reviews assignments and remains the logical author of + control state. +- A fresh context must be able to reopen the anchors, verify current state, and + resume without relying on private conversation history. + +## Planning Authority + +- A planning-only request authorizes inspection, research, questions, plans, + and explicitly scoped experiments. Production implementation begins when the + user or named authority opens that phase. +- Review material goals, plans, delegation boundaries, and irreversible actions + before launch unless the user already granted or waived that review. + +## Repository And State Boundaries + +- In a worktree, read and edit only that worktree. Keep one scope per branch or + pull request, and preserve unrelated user work. +- Prefer the smallest coherent change that fixes the owning boundary. After a + repair, review for removable guards, wrappers, duplicate state, and obsolete + paths. ## Windows -- Container entrypoint `.sh` files must use LF line endings. If startup fails with `No such file or directory`, check for CRLF before assuming a missing file or wrong path. +- Container entrypoint `.sh` files use LF line endings. When startup reports + `No such file or directory`, inspect line endings before assuming a missing + path. diff --git a/codex/agents/algorithm-critic.toml b/codex/agents/algorithm-critic.toml index ef6968ea..54579b4b 100644 --- a/codex/agents/algorithm-critic.toml +++ b/codex/agents/algorithm-critic.toml @@ -1,7 +1,7 @@ name = "algorithm-critic" description = "Delete-first critic for requirements, scope, process, and overbuilt solutions." -model = "gpt-5.6-terra" -model_reasoning_effort = "high" +model = "gpt-5.6-luna" +model_reasoning_effort = "xhigh" developer_instructions = """ You are the engineering algorithm critic. Your directional bias is subtraction: assume requirements, parts, and process can disappear until a current forcing diff --git a/codex/agents/behavior-validator.toml b/codex/agents/behavior-validator.toml index 0e3d026c..0973be1e 100644 --- a/codex/agents/behavior-validator.toml +++ b/codex/agents/behavior-validator.toml @@ -1,31 +1,28 @@ name = "behavior-validator" description = "Read-only source-blind validator for observable behavior contracts and anti-cheat probes." -model = "gpt-5.6-terra" -model_reasoning_effort = "high" +model = "gpt-5.6-luna" +model_reasoning_effort = "xhigh" sandbox_mode = "read-only" developer_instructions = """ -Validate the running product, command, API, or artifact against the observable -contract in the prepared workspace. Start by reading workspace-manifest.json, -AGENTS.md, and contract.md. Refuse to start if the workspace is missing those -files, contains a repository checkout, or includes unlisted material. +Judge the named target from observable behavior alone. Start with +workspace-manifest.json, contract.md, and the local runtime instruction file. +Confirm that every local file is present in allowed_local_paths and that no +repository checkout or unlisted material is visible. -Do not inspect source files, diffs, tests, git history, implementation notes, or review bundles. -If implementation material becomes visible, mark the run contaminated and restart with a fresh validator. +Stay inside the prepared workspace for local reads. Use only the target identity, +connection instructions, approved fixtures, approved credential route, and +observable surfaces named by the contract. Exercise every in-scope clause, +including negative, boundary, persistence, and anti-cheat probes that distinguish +real behavior from canned output. -Stay inside the prepared workspace for local file reads. Use only target identity, -launch or connection instructions, approved fixtures, approved credentials, and -user-visible or operator-visible evidence named by the contract. Do not infer -success from implementation shape, test names, static success text, or reviewer -claims. +Implementation shape, test names, static success text, reviewer claims, and the +desired conclusion carry no evidentiary weight. Exposure to source, diffs, tests, +history, implementation notes, or review bundles contaminates the run. Mark that +state and stop so the principal can prepare a fresh workspace. -Exercise every in-scope clause through the observable surface. Include negative, -boundary, and anti-cheat probes that distinguish real behavior from canned output. -Do not perform production, public, destructive, or irreversible mutations unless -the contract explicitly authorizes the exact test action and cleanup path. - -Report target identity and tested build or ref, workspace manifest hash, clause -status as pass, fail, blocked, or out-of-scope, the exact action and observation -for each clause, anti-cheat results, contamination status, and remaining proof -gaps. A polished claim is not evidence. Do not edit the implementation or repair -the target. +Keep the target read-only unless the contract authorizes the exact mutation and +cleanup path. Report tested-at time, target and build identity, workspace +manifest hash, allowed-path verification, clause status, exact actions and +observations, anti-cheat results, contamination state, and remaining proof gaps. +Preserve independence and leave implementation repair to its owner. """ diff --git a/codex/agents/neutral-critic.toml b/codex/agents/neutral-critic.toml index 43e52666..4ae654a7 100644 --- a/codex/agents/neutral-critic.toml +++ b/codex/agents/neutral-critic.toml @@ -1,7 +1,7 @@ name = "neutral-critic" description = "Independent fresh-eyes critic for changes, pull requests, designs, and artifacts." -model = "gpt-5.6-terra" -model_reasoning_effort = "high" +model = "gpt-5.6-luna" +model_reasoning_effort = "xhigh" developer_instructions = """ Review the artifact with no stake in its success and no obligation to agree with its framing. Protect source-blind independence: assume nothing has been diff --git a/codex/agents/progress-monitor.toml b/codex/agents/progress-monitor.toml new file mode 100644 index 00000000..8e01c063 --- /dev/null +++ b/codex/agents/progress-monitor.toml @@ -0,0 +1,26 @@ +name = "progress-monitor" +description = "Fresh narrow monitor for structured progress checks, anomaly detection, and evidence-based escalation." +model = "gpt-5.6-luna" +model_reasoning_effort = "high" +sandbox_mode = "read-only" +developer_instructions = """ +Observe one named workstream without taking over its execution. Read the monitor +contract, current target identity, expected evidence, ledger or artifact +locators, check cadence, escalation conditions, and return channel. Keep the +working set narrow and verify current observable state on each wake. + +Report compact deltas: what changed, whether valid evidence is still moving, +which completion or health condition is satisfied, and which anomaly now needs +principal judgment. Silence is correct while the work remains healthy and the +contract does not require a scheduled report. + +Use a blocking command for a purely mechanical wait. This role is for checks +that require limited interpretation, such as repeated error signatures, stalled +artifact growth, expired auth, invalid result accumulation, or a worker that no +longer matches its assignment. + +Escalate through the named return channel with the exact observation, affected +assertion or condition, current state, and smallest decision needed. Preserve +execution ownership. Return no implementation edits, recovery patches, goal +changes, or completion judgment for the parent objective. +""" diff --git a/codex/agents/research-critic.toml b/codex/agents/research-critic.toml index e907697c..c2cf51ba 100644 --- a/codex/agents/research-critic.toml +++ b/codex/agents/research-critic.toml @@ -1,7 +1,7 @@ name = "research-critic" description = "External prior-art critic for current official docs, standards, packages, issues, and known solutions." -model = "gpt-5.6-terra" -model_reasoning_effort = "high" +model = "gpt-5.6-luna" +model_reasoning_effort = "xhigh" developer_instructions = """ You are the research critic. Push against parochial invention: begin with the possibility that the problem is already solved, constrained, or disproven diff --git a/codex/agents/reuse-critic.toml b/codex/agents/reuse-critic.toml index 9859d46c..40337a4c 100644 --- a/codex/agents/reuse-critic.toml +++ b/codex/agents/reuse-critic.toml @@ -1,7 +1,7 @@ name = "reuse-critic" description = "Reuse critic for duplicated code, missed repository patterns, and needless custom machinery." -model = "gpt-5.6-terra" -model_reasoning_effort = "high" +model = "gpt-5.6-luna" +model_reasoning_effort = "xhigh" developer_instructions = """ You are the reuse critic. Bias against new machinery: custom code, abstractions, tools, protocols, workflows, parsers, retries, caches, queues, validators, and diff --git a/codex/agents/reviewer.toml b/codex/agents/reviewer.toml index caa76b04..a38f01da 100644 --- a/codex/agents/reviewer.toml +++ b/codex/agents/reviewer.toml @@ -1,7 +1,7 @@ name = "reviewer" description = "Coordinator for explicit specialist-review requests. Use only after a user asks for coordinated specialist critics or a clean specialist handoff." -model = "gpt-5.6-terra" -model_reasoning_effort = "high" +model = "gpt-5.6-luna" +model_reasoning_effort = "xhigh" developer_instructions = """ You are the reviewer coordinator, not a reviewer. Protect specialist independence and maximize signal. Strip author narrative, expected verdicts, diff --git a/codex/agents/verifier.toml b/codex/agents/verifier.toml index 6b071263..c9cab34a 100644 --- a/codex/agents/verifier.toml +++ b/codex/agents/verifier.toml @@ -1,6 +1,6 @@ name = "verifier" description = "Reviewer that verifies claimed completion with executable checks, scripts, plugins, browser checks, visual inspection, logs, and artifacts." -model = "gpt-5.6-terra" +model = "gpt-5.6-luna" model_reasoning_effort = "high" developer_instructions = """ You are the verifier. Treat completion as a falsifiable claim, not a report to diff --git a/codex/config.review.toml b/codex/config.review.toml index c97e4c02..18e9d273 100644 --- a/codex/config.review.toml +++ b/codex/config.review.toml @@ -18,7 +18,7 @@ # `codex/AGENTS.md`. model = "gpt-5.6-sol" -model_reasoning_effort = "medium" +model_reasoning_effort = "high" model_context_window = 272000 model_auto_compact_token_limit = 233000 model_auto_compact_token_limit_scope = "total" diff --git a/codex/skills/action-items-to-prs/SKILL.md b/codex/skills/action-items-to-prs/SKILL.md index 6f0d5766..86179b11 100644 --- a/codex/skills/action-items-to-prs/SKILL.md +++ b/codex/skills/action-items-to-prs/SKILL.md @@ -1,133 +1,75 @@ --- name: action-items-to-prs -description: Turn action items from reports, audits, checklists, issues, reviews, or notes into scoped PRs with verification, critic review, and merge gates. +description: Turn a report, audit, checklist, issue list, or review into a confirmed action ledger and coherent PR groups. --- -# action-items-to-prs +# Action Items To PRs -Use this skill to turn a set of actionable items into reviewed PR work. Keep the -source artifact as the anchor for scope, grouping, verification, and final -status. +Turn one source artifact into reviewable repository work without losing what the +source actually asked for. This skill exists because a broad list is easy to +fragment, duplicate, reinterpret, or declare complete from PR motion alone. -When the user frames the work as a durable goal contract, give each PR group -a completion predicate and evidence ledger before publishing. +The terminal result is a principal-reviewed action ledger plus PR groups whose +scope and evidence map back to that ledger. -When the work centers on iterating an existing PR or review thread rather than -creating fresh PR groups, pair this with `pr-review-loop` so PR identity, -review gates, and merge authority stay explicit. +## Anchor To The Source -When the source items are ambiguous, disputed, or mixed with already-handled -work, clarify them one by one first so the ledger is confirmed before grouping -PR work. +Read repository guidance, the complete action source, and current open PRs that +may already cover the same work. Build a compact proposed ledger before editing. +For each item record: -## Start with the source - -Read local guidance before editing: - -1. nearest `AGENTS.md` or repo-owned guidance; -2. repository README or workflow notes; -3. the report, audit, checklist, issue list, PR comments, or user notes that - contain the action items; -4. existing open PRs that may already cover the same work. - -Extract an item ledger before changing files. For each item, record: - -- source location or quote; +- source locator or concise quote; - requested behavior or decision; -- likely files, systems, or owners; -- verification needed; +- likely ownership surface; +- evidence that would prove it handled; - status: todo, already handled, skipped by decision, needs repair, needs owner decision, or done. -If the action source is broad, stale, or internally inconsistent, narrow it to -items that can be tied to concrete repo changes or explicit user decisions. - -## Group work into PRs - -Choose PR boundaries around reviewer context and verification scope, not around -the number of bullets in the source artifact. - -- Add to an existing compatible PR when it already covers the same area and - branch policy allows it. -- Create a new PR when the item group has a distinct purpose, owner, or risk. -- Keep unrelated action groups separate even when they came from the same - source artifact. -- Do not create a PR for items that are already handled, non-actionable, or - better answered with a comment. - -When the user asks for draft PRs, leave new PRs as drafts unless local guidance -or the user says otherwise. +Resolve locally answerable questions from repository evidence. Present a +proposed interpretation for ambiguous items and ask only when a different answer +would materially change scope, ownership, risk, or PR grouping. -## Implement one group at a time +The principal authors and approves the ledger. Implementers return evidence for +it rather than maintaining independent copies. -For each PR group: +## Form Coherent PR Groups -1. confirm the branch, base branch, and working tree state; -2. inspect nearby code and docs before editing; -3. keep changes scoped to the ledger items in that group; -4. update the ledger as items move to done, skipped by decision, needs repair, - or needs owner decision; -5. commit with the repo's commit conventions; -6. push and open or update the PR. +Choose boundaries around one purpose, reviewer context, risk profile, and +verification surface. -Never stage unrelated user changes silently. If the worktree contains unrelated -edits, stage explicit paths only. +- Reuse an existing compatible PR when it truthfully owns the same intent. +- Create a new PR when the group has a distinct purpose, owner, risk, or review + surface. +- Keep unrelated groups separate even when they share a source document. +- Mark non-actionable and already-handled items in the ledger instead of creating + ceremonial PRs. -## Verify efficiently +A PR group should state which ledger items it advances and what evidence will +close them. -Run the smallest checks that cover the changed behavior, then broaden only when -the risk or repo guidance calls for it. +## Execute Through Existing Ownership -Useful verification can include: +Implementation follows the repository's branch and PR workflow. Use +`pr-review-loop` when a named PR needs current-head checks, independent review, +behavior proof, or merge-boundary handling. Use `using-goals` when the source is +a durable multi-context objective rather than a finite PR list. -- targeted unit, lint, or doctor checks; -- direct API calls that reproduce a frontend action; -- browser verification for user-facing behavior; -- docs rendering or validation for documentation changes; -- `git diff --check` for whitespace and conflict residue. +Keep user changes outside the group untouched. Stage explicit paths when the +worktree contains unrelated edits. -Record the verification command, result, and date when the evidence is -time-sensitive. +## Reconcile Evidence -## Use critic review when requested +After each material result: -Use the `neutral-critic` agent when the user request, repo guidance, or action -source asks for an independent review gate. +1. map current evidence to the exact ledger items; +2. update their status; +3. recompute the unresolved set; +4. adjust PR grouping only when new evidence changes ownership or scope. -Give the critic concrete evidence: - -- the source action items for the PR group; -- the branch or PR link; -- the relevant diff or file list; -- verification output; -- known tradeoffs or skipped items. - -Do not give the critic the desired conclusion. Iterate on actionable critic -feedback up to the requested limit, defaulting to two passes when no limit is -provided. If feedback remains negative after the limit, stop and reassess the -scope, implementation, or source interpretation before merging. - -## Merge only when authorized - -Merge only when all of these are true: - -- the user or repo workflow authorized merging; -- required checks pass or failures are proven unrelated; -- requested critic review is satisfied; -- no blocking review state remains; -- the PR still matches the ledger items it claims to handle. - -If merge is not authorized or not ready, leave the PR open and report the next -action needed. +A created PR is not evidence that its items are complete. ## Output -Report: - -- source artifact or action list used; -- PRs created, updated, merged, or intentionally reused; -- items handled, skipped, already handled, needing repair, or needing an owner - decision; -- verification commands and results; -- critic review status when used; -- remaining risks or follow-up decisions. +Report the source artifact, approved ledger, PR groups created or reused, item +status, evidence locators, unresolved decisions, and the next proof-producing +action. diff --git a/codex/skills/action-items-to-prs/agents/openai.yaml b/codex/skills/action-items-to-prs/agents/openai.yaml index 43e16953..6d8fa34f 100644 --- a/codex/skills/action-items-to-prs/agents/openai.yaml +++ b/codex/skills/action-items-to-prs/agents/openai.yaml @@ -1,7 +1,7 @@ interface: display_name: "Action Items to PRs" - short_description: "Turn action items into scoped PRs" - default_prompt: "Use $action-items-to-prs to convert these action items into scoped PRs, verify the work, and use critic review when requested." + short_description: "Turn source actions into coherent PR groups" + default_prompt: "Use $action-items-to-prs to build a principal-reviewed action ledger from this source and group the unresolved items into coherent PR work." policy: allow_implicit_invocation: true diff --git a/codex/skills/behavior-validator/SKILL.md b/codex/skills/behavior-validator/SKILL.md index 658a3bc8..96a52450 100644 --- a/codex/skills/behavior-validator/SKILL.md +++ b/codex/skills/behavior-validator/SKILL.md @@ -1,28 +1,37 @@ --- name: behavior-validator -description: Prepare and delegate source-blind validation of observable behavior contracts. +description: Prepare and delegate fresh source-blind validation of an observable behavior contract. --- # Behavior Validator -Use this skill to create the validation boundary and delegate the actual judgment -to the dedicated `behavior-validator` agent. The skill owns contract preparation -and isolation. The agent owns read-only observable testing. +Create a clean boundary between implementation knowledge and observable product +judgment. This skill exists because source, tests, diffs, and confident review +claims can teach a validator what it is expected to see before it tests the real +surface. -## Contract First +The terminal result is clause-level evidence from a fresh validator that had +only the approved contract, fixtures, target access, and observable surfaces. -Capture the behavior contract before implementation detail can redefine success. -Use [contract-template.md](references/contract-template.md) for: +The skill owns contract preparation, workspace isolation, and acceptance of the +returned report. The dedicated `behavior-validator` agent owns read-only testing. + +## Establish The Observable Contract + +Capture success before implementation detail can redefine it. Use +[contract-template.md](references/contract-template.md) to name: - exact target identity and launch or connection instructions; +- user posture and permissions; - observable clauses with pass evidence; -- allowed fixtures and approved credential handling; -- destructive-action limits and cleanup; -- negative, boundary, and anti-cheat probes; -- blocked and out-of-scope rules. +- approved fixtures and credential route; +- negative, boundary, persistence, and anti-cheat probes; +- destructive-action and cleanup authority; +- blocked and out-of-scope conditions. -Do not put source paths, implementation notes, tests, diffs, review conclusions, -or expected internal mechanisms in the contract. +Write clauses as externally testable states. Keep source paths, internal +mechanisms, tests, diffs, review conclusions, and desired verdicts outside the +contract. ## Build The Isolated Workspace @@ -36,28 +45,37 @@ python .\codex\skills\behavior-validator\scripts\prepare-workspace.py ` --fixture ``` -The output path must be new and outside the source tree. The script copies only -`contract.md` and explicitly named fixtures, rejects source-control and -credential-like material, and writes `workspace-manifest.json` with hashes. +The output path is new and outside the source tree. The packager copies the +contract, runtime-specific local isolation instructions, and only explicitly +approved fixtures. It rejects source-control material, symlinks, sensitive path +shapes, and high-confidence secret content. `workspace-manifest.json` records +hashes and the complete allowed local path set. ## Delegate Fresh -Launch a fresh non-forked `behavior-validator` agent with its working directory -set to the prepared workspace. Pass only: +Launch a fresh non-forked `behavior-validator` agent in the prepared workspace. +Pass only: -- the workspace path; -- observable target access; +- workspace path; +- exact observable target identity and access; - credentials through approved secret handling; -- the requested report destination, if any. +- report destination, when needed. -Do not pass the implementation conversation, source-aware summaries, review -bundles, or a forked context. If implementation material becomes visible, discard -the result and rebuild a fresh workspace for a fresh agent. +Implementation conversation, source-aware summaries, review bundles, and parent +context remain outside the validator. Exposure to implementation material marks +the run contaminated and requires a fresh workspace plus fresh validator. ## Accept Evidence -Read [report-schema.md](references/report-schema.md) when checking the return. -Require clause-level pass, fail, blocked, or out-of-scope status, exact observed -evidence, anti-cheat probes, target identity, and contamination status. The -implementation owner may repair failures, but each repaired build needs a fresh -source-blind run. +Read [report-schema.md](references/report-schema.md) when consuming the return. +Require: + +- target and tested build identity; +- source-blind and contamination status; +- pass, fail, blocked, or out-of-scope status for every clause; +- exact actions and observations; +- negative, boundary, and anti-cheat results; +- evidence locators and remaining proof gaps. + +The implementation owner repairs failures. Every repaired build receives a new +source-blind run before the behavior gate closes. diff --git a/codex/skills/behavior-validator/agents/openai.yaml b/codex/skills/behavior-validator/agents/openai.yaml index 7fa2104c..0e754a81 100644 --- a/codex/skills/behavior-validator/agents/openai.yaml +++ b/codex/skills/behavior-validator/agents/openai.yaml @@ -1,7 +1,7 @@ interface: display_name: "Behavior Validator" short_description: "Validate observable behavior without reading source" - default_prompt: "Use $behavior-validator to write or read a behavior contract, stay source-blind, exercise the real user surface, and report clause-level evidence." + default_prompt: "Use $behavior-validator to establish the observable contract, build an isolated workspace, and obtain fresh source-blind clause-level evidence." policy: allow_implicit_invocation: true diff --git a/codex/skills/behavior-validator/references/report-schema.md b/codex/skills/behavior-validator/references/report-schema.md index c5d4db30..8c13852d 100644 --- a/codex/skills/behavior-validator/references/report-schema.md +++ b/codex/skills/behavior-validator/references/report-schema.md @@ -1,18 +1,23 @@ # Behavior Validation Report Schema -Use this shape when another agent or script will consume the result. +Use this shape when a principal, reviewer, or script will consume the result. +The report records exactly which isolated workspace and target were tested. ```json { - "schema_version": 1, + "schema_version": 2, + "tested_at": "ISO 8601 timestamp with timezone", + "workspace": { + "manifest_sha256": "hex digest", + "allowed_local_paths_checked": true + }, "target": { "surface": "string", - "identity": "string", + "identity": "exact build, ref, version, or artifact", "user_posture": "string" }, "contract": { - "path": "string or null", - "inline": false, + "path": "contract.md", "revision": "string or null" }, "source_blind": true, @@ -33,12 +38,20 @@ Use this shape when another agent or script will consume the result. "finding": "string or null" } ], - "anti_cheat_probes": ["string"], - "blockers": ["string"] + "anti_cheat_probes": [ + { + "probe": "string", + "observed": "string", + "result": "pass | fail | blocked" + } + ], + "blockers": ["string"], + "remaining_proof_gaps": ["string"] } ``` -Do not place credentials, cookies, tokens, private user data, raw session logs, -or implementation details in the report. When contamination occurs, set -`source_blind` to `false`, set `contaminated` to `true`, and do not count that run -as the behavior gate. +Keep credentials, cookies, tokens, private user data, raw session logs, source, +and implementation details outside the report. When implementation material +becomes visible, set `source_blind` to `false`, set `contaminated` to `true`, +record what was exposed, and stop. A contaminated report cannot close the +behavior gate. diff --git a/codex/skills/behavior-validator/scripts/prepare-workspace.py b/codex/skills/behavior-validator/scripts/prepare-workspace.py index 871b54ac..32de1261 100644 --- a/codex/skills/behavior-validator/scripts/prepare-workspace.py +++ b/codex/skills/behavior-validator/scripts/prepare-workspace.py @@ -1,28 +1,62 @@ #!/usr/bin/env python3 -"""Build a source-blind behavior validation workspace.""" +"""Build a fail-closed source-blind behavior validation workspace.""" from __future__ import annotations import argparse import hashlib import json +import re import shutil import sys from pathlib import Path from typing import Iterable, Sequence -BLOCKED_DIRECTORY_NAMES = {".git", ".hg", ".svn", "node_modules", "__pycache__"} +BLOCKED_DIRECTORY_NAMES = { + ".git", + ".hg", + ".svn", + ".ssh", + ".aws", + ".azure", + ".gnupg", + "node_modules", + "__pycache__", + "credentials", + "private-keys", + "secrets", +} BLOCKED_FILE_NAMES = { - ".env", - ".env.local", + "auth.json", + "cookies.sqlite", "credentials", "credentials.json", + "history.jsonl", + "id_ed25519", + "id_rsa", + "known_hosts", "secrets", "secrets.json", - "id_rsa", - "id_ed25519", + "session_index.jsonl", } -BLOCKED_SUFFIXES = {".pem", ".p12", ".pfx", ".key"} +BLOCKED_SUFFIXES = { + ".key", + ".p12", + ".pem", + ".pfx", + ".sqlite", + ".sqlite-shm", + ".sqlite-wal", +} +SECRET_PATTERNS = ( + ("private key", re.compile(rb"-----BEGIN (?:[A-Z0-9 ]+ )?PRIVATE KEY-----")), + ("GitHub token", re.compile(rb"\b(?:ghp|gho|ghu|ghs|ghr)_[A-Za-z0-9]{20,}\b")), + ("GitHub fine-grained token", re.compile(rb"\bgithub_pat_[A-Za-z0-9_]{20,}\b")), + ("OpenAI-style key", re.compile(rb"\bsk-[A-Za-z0-9_-]{20,}\b")), + ("AWS access key", re.compile(rb"\bAKIA[0-9A-Z]{16}\b")), +) +SCAN_CHUNK_BYTES = 1024 * 1024 +SCAN_OVERLAP_BYTES = 4096 class WorkspaceError(ValueError): @@ -32,7 +66,7 @@ class WorkspaceError(ValueError): def sha256(path: Path) -> str: digest = hashlib.sha256() with path.open("rb") as handle: - for chunk in iter(lambda: handle.read(1024 * 1024), b""): + for chunk in iter(lambda: handle.read(SCAN_CHUNK_BYTES), b""): digest.update(chunk) return digest.hexdigest() @@ -57,14 +91,45 @@ def reject_symlink_path(path: Path, stop: Path, label: str) -> None: cursor = cursor.parent -def reject_sensitive_name(path: Path) -> None: - for part in path.parts: - lowered = part.lower() - if lowered in BLOCKED_DIRECTORY_NAMES: - raise WorkspaceError(f"fixture includes blocked directory: {part}") - lowered_name = path.name.lower() - if lowered_name in BLOCKED_FILE_NAMES or path.suffix.lower() in BLOCKED_SUFFIXES: - raise WorkspaceError(f"fixture looks credential-bearing: {path.name}") +def sensitive_path_reason(path: Path) -> str | None: + parts = [part.lower() for part in path.parts] + for part in parts[:-1]: + if part in BLOCKED_DIRECTORY_NAMES: + return f"blocked directory: {part}" + name = parts[-1] if parts else "" + if name == ".env" or name.startswith(".env."): + return f"environment file: {name}" + if name in BLOCKED_FILE_NAMES: + return f"sensitive filename: {name}" + if any(name.endswith(suffix) for suffix in BLOCKED_SUFFIXES): + return f"sensitive file type: {name}" + return None + + +def reject_sensitive_path(path: Path, label: str) -> None: + reason = sensitive_path_reason(path) + if reason: + raise WorkspaceError(f"{label} looks credential-bearing ({reason}): {path.as_posix()}") + + +def secret_reason(path: Path) -> str | None: + overlap = b"" + with path.open("rb") as handle: + while True: + chunk = handle.read(SCAN_CHUNK_BYTES) + if not chunk: + return None + sample = overlap + chunk + for label, pattern in SECRET_PATTERNS: + if pattern.search(sample): + return label + overlap = sample[-SCAN_OVERLAP_BYTES:] + + +def reject_secret_content(path: Path, label: str) -> None: + reason = secret_reason(path) + if reason: + raise WorkspaceError(f"{label} contains a possible {reason}: {path.name}") def iter_fixture_files(path: Path) -> Iterable[Path]: @@ -91,11 +156,28 @@ def normalize_source_item(raw: Path, source_root: Path, label: str) -> Path: return resolved +def fixture_destination(relative: Path) -> Path: + parts = relative.parts + if parts and parts[0].lower() == "fixtures": + parts = parts[1:] + if not parts: + raise WorkspaceError(f"fixture does not identify a file: {relative}") + return Path("fixtures", *parts) + + def write_text(path: Path, text: str) -> None: path.parent.mkdir(parents=True, exist_ok=True) path.write_text(text, encoding="utf-8", newline="\n") +def file_record(path: Path, relative: str) -> dict[str, object]: + return { + "path": relative, + "sha256": sha256(path), + "size_bytes": path.stat().st_size, + } + + def build_workspace( source_root: Path, contract: Path, @@ -111,7 +193,7 @@ def build_workspace( output_unresolved = Path.cwd() / output_unresolved output_parent = output_unresolved.parent.resolve() output_resolved = output_parent / output_unresolved.name - if output_resolved.exists(): + if output_resolved.exists() or output_resolved.is_symlink(): raise WorkspaceError(f"output already exists: {output_resolved}") if is_relative_to(output_resolved, source_root): raise WorkspaceError("output must be outside the source root") @@ -119,61 +201,75 @@ def build_workspace( raise WorkspaceError("output must not contain the source root") contract_path = normalize_source_item(contract, source_root, "contract") - if not contract_path.is_file(): - raise WorkspaceError(f"contract is not a file: {contract_path}") - if contract_path.is_symlink(): - raise WorkspaceError(f"contract must not be a symlink: {contract_path}") + if not contract_path.is_file() or contract_path.is_symlink(): + raise WorkspaceError(f"contract must be a regular non-symlink file: {contract_path}") + reject_sensitive_path(contract_path.relative_to(source_root), "contract") + reject_secret_content(contract_path, "contract") fixture_files: list[tuple[Path, Path]] = [] - seen_destinations: set[str] = set() + seen_destinations: dict[str, Path] = {} for raw_fixture in fixtures: fixture_root = normalize_source_item(raw_fixture, source_root, "fixture") - reject_sensitive_name(fixture_root.relative_to(source_root)) + reject_sensitive_path(fixture_root.relative_to(source_root), "fixture") for fixture_file in iter_fixture_files(fixture_root): relative = fixture_file.relative_to(source_root) - reject_sensitive_name(relative) - destination = Path("fixtures") / relative - destination_key = destination.as_posix().lower() - if destination_key in seen_destinations: - continue - seen_destinations.add(destination_key) + reject_sensitive_path(relative, "fixture") + reject_secret_content(fixture_file, "fixture") + destination = fixture_destination(relative) + destination_key = destination.as_posix().casefold() + previous_source = seen_destinations.get(destination_key) + if previous_source is not None: + if previous_source == fixture_file: + continue + raise WorkspaceError( + "fixture destinations collide case-insensitively: " + f"{previous_source.relative_to(source_root).as_posix()} and " + f"{relative.as_posix()} -> {destination.as_posix()}" + ) + seen_destinations[destination_key] = fixture_file fixture_files.append((fixture_file, destination)) + isolation = ( + "# Source-Blind Validator Workspace\n\n" + "Validate the observable contract against the named target. Stay inside this " + "workspace for local reads and use only the approved fixture paths listed in " + "`workspace-manifest.json`. Treat source, diffs, tests, history, implementation " + "notes, review bundles, or any unlisted local material as contamination. Record " + "contamination and stop so the principal can create a fresh workspace.\n" + ) + try: output_resolved.mkdir(parents=True) contract_destination = output_resolved / "contract.md" shutil.copyfile(contract_path, contract_destination) + write_text(output_resolved / "AGENTS.md", isolation) + write_text(output_resolved / "CLAUDE.md", isolation) + copied: list[dict[str, object]] = [] for source_file, destination_relative in fixture_files: destination = output_resolved / destination_relative destination.parent.mkdir(parents=True, exist_ok=True) shutil.copyfile(source_file, destination) - copied.append( - { - "path": destination_relative.as_posix(), - "sha256": sha256(destination), - "size_bytes": destination.stat().st_size, - } - ) - - isolation = ( - "# Validator Workspace\n\n" - "This directory contains only an observable behavior contract and explicitly " - "approved fixtures. Do not leave this directory to inspect implementation " - "material. Treat any source, diff, test, history, or review bundle exposure " - "as contamination.\n" - ) - write_text(output_resolved / "AGENTS.md", isolation) - + copied.append(file_record(destination, destination_relative.as_posix())) + + instructions = [ + file_record(output_resolved / "AGENTS.md", "AGENTS.md"), + file_record(output_resolved / "CLAUDE.md", "CLAUDE.md"), + ] + allowed_paths = [ + "AGENTS.md", + "CLAUDE.md", + "contract.md", + "workspace-manifest.json", + *[record["path"] for record in copied], + ] manifest: dict[str, object] = { - "schema_version": 1, - "contract": { - "path": "contract.md", - "sha256": sha256(contract_destination), - "size_bytes": contract_destination.stat().st_size, - }, + "schema_version": 2, + "contract": file_record(contract_destination, "contract.md"), + "instructions": instructions, "fixtures": copied, + "allowed_local_paths": allowed_paths, "forbidden_material": [ "source", "diffs", @@ -181,6 +277,8 @@ def build_workspace( "git history", "implementation notes", "review bundles", + "credentials", + "unlisted local files", ], } write_text( diff --git a/codex/skills/compass/SKILL.md b/codex/skills/compass/SKILL.md index 31861175..5294024b 100644 --- a/codex/skills/compass/SKILL.md +++ b/codex/skills/compass/SKILL.md @@ -1,35 +1,57 @@ --- name: compass -description: Maintain Compass source, install boundaries, and validation. Invoke manually for Compass repository changes. +description: Maintain Compass source, runtime boundaries, install wiring, retirement, and validation. Invoke manually for Compass repository changes. --- # Compass -Use this skill only when changing Compass itself. +Maintain Compass as reviewed source for portable Codex and Claude behavior. This +skill exists because a strong runtime change can still fail when source routing, +derivation, retirement, policy, and verification disagree. -## Boundaries +Use it only when changing Compass itself. -- Reviewed source lives in this repository, not in live config homes. -- Installed agent behavior belongs under `codex/`. -- Repo-maintainer process belongs under `workflows/`, `local-docs/`, - `manifests/`, and `scripts/`. -- Carried opt-in packs belong under `carried/` and stay out of global manifests. -- Claude surfaces derive from Codex sources where the manifest says so. -- Deterministic mechanics belong in scripts; reviewer personas belong in agents. +## Preserve The Source Boundaries -## Read First +- Codex global guidance belongs in `codex/AGENTS.md`. +- Claude global guidance belongs in `claude/CLAUDE.md`. +- Runtime-neutral shared skills and agents belong under `codex/` and derive only + where the manifest says so. +- Claude-specific agent contracts belong under `claude/agents/`. +- Portable opt-in domain packs belong under `carried/` and stay out of global + install lists. +- Compass maintainer reasoning belongs in `workflows/` and `local-docs/`. +- Deterministic truth belongs in scripts, hooks, manifests, schemas, and tests. -Read root `AGENTS.md`, `local-docs/maintenance-learnings.md`, -`workflows/addition-intake.md`, and the workflow nearest the change. +Read root `AGENTS.md`, `philosophy.md`, `workflows/addition-intake.md`, +`local-docs/maintenance-learnings.md`, and the workflow nearest the change. -## Change Exactly +## Change The Whole Ownership Contract -Update source, install maps, policy contracts, required-file checks, and tests in -the same branch when ownership changes. Do not add fallback guidance for a -capability Compass can make exact. +When behavior or ownership moves, update the complete route in one change: -## Validate +- reviewed source; +- Codex and Claude install or derivation maps; +- source provenance; +- explicit retirement paths; +- policy and required-file checks; +- MCP catalog expectations; +- narrow tests and install round-trip coverage; +- directly related documentation. -Run `.\scripts\doctor.ps1`, narrow script tests, and `git diff --check`. Use -`.\scripts\verify-live.ps1 -SkipCodexCommand` only when live drift matters. Use a -PR as the review unit. +Make Compass-owned capability exact. A fallback paragraph is not a substitute +for correct wiring. + +## Validate The Result + +Run narrow tests first, then: + +```powershell +.\scripts\doctor.ps1 +.\scripts\verify-live.ps1 -SkipCodexCommand +git diff --check +``` + +Exercise install and retirement paths when ownership changes. Forward-test +judgment changes with a fresh realistic invocation. Use a focused PR as the +review unit and keep public mutation behind named authority. diff --git a/codex/skills/grill-me/SKILL.md b/codex/skills/grill-me/SKILL.md index 2e2a1fde..b4f4cad3 100644 --- a/codex/skills/grill-me/SKILL.md +++ b/codex/skills/grill-me/SKILL.md @@ -1,32 +1,58 @@ --- name: grill-me -description: Interview the user about a plan or design through one-question-at-a-time stress testing. Use when user says "grill me" or wants plan review. +description: Stress-test a plan or design one consequential question at a time after mapping the full unresolved decision space. --- # Grill Me -Use this skill to stress test a plan, design, or decision before the user acts -on it. The role is a skeptical design partner: find unclear assumptions, -missing constraints, risky dependencies, and premature decisions while keeping -the conversation moving. +Act as a skeptical design partner. Strengthen the plan by finding the few +unknowns that can still change its outcome, scope, sequence, interface, or risk. +This skill exists to replace vague agreement and improvisational questioning +with a deliberate decision conversation. -The failure mode this prevents is vague agreement. Do not turn the review into -a broad lecture or a checklist dump. Ask one sharp question at a time, explain -why it matters when useful, and include your recommended answer so the user can -accept, reject, or correct it quickly. +The user sees one sharp question at a time. The reasoning begins with the whole +question space, not the first question that comes to mind. -## Boundaries +## Build The Question Catalog First -- Ask one question at a time. -- Prefer questions that change the plan, sequence, scope, or risk model. -- Use codebase evidence instead of asking when the answer is locally available. -- Stop when the plan has clear decisions, unresolved risks, and next actions. -- Do not keep interrogating just to cover every possible branch. +Read the available conversation, repository evidence, research, and prior +answers before asking anything. Create a compact internal catalog of candidate +questions. -## Question Loop +For each candidate, identify: -1. Identify the next most consequential unknown. -2. Ask one concise question. -3. Provide the recommended answer or default assumption. -4. Wait for the user's response before asking the next question. -5. When the plan is stable enough, summarize decisions and remaining risks. +- the decision it would change; +- whether the answer already exists in current context or local evidence; +- overlap with another question; +- consequence of delaying it; +- recommended answer or default assumption. + +Remove answered, duplicate, cosmetic, and low-impact questions. Rank what +remains by decision impact. + +## Ask One Consequential Question + +Ask the highest-ranked unresolved question in concise language. Include the +recommended answer or default assumption so the user can accept, reject, or +correct it quickly. Explain why it matters only when the consequence is not +obvious. + +After each answer, recompute the catalog. A response may resolve several planned +questions or create a more important one. + +Use repository evidence instead of asking the user to restate facts already +available. Refer back to earlier answers rather than rephrasing the same three +questions. + +## Stop On Decision Sufficiency + +Finish when the remaining unknowns no longer materially change the plan. Do not +continue merely because the interaction has established a question-answer +rhythm. + +Return a compact synthesis of: + +- decisions made; +- assumptions accepted; +- material unresolved risks; +- next action or planning artifact. diff --git a/codex/skills/grill-me/agents/openai.yaml b/codex/skills/grill-me/agents/openai.yaml index acceeb11..64e5a70c 100644 --- a/codex/skills/grill-me/agents/openai.yaml +++ b/codex/skills/grill-me/agents/openai.yaml @@ -1,7 +1,7 @@ interface: display_name: "Grill Me" - short_description: "Stress test plans one question at a time" - default_prompt: "Use $grill-me to stress test my plan one question at a time, recommending a concrete answer for each consequential unknown." + short_description: "Map the decision space, then ask one sharp question" + default_prompt: "Use $grill-me to map the unresolved decision space, remove questions already answered by context, and stress-test my plan one consequential question at a time." policy: allow_implicit_invocation: true diff --git a/codex/skills/input-token-economy/SKILL.md b/codex/skills/input-token-economy/SKILL.md deleted file mode 100644 index 701947d4..00000000 --- a/codex/skills/input-token-economy/SKILL.md +++ /dev/null @@ -1,77 +0,0 @@ ---- -name: input-token-economy -description: In long agent sessions, accumulated input often dominates cost. Read targeted slices, keep the working set small, and split long sessions deliberately. ---- - -# Input Token Economy - -On a coding agent, accumulated input often becomes the largest cost in long -sessions. Each turn may carry a large working set: instructions, tools, file -reads, tool outputs, and running history. Compaction, caching, and response -state can reduce what is charged or re-sent, but every new line dragged into -the working set still has to be paid for somewhere. Output and reasoning effort -matter too, especially when quality permits smaller answers or lower reasoning. -This skill focuses on the cost that quietly compounds: how much context you -carry per turn and how many turns you keep carrying it. - -This skill is about spending input on purpose. Not about being stingy with the -answer. - -## Read Slices, Not Whole Files - -Most questions about a file are about a part of it. Read that part. - -- Prefer a targeted read over a full one: the part you need, an end, a known - line range, or the matching lines. Go whole-file only when you truly need the - whole file, and say why. -- One good read beats several full ones. If you will need the same large file - more than once, read the slice you need, or extract the relevant region once, - rather than re-reading the whole thing each turn. -- Keep big output out of the context. Tail long logs, count and summarize, or - write results to a file and read the summary back. A 50k-line dump read - across five turns is paid for five times. - -The test: could you have answered from the last forty lines, or the matched -lines, instead of the whole file? Then read those. - -## Keep Sessions Short Enough To Re-Send - -A long thread is expensive by construction, because the growing tail tends to -stay in the working set. A session twice as long is not twice the cost; late -turns often cost more than early ones, since they carry more accumulated -context. - -- Start a fresh session for a new sub-goal. Restating the small piece of - context a new task needs is cheaper than carrying the whole history of the - last one forward. -- When a thread has grown large and the work shifts, summarize the result so - far and continue lean, rather than dragging the full transcript along. -- Prefer a subagent or a fresh run for self-contained chunks of work only when - you can preserve the work cleanly. Carry a compact handoff with the objective, - constraints, branch or file state, pending verification, and known risks. For - governed implementation splits, use `subagent-driven-development`. When - durable goal state matters, use the active runtime's goal-contract route if - one is available; otherwise include the objective, owner, completion evidence, - and next action in the handoff. - -The frontier case is the monitoring thread: one long-running session that -watches something can dwarf everything else, because each watch cycle is a full -turn. The monitor-to-completion skill handles that one directly. - -## What This Rules Out - -- read-then-reread: pulling the same large file whole across multiple turns. -- dump-into-context: pasting a huge log or directory listing into the thread - when a count, a tail, or a grep would have answered. -- one-thread-forever: running unrelated sub-goals in a single ever-growing - session just because it is the one already open. -- optimize-only-the-visible-axis: trimming the answer while repeatedly loading - large irrelevant input. Lower reasoning effort and shorter output can be valid - when quality permits, but they do not fix an oversized working set. - -## Judgment Over Checklist - -The model is the part that thinks. The expensive part is everything it may have -to keep looking at while the session grows. Read the slice you need, keep the -thread to the work at hand, and let finished context go. Spend input like it is -often the bill, because in long agent work it often is. diff --git a/codex/skills/input-token-economy/agents/openai.yaml b/codex/skills/input-token-economy/agents/openai.yaml deleted file mode 100644 index e5796ac7..00000000 --- a/codex/skills/input-token-economy/agents/openai.yaml +++ /dev/null @@ -1,7 +0,0 @@ -interface: - display_name: "Input Token Economy" - short_description: "Spend input tokens on purpose" - default_prompt: "Use $input-token-economy to cut re-sent context: read targeted slices not whole files, keep the working set small, and split long sessions instead of one growing thread." - -policy: - allow_implicit_invocation: true diff --git a/codex/skills/monitor-to-completion/SKILL.md b/codex/skills/monitor-to-completion/SKILL.md index 74c1478c..f64e7a6c 100644 --- a/codex/skills/monitor-to-completion/SKILL.md +++ b/codex/skills/monitor-to-completion/SKILL.md @@ -1,33 +1,54 @@ --- name: monitor-to-completion -description: Wait on one observable condition in a bounded command and return one compact result. +description: Wait on one observable condition inside one bounded command and return one compact terminal result. --- # Monitor To Completion -Use this skill only for mechanical waiting. The script owns the clock. The -parent owner chooses the condition, timeout, and response. +Structure a mechanical wait so the clock stays outside model conversation. This +skill exists because repeated short polling turns expand context, consume model +calls, and create narration without adding judgment. -## Contract +The parent chooses the condition, deadline, and response policy. One blocking +command owns the wait. -- Wait on one stable observable condition: process exit, port state, file, - container status, log match, HTTP response, or equivalent signal. -- Prefer a native wait. Otherwise poll inside one blocking command, never across - model turns. -- Derive the timeout from a deadline, service expectation, process budget, or - explicit operator limit. Do not use arbitrary poll counts. -- Exit distinctly on success, target failure, and timeout. -- Sample diagnostics without streaming repetitive logs into context. -- Print one compact result: condition, outcome, elapsed time, and the value the - parent owner needs. -- Return the result to the execution or goal owner. A successful wait is evidence, - not automatic completion of the parent task. +## Wait Contract -## Timeout +Wait for one stable observable condition, such as: -A timeout wakes the parent owner for judgment. Re-read current state, decide -whether the condition is still valid, and choose recovery, a changed timeout, -another action, or a stop. Do not silently relaunch the same wait. +- process exit; +- port or service state; +- file creation or change; +- container state; +- log match; +- HTTP result; +- review or check terminal state exposed through a command. -Use a scheduled watcher or automation when a condition must be checked over a -long span without model judgment. +Prefer a native wait. Otherwise poll inside one command. Derive the timeout from +a deadline, service expectation, process budget, or explicit operating limit. + +Return distinct outcomes for success, target failure, and timeout. Sample useful +diagnostics without streaming repetitive logs into context. + +## Compact Result + +Print only what the parent needs: + +- condition; +- outcome; +- elapsed time; +- final observed value; +- compact diagnostic on failure or timeout. + +A successful wait is evidence for the parent objective. The parent decides what +that evidence means. + +## Judgment Boundary + +Use a fresh narrow `progress-monitor` agent when periodic checks require limited +interpretation, anomaly detection, or escalation. Use an orchestration +controller when the result can change ownership, route, authority, or goal +completion. + +A timeout returns judgment to the parent. Reinspect current state before choosing +a new condition, changed timeout, recovery action, or stop. diff --git a/codex/skills/monitor-to-completion/agents/openai.yaml b/codex/skills/monitor-to-completion/agents/openai.yaml index c6108399..e1fddd98 100644 --- a/codex/skills/monitor-to-completion/agents/openai.yaml +++ b/codex/skills/monitor-to-completion/agents/openai.yaml @@ -1,7 +1,7 @@ interface: display_name: "Monitor To Completion" - short_description: "Run waits in one blocking script, not a poll loop" - default_prompt: "Use $monitor-to-completion to run this mechanical wait or watch to completion in one blocking script instead of polling in a sleep loop, which carries session context on every wake." + short_description: "Concentrate one mechanical wait in one command" + default_prompt: "Use $monitor-to-completion to wait for this one observable condition inside a bounded command and return a compact terminal result." policy: allow_implicit_invocation: true diff --git a/codex/skills/orchestration-controller/SKILL.md b/codex/skills/orchestration-controller/SKILL.md index a9abe5ef..52806d2c 100644 --- a/codex/skills/orchestration-controller/SKILL.md +++ b/codex/skills/orchestration-controller/SKILL.md @@ -1,139 +1,118 @@ --- name: orchestration-controller -description: Oversee delegated work without taking over worker execution or accepting completion without evidence. +description: Preserve a parent objective above delegated work, prepare reviewed assignments, reconcile evidence, and correct drift. --- # Orchestration Controller -Use this skill when a parent objective spans workers, reviews, monitors, or -long-running execution and needs an owner above the work. Do not use it to -perform a worker task. Use `subagent-driven-development` for same-session plan -execution and `monitor-to-completion` for mechanical waits. - -## Posture - -Stay one level above execution. The controller is the control plane, not a -stronger worker. Its value is preserved perspective, not extra implementation -throughput. Resist three common drifts: accepting a confident return claim as -reality, taking over when a worker becomes slow or uncertain, and allowing the -current route to replace the parent result. - -Be calm, skeptical, and sparse. When an active owner has a coherent plan and is -producing new evidence, send nothing. A controller message should change the -outcome contract only with authority, or otherwise change context, route, -evidence standard, authorization, or decision point. Generic continuation -acknowledgements, repeated nudging, and controller-authored task artifacts erase -the separation this skill exists to protect. Restore worker agency rather than -replacing it. - -## Control State Model - -For a long-lived objective, keep three logical layers distinct: - -- **Parent outcome, stable:** the finished state, required assertions, evidence - standard, constraints, scope, and amendment authority. -- **Acceptance ledger, status-mutable:** stable assertion text with current - status and linked evidence. -- **Execution state, mutable:** observed state, unmet assertions, owners, running - work, blockers, and next actions. - -These layers may share one compact control surface, but their authority differs. -A discovered prerequisite, repair, failed attempt, phase, command, handoff, or -monitor condition changes execution state. It does not replace the parent -outcome. Only an explicit authorized amendment changes the finished state or -assertion text. - -Name authoritative inputs in precedence order and identify one mutable -current-state surface. After interruption, compaction, restart, or handoff, -re-open those inputs before directing work. Chat summaries and historical -ledgers are evidence, not current authority, unless the contract explicitly says -otherwise. - -## Ownership Boundaries - -- The controller owns the stable parent outcome, required assertions, amendment - history, assignments, routing, evidence checks, and completion judgment. -- The controller keeps the acceptance ledger and execution state truthful. It - may change assertion status and next actions from evidence; it may not rewrite - assertion text merely because the route changed. -- Do not write worker-owned code, config, docs, benchmark output, product output, - or task artifacts. That work belongs to the worker or a fresh worker. -- Long-running execution must have a named execution owner for the shell session, - live process, logs, and immediate recovery. The controller may direct that - owner but does not become the runner. -- Controller edits are limited to control surfaces such as assignments, - assertion status, runtime state, monitor schedules, review requests, and - handoffs. -- Name one writer for each mutable control surface. Prep, runner, monitor, and - review owners remain read-only on controller policy unless their assignment - explicitly grants that exact edit. A delegated suggestion is not edit - authority. -- When a child needs active goal state, the child applies its own slice outcome. - The parent outcome remains read-only context, and the controller retains - parent-goal ownership and completion authority. - -If controller judgment and live execution collapse into one context, treat that -as a control-plane failure. A runner may still own monitoring and immediate -local repair inside its contract. Preserve evidence, stop dispatching new -successors, restore the controller and runner split plus the compact control -contract, then resume. - -## Continuation And Return Signals - -Treat continuation as the normal state. An active worker keeps executing while -safe, authorized work remains. A routine turn boundary, progress update, or -controller silence does not suspend the assignment or transfer ownership. Do not -require a worker to ask permission to keep doing assigned work. - -The runtime or host owns lifecycle state such as queued, running, suspended, -waiting on an external event, completed, failed, or cancelled. A worker report is -evidence for a routing decision, not authority to set the parent state: - -- **Progress evidence:** if the plan remains coherent and evidence is improving, - send nothing. Intervene only with a concrete correction or changed condition. -- **Completion claim:** verify the slice postcondition and map the evidence to the - named parent assertions. A polished report is not self-verifying. -- **Input request:** require the exact missing fact or decision, why it blocks all - safe useful work, and what was already tried. Supply it or route it to the - right owner before escalating to the user. -- **External wait:** require the named event or process and confirmation that no - useful parallel work remains. Put mechanical waiting in a bounded monitor. -- **Failure report:** inspect the failed action, evidence, local recovery, - current state, smallest reversible move, owner, and any true authorization or - dependency boundary. -- **Negative result:** evaluate it as task evidence. It is not an orchestration - state by itself. - -After every material result or worker return: - -1. attach current evidence to the parent assertions the slice was meant to - advance; -2. update observed state and assertion status; -3. recompute which required assertions remain unmet; -4. choose the next route, owner, review, wait, or recovery action; and -5. complete only when no required assertion remains unverified. - -Completing a repair, command, phase, review, or delegated slice is progress. If -another parent assertion remains unmet, the controller must route the next move -rather than treating the completed route as the finish line. - -Keep completion and concern severity separate. A completed artifact may still -have residual risk; an incomplete artifact may have no major concern beyond a -specific missing input. - -A timeout or quiet worker is not an automatic takeover signal. Collect partial -evidence, account for execution ownership, and choose a concrete recovery, -routing, hold, cancellation, or reassignment action. Use a controller heartbeat -only when each wake requires judgment. Put purely mechanical waits in one -bounded `monitor-to-completion` run. - -## Required Reference - -Read [controller-principles.md](references/controller-principles.md) when return -interpretation, rerouting, monitoring, review, or handoff judgment needs detail. +Act as the project manager above execution. Preserve one coherent parent +objective while temporary workers, monitors, reviews, and contexts advance it. +This role exists because long-running work can produce abundant motion while +compaction, delegation, and local failures quietly replace the original result. + +The controller is the user-facing logical principal. It authors control state, +prepares reviewed assignments, receives evidence, and judges completion. It +does not prove its value by becoming the worker. + +Use `using-goals` when the objective needs a durable goal and checkpoint +contract. Use `subagent-driven-development` when an approved implementation plan +contains delegable slices. Use `monitor-to-completion` for pure waits and the +`progress-monitor` agent for narrow judgment-based observation. + +## Preserve One Logical Author + +The principal, or the user directly, authors: + +- the stable goal and amendments; +- anchor precedence; +- plan and assignment boundaries; +- catalog, ledger, and checkpoint state; +- evidence acceptance; +- route, ownership, and completion decisions. + +Delegates own assigned artifacts and investigations. They return evidence +through the named return channel. They do not invent their own control format or +mutate the principal's state merely to report progress. + +Before dispatch, review the assignment yourself. Give the user an opportunity +to review material goals, plans, slice boundaries, and irreversible authority +unless existing authority or an explicit waiver covers the launch. + +## Stay Above Execution + +A controller message should change one of these things: + +- context; +- route; +- owner; +- evidence standard; +- authority; +- scope; +- decision point; +- goal amendment, when authorized. + +Silence is correct while an owner has a coherent route and current evidence is +improving. Ordinary continuation requires no acknowledgement handshake. + +Implementation repairs return to the implementation owner or a fresh assigned +worker. Controller edits are limited to principal-authored control documents and +explicitly owned coordination artifacts. + +## Give Workers A Clean Return Path + +Every assignment names: + +- worker identity and role; +- bounded outcome; +- parent assertion IDs; +- authoritative anchors; +- owned artifact or investigation; +- allowed actions and preservation boundaries; +- evidence target; +- return conditions; +- controller return channel. + +Workers escalate one exact missing decision, authority boundary, external event, +or exhausted recovery path. The controller answers or reroutes without absorbing +the task. + +## Read Returns As Evidence + +A worker return is a claim about an artifact or a real exception. Reinspect the +relevant state, then: + +1. map accepted evidence to parent assertions; +2. update observed state; +3. recompute the remaining gap; +4. choose the next route, owner, review, wait, or decision; +5. complete only when the full goal is verified. + +A polished report, finished slice, quiet process, timeout, or negative result is +not parent completion by itself. + +## Correct Drift Without Babysitting + +Intervene when evidence stalls, the route loses contact with the goal, a worker +repeats unchanged attempts, scope expands without authority, or context becomes +polluted. + +Ask questions that restore agency: + +- Which parent assertion are you advancing? +- What did the last action prove? +- What observable state exists now? +- What is the smallest action that can produce new evidence? +- Does the current owner still have the right context and authority? + +Be direct when work drifts. Friendly pressure serves delivery; constant presence +does not. + +Read [references/controller-principles.md](references/controller-principles.md) +for return interpretation, intervention, recovery, and checkpoint detail. ## Completion -Complete only when current evidence verifies every required parent assertion, or -when the user explicitly amends the outcome to accept an incomplete endpoint and -the remaining owner and dependency are recorded. +Completion is a principal judgment against current evidence and the stable goal. +Record verified assertions, authorized amendments, residual concerns, and any +public mutations. A remaining assertion requires a next owner or an explicit +amendment, not a completion claim. diff --git a/codex/skills/orchestration-controller/agents/openai.yaml b/codex/skills/orchestration-controller/agents/openai.yaml index b4a98248..55d57f39 100644 --- a/codex/skills/orchestration-controller/agents/openai.yaml +++ b/codex/skills/orchestration-controller/agents/openai.yaml @@ -1,6 +1,6 @@ interface: display_name: "Orchestration Controller" short_description: "Oversee workers without taking over" - default_prompt: "Use $orchestration-controller to keep ordinary continuation implicit, intervene only when evidence changes the route, preserve execution ownership, and verify the parent objective." + default_prompt: "Use $orchestration-controller to preserve one principal-authored objective, prepare reviewed assignments, reconcile returned evidence, and correct drift without taking over execution." policy: allow_implicit_invocation: true diff --git a/codex/skills/orchestration-controller/references/controller-principles.md b/codex/skills/orchestration-controller/references/controller-principles.md index 4bcb89ea..b62a9be7 100644 --- a/codex/skills/orchestration-controller/references/controller-principles.md +++ b/codex/skills/orchestration-controller/references/controller-principles.md @@ -1,188 +1,115 @@ # Controller Principles -Use this reference when the controller needs more detail than the router. - -## Stance - -A controller protects judgment by staying outside execution. Workers are close -to commands, edits, logs, and local failures. The controller remains close enough -to understand evidence but far enough away to keep the parent result, required -assertions, ownership, and stop conditions visible. - -Do not answer worker friction with slogans or takeover. Strong direction names an -owner, executable action, and proof. A controller message should change the -route, context, evidence standard, authorization, or decision point. Otherwise it -is noise. - -## Control Contract - -Front-load the stable contract before mutable execution state: - -1. desired finished state; -2. required final-state assertions and verification surfaces; -3. constraints, scope, exclusions, and amendment authority; -4. authoritative inputs in precedence order; -5. live state surface and its writer; -6. current owner and execution state; -7. next action, evidence, and history. - -The first four items describe what completion means and should not change merely -because the current route changes. The final three are operating state and may be -rewritten as evidence arrives. - -Treat controller state as four linked variables: - -- **O - outcome:** stable finished-state assertions; -- **S - observed state:** what current evidence says exists now; -- **G - gap:** required assertions not yet verified from `S`; -- **P - plan:** the current route for reducing `G`. - -Worker returns normally change `S`, `G`, and `P`. Only an explicit authorized -amendment changes `O`. If the current obstacle vanished, `O` should still tell a -fresh controller what finished work looks like. - -Long-running work needs an execution owner for the process, output, logs, and -immediate retries. The controller owns the outcome contract, acceptance ledger, -evidence checks, reroutes, and completion decision. - -Each mutable control surface has one named writer. Delegated prep, execution, -monitoring, and review roles may propose policy changes but do not edit the -controller-owned contract unless the assignment grants that exact authority. -Before accepting an edit, verify the expected prior revision and preserve the -previous state as evidence. Outcome or assertion edits also require the named -amendment authority and a recorded reason. - -After interruption, compaction, restart, or handoff, re-open the authoritative -inputs in order before routing work. Use history to explain how the current state -arose, not to override the current-state surface. If execution, monitoring, and -immediate local repair remain with the runner, that is normal. If controller -judgment also collapses into that execution context, preserve evidence and -restore the controller and runner split before dispatching more work. - -## Autonomous Continuation - -Once dispatched, an owner keeps the assignment while useful, safe, authorized -work remains. The end of a model turn, a progress update, or controller silence -does not transfer ownership. The owner returns control only after verifying its -slice postcondition or reaching a real exception: an exact missing input, a named -external wait with no parallel work, an explicit hold or cancellation, an -authorization or safety boundary, or an unrecoverable failure after local -recovery. - -When a host forces a checkpoint, preserve the parent assertion mapping, slice -outcome, current route, and evidence, then requeue the same owner unless the -controller explicitly changes the route. Do not add an acknowledgement handshake -to ordinary progress. - -When an active worker has a coherent plan and is producing new evidence, send no -worker-directed message. Intervene only to supply missing input, correct course, -change scope, set a hold, cancel, reassign, or choose a recovery action. - -## Read Return Signals - -The host owns lifecycle state. A worker report is a claim about the artifact or -an exception that may require routing: - -- A **progress report** should include evidence, the parent assertions it - advances, and the next action. If progress is coherent, it requires no - controller response. -- A **completion claim** triggers independent checks against the slice - postcondition and named parent assertions. Remaining concerns are recorded - separately from completion. -- An **input request** must name the exact fact, decision, permission, or context - that blocks all remaining safe work. -- An **external wait** must name the event or process, its owner, and why no useful - parallel work remains. Route mechanical waiting to a monitor. -- A **failure report** must name the failed action, evidence, local recovery, - current system state, smallest reversible next move, and required owner. -- A **negative result** is evidence to assess, not a reason to stop by itself. - -A useful exception diagnosis is short: +Use this reference when orchestration needs more detail than the main role +statement. -```text -Which parent assertion is still unmet? -What exactly prevents the next safe action? -What did the last attempt prove? -What state exists now? -What is the smallest reversible move? -Who owns that move? -``` +## Control Posture -The worker performs diagnosis and execution inside its boundary. The controller -chooses the route without absorbing the task. +The controller preserves perspective by staying outside execution. It remains +close enough to inspect evidence and far enough away to keep the complete goal, +authority, ownership, and next decision visible. -After a return, the controller updates evidence and status, recomputes the gap to -the full parent outcome, and then chooses the next route. A completed slice never -short-circuits this reconciliation. +Strong direction names an owner, executable action, and proof. Generic nudges, +status acknowledgements, and controller-authored worker artifacts add noise. -## Detect Thrash +## Event-Driven First -Thrash is motion that no longer improves judgment. It includes repeated attempts -without new evidence, widening scope, log dumps without a next action, routine -debugging escalated to the user, a worker nearing context saturation, or repeated -rewrites of the objective to match whichever route is currently active. +Workers keep their assignments while safe, authorized, useful work remains. +They return on verified slice completion or a real exception. -Reset the route with: +Controller intervention is justified by: -```text -Parent outcome, read-only: -Required parent assertions: -Assertions advanced by this slice: -Current evidence: -Still-unmet assertions: -Attempts that changed state: -Next smallest reversible action: -Fresh owner needed: -``` +- new evidence that changes the route; +- a material decision or missing authority; +- repeated attempts without discriminating evidence; +- stale or contradictory control state; +- a workstream no longer matching its assignment; +- a checkpoint or review boundary; +- a user hold, cancellation, or amendment. + +Use a heartbeat only when each wake can require judgment. A purely mechanical +condition belongs in one bounded command. A narrow periodic observation belongs +to a fresh progress monitor with a compact contract. + +## Return Signals + +### Progress + +Accept the evidence locator, update nothing when no principal judgment is +needed, and let the worker continue. + +### Completion Claim + +Inspect the artifact and mapped evidence. Decide whether the slice postcondition +is verified, then reconcile it against the parent assertions. -A fresh owner receives that packet and owns execution. The controller does not -absorb the task or replace the parent outcome with the recovery action. +### Decision Request -## Monitoring And Review +Require the exact question, affected assertion or constraint, options and +consequences, work already completed, and recommendation. -Use a controller heartbeat only when each wake requires judgment such as -inspecting new evidence, rerouting, requesting review, or choosing recovery. Put -mechanical waits inside one bounded command through `monitor-to-completion`. +### External Wait -A monitor's exit condition is evidence for the controller. It is not parent -completion unless the stable parent contract explicitly defines it as a required -assertion. +Require the named event, owner, observable condition, and why no useful parallel +work remains. Route the wait mechanically when possible. -Monitoring should create perspective, not constant presence. When work is moving -under a clear owner and evidence gate, step back. When the next event is purely -mechanical, do not spend model turns watching it. +### Failure -Use independent review or checks to test worker claims. Review is a source of -judgment, not another reporting ritual. Route findings back to the implementation -owner and then update the parent acceptance ledger from evidence. +Require the failed action, observed state, recovery attempted, what changed in +the causal model, smallest reversible next move, and next owner. -## Controller Handoff +### Negative Result -A handoff should preserve the completion contract and current control state, not -narrate every attempt. +Treat it as task evidence. Determine which hypothesis or assertion it supports +or falsifies. + +## Detect Thrash + +Thrash is motion that no longer improves judgment. Common signals include: + +- repeated repairs with the same failure signature and no new evidence; +- expanding scope around the latest symptom; +- large log transfers without a proposed next action; +- routine friction repeatedly escalated to the user; +- rewriting the goal to match the current route; +- a worker approaching context saturation without a checkpoint; +- multiple agents authoring incompatible control state. + +Reset with a principal-authored packet: ```text -Parent outcome, read-only: -Required assertions and evidence standard: -Outcome amendments, if any: -Acceptance ledger or canonical path: -Authoritative inputs, in order: -Live state surface and writer: -Current owner: -Current runtime state: -Running now: -Evidence matched to assertion IDs: +Parent goal and revision: +Assertions advanced by this workstream: +Current evidence: Still-unmet assertions: -Signals needing judgment: -Reroutes or questions sent: -Next decision point: -Remaining dependency: -Re-anchor action: +Attempts that changed state: +Attempts that repeated unchanged state: +Next smallest proof-producing action: +Fresh owner or context needed: ``` -## Goal Activation +## Compaction And Replacement -When a child needs active goal state, tell it to apply and confirm an observable -slice outcome tied to named parent assertion IDs in its own context. Delegated -goal text alone is not active state. The parent outcome remains read-only context, -and parent completion authority remains with the controller. +Before replacing the principal context, write the checkpoint. The successor +reopens anchors, verifies current branch or runtime state, confirms active +workers and return channels, and then resumes the same logical role. + +Conversation summaries explain how the state arose. Authoritative anchors and +current observations decide what is true now. + +## Handoff Shape + +```text +Goal and revision: +Amendment authority: +Authoritative anchors, in order: +Control document paths: +Current observed state: +Accepted evidence mapped to assertions: +Still-unmet assertions: +Active assignments, workers, processes, and worktrees: +Signals awaiting judgment: +Decisions or authority needed: +Next proof-producing action: +First state to reverify: +``` diff --git a/codex/skills/pr-review-loop/SKILL.md b/codex/skills/pr-review-loop/SKILL.md index 99440f48..b299b4e8 100644 --- a/codex/skills/pr-review-loop/SKILL.md +++ b/codex/skills/pr-review-loop/SKILL.md @@ -1,64 +1,95 @@ --- name: pr-review-loop -description: Drive a named PR through current-head checks, independent review, behavior validation, fixes, and merge gates. +description: Drive a named pull request through current-head evidence, independent review, repairs, behavior proof, and its authorized merge boundary. --- # PR Review Loop -Use this skill when a pull request must move through evidence and review without -losing branch identity or current-head discipline. +Move one named pull request from its current head to a truthful readiness +judgment. This skill exists because checks, approvals, runtime evidence, and +comments become stale whenever the head changes, while a polished summary can +make old proof look current. -Read [review-loop-playbook.md](references/review-loop-playbook.md) for review -bundles, source-blind validation, stale-head handling, and merge boundaries. +The terminal result is a current-head evidence packet and an explicit statement +of the remaining review or mutation boundary. -## Start With The Named PR +Read [review-loop-playbook.md](references/review-loop-playbook.md) for confined +review bundles, source-blind behavior proof, waiting, and stale-PR decisions. -Record: +## Preserve The Named Identity -- repository, PR number, base branch, head branch, and head SHA; -- current checks, review decision, inline findings, and merge state; -- whether the user asked to preserve this PR or rebuild from current main. +Record repository, PR number, base branch, head branch, current head SHA, checks, +review decision, inline findings, and merge state. -Keep the exact branch and PR unless the user explicitly asks for replacement, -retargeting, or cleanup. +Continue on the named PR unless the user explicitly asks to replace, retarget, +close, or rebuild it. When the requested outcome is current-main intent rather +than historical branch preservation, make that decision explicit before +creating a replacement. -## Required Gates +## Bind Every Gate To The Head -- `neutral-critic` reviews every PR loop. -- Any `ariobarin/*` repository also requires a second independent reviewer. -- Observable behavior changes require a separate source-blind - `behavior-validator` result. -- All conclusions are tied to the current head SHA. +All readiness conclusions target one exact head SHA. After a push, rebase, +force-push, retarget, or material build change: -A local test supports readiness but does not replace an independent gate. +- reread the head SHA; +- rerun affected checks; +- refresh independent review; +- refresh observable behavior evidence; +- inspect current inline and top-level findings. -## Iteration +A local check supports a gate. It does not replace independent judgment when +that judgment is required. -1. Inspect the current PR and inline comments. -2. Run the narrow checks that prove the changed surfaces. -3. Request or perform source-aware review on the current head. +## Choose Proportionate Independent Evidence + +Every PR review loop includes current-head independent review. Use +`neutral-critic` unless the user or repository names another accepted reviewer. +Apply additional reviewers when repository policy, user direction, change risk, +or specialist scope requires them. + +Observable user or operator behavior receives source-blind validation when the +claim is material and ordinary current-head tests do not fully establish it. +Small documentation-only, metadata-only, or mechanically proven changes need no +invented runtime ceremony. + +Record the gate selection and its reason. Strong review is evidence-bearing, not +a fixed number of agents. + +## Iterate Through The Implementation Owner + +1. Inspect current PR state and unresolved comments. +2. Run the narrow checks that cover changed behavior. +3. Obtain independent current-head review. 4. Route actionable findings to the implementation owner. -5. Re-run checks after each material push. -6. Re-read the head SHA and refresh stale review gates. -7. Run source-blind behavior validation for observable changes. -8. Stop at the authorized merge boundary. +5. Rerun affected checks after every material change. +6. Refresh stale reviewers and behavior evidence against the new SHA. +7. Stop at the named public-mutation boundary. -Use `scripts/build-review-bundle.py` when a fresh reviewer should receive the -complete selected patch without arbitrary checkout context. +Use `scripts/build-review-bundle.py` when a fresh source-aware reviewer needs the +complete selected patch without arbitrary checkout or conversation context. -## Waiting For Review +## Wait On Actual State -After review acknowledgement, use `monitor-to-completion` to wait on the actual -review, comment, or check state. Choose a bounded timeout from the repository -review expectation, user deadline, or explicit service window. Do not use a -fixed clock sleep or repeated model polling. +After review or check acknowledgement, use `monitor-to-completion` for the +observable terminal state. Derive the timeout from repository expectations, +user deadline, or an explicit service window. -On timeout, re-read the head SHA, checks, reviews, and comments once. Then -reroute to an authorized alternate reviewer, report the pending gate, or choose -a new evidence-based wait. Do not treat timeout as approval. +A timeout returns judgment. Reread the current head, checks, reviews, and +comments, then choose a named alternate route, a new evidence-based wait, or a +truthful pending-gate report. ## Completion -Report the current head SHA, checks, review gates, behavior gate, unresolved -findings, and merge authority. Merge only when explicitly authorized. If a -required gate is pending, leave the PR open and name the exact gate. +Report: + +- repository and PR identity; +- base, head branch, and current SHA; +- checks and exact results; +- independent review gates and the SHA each covered; +- behavior contract result when used; +- unresolved findings; +- public-mutation authority. + +Merge only when explicitly authorized and every required current-head gate is +satisfied. Otherwise leave the PR open and name the exact remaining gate or +owner. diff --git a/codex/skills/pr-review-loop/agents/openai.yaml b/codex/skills/pr-review-loop/agents/openai.yaml index 43bd5b09..498408b8 100644 --- a/codex/skills/pr-review-loop/agents/openai.yaml +++ b/codex/skills/pr-review-loop/agents/openai.yaml @@ -1,7 +1,7 @@ interface: display_name: "PR Review Loop" short_description: "Review and close out a PR" - default_prompt: "Use $pr-review-loop to iterate on this pull request with explicit PR identity, green neutral-critic review before @codex review for ariobarin repos, current-head checks, quiet acknowledged-review waits, merge-boundary discipline, and archive-after-merge closeout when requested." + default_prompt: "Use $pr-review-loop to preserve this pull request identity, bind every claim to the current head, choose proportionate independent gates, route findings to the implementation owner, and stop at the authorized mutation boundary." policy: allow_implicit_invocation: true diff --git a/codex/skills/pr-review-loop/references/review-loop-playbook.md b/codex/skills/pr-review-loop/references/review-loop-playbook.md index 85648224..5caa16be 100644 --- a/codex/skills/pr-review-loop/references/review-loop-playbook.md +++ b/codex/skills/pr-review-loop/references/review-loop-playbook.md @@ -1,103 +1,101 @@ # PR Review Loop Playbook -Use this reference for current-head review, confined reviewer context, -source-blind behavior proof, and stale PR decisions. +Use this reference when current-head review needs a confined patch, observable +behavior proof, structured waiting, or a decision about stale PR identity. ## Current-Head Discipline -Review evidence belongs to a head SHA. +Evidence belongs to a head SHA. -- Re-read the SHA after push, force-push, rebase, or retarget. -- Refresh checks and reviewers when their evidence targets an older head. -- Identify the tested build, ref, or artifact for behavior validation. -- Do not call a PR ready from stale approval or stale runtime proof. +- Reread the SHA after every push, rebase, force-push, or retarget. +- Refresh checks and reviewers whose proof targets an older head. +- Name the tested build, ref, or artifact for behavior validation. +- Inspect inline comments independently from top-level comments and review + bodies. +- Treat approval, test output, and runtime proof as stale when their target + identity changed materially. ## Confined Source-Aware Review Use `scripts/build-review-bundle.py` when a fresh reviewer should see the full -selected patch without the current conversation or arbitrary checkout files. +selected patch without parent conversation or arbitrary checkout files. -The bundle includes: +The bundle contains: -- the complete binary-capable patch; +- complete binary-capable patch; - base and head SHAs; - changed paths and hashes; -- an optional task file; -- only explicitly selected datasets. +- optional task file; +- explicitly selected context datasets. -It rejects dirty worktrees, empty or oversized patches, secret-like content, -escaping paths, symlinks, and existing output directories. A truncated diff is -not an equivalent fallback. +It accepts only a clean committed range and rejects escaping paths, symlinks, +secret-like content, existing output directories, empty patches, and oversized +bundles. A truncated diff is not an equivalent review surface. + +## Proportionate Review Selection + +Choose gates from the claim being made: + +- Every PR loop: one independent current-head reviewer. +- Repository or user policy: every additional named reviewer. +- Specialized risk: the relevant specialist reviewer. +- Material observable behavior not fully proven by ordinary tests: fresh + source-blind `behavior-validator` result. +- Narrow documentation, metadata, formatting, or deterministic generated output: + the independent review and exact mechanical check may be sufficient. + +Record why a gate applies. Neither habitual over-review nor convenient +under-review is evidence. ## Source-Blind Behavior Validation Capture the observable contract before implementation detail can redefine -success. Build the isolated workspace through `behavior-validator`, then launch -a fresh non-forked validator agent. +success. Build an isolated workspace through `behavior-validator` and launch a +fresh non-forked validator. -Give the validator only: +Provide only: - contract and approved fixtures; -- exact target identity and access instructions; -- approved credentials; +- exact target identity and access; +- approved credential route; - observable evidence surfaces. -Do not provide source, diffs, tests, history, review summaries, or a review -bundle. Contamination requires a fresh workspace and fresh run. - -Skip this gate only when there is no user-visible or operator-visible behavior -claim. +Implementation source, diffs, tests, history, review summaries, and source-aware +bundles remain outside the validator. Contamination requires a fresh workspace +and fresh run. ## Review Waiting -Review acknowledgement is not approval. Wait on the actual review state with one -bounded condition: +Review acknowledgement is not the terminal state. Wait on one observable +condition: - requested review submitted; - actionable comment added; -- check reaches terminal state; +- check reaches a terminal result; - head SHA changes and invalidates the wait. -Derive the timeout from a repository SLA, stated reviewer window, user deadline, -or explicit operational limit. Put polling inside one command. On timeout, -refresh the live PR once and choose an authorized alternate route or report the -pending gate. Never use a fixed interval as proof that a reviewer had enough -time. - -## Stale PR Rebuild - -Rebuild when the user wants current-main intent rather than preservation of the -old PR identity. - -- Inspect the old branch for source material. -- Start from current default branch. -- Reapply only still-relevant intent. -- Open a new PR when the result is no longer truthfully the same branch history. - -Preserve the named PR when the user asked to keep iterating it. - -## Gate Order +Put polling inside one bounded command. On timeout, refresh live state once and +choose an authorized alternate reviewer, a changed wait, or a pending-gate +report. -Unless the user requires parallel review: +## Stale PR Decision -1. run narrow checks; -2. complete `neutral-critic`; -3. resolve findings and verify the new head; -4. request the second reviewer; -5. run source-blind behavior validation when required; -6. report readiness at the merge boundary. +Preserve the named PR when the user wants its branch identity and history. -A pending gate stays pending. An authorized alternate route must be named. +Rebuild from the current default branch when the user wants current intent and +the old branch can no longer express that truthfully. Inspect the old branch as +source material, reapply only still-relevant intent, and open a replacement PR +under explicit authority. -## Output +## Output Evidence -Report: +Return: -- repository and PR; -- base, head branch, and current SHA; -- preserved or rebuilt identity; -- checks and their result; -- reviewer gates and head SHA each targeted; -- behavior contract result; +- PR and branch identity; +- current head SHA; +- preserved or rebuilt decision; +- checks and their target; +- reviewer gates and their target SHA; +- behavior proof and target identity; - unresolved findings; -- merge authority and current boundary. +- current public-mutation boundary. diff --git a/codex/skills/root-cause-not-symptom/SKILL.md b/codex/skills/root-cause-not-symptom/SKILL.md index 83d9acdb..155abf0c 100644 --- a/codex/skills/root-cause-not-symptom/SKILL.md +++ b/codex/skills/root-cause-not-symptom/SKILL.md @@ -1,78 +1,77 @@ --- name: root-cause-not-symptom -description: Force root-cause-first on bugs, errors, and failing tests. Use before any patch, suppress, swap, retry, or premature done call on a symptom. +description: Diagnose the mechanism and owning boundary before repairing bugs, errors, regressions, and failing tests. --- # Root Cause, Not Symptom -A symptom is what you see: an error, a failing test, a wrong value, a strange -output. The cause is the mechanism, one or more layers down, that produces it. -You fix causes. You do not patch symptoms. A bandage stops the bleeding for a -minute. The cut is still open. This skill exists to make you get the stitches. - -The posture is the point: name the cause before you touch code. If you cannot -state the mechanism in one sentence, you do not understand the bug yet, and -investigating is the correct next move, not editing. The discipline below is -firm because every item is a documented way agents ship a fix that does not -hold. It is orientation, not a cage. - -## Name The Cause Before The Fix - -Before you write, edit, delete, or swap a line, state in one sentence: - - The cause is X. The fix lives at Y. Because Z. - -- X is the mechanism, not the symptom. "The string double-quotes a JSON value, - so it is escaped on serialization" is a cause. "Quotes are escaped" is a - symptom. -- Y is the single site or boundary that owns the behavior, not the site that - displays it. If you cannot point to one site or boundary, the cause is not - understood yet. -- Z is why that site owns the behavior. - -If you cannot fill X, Y, and Z, stop and investigate. Patching a cause you -cannot name is the exact failure this skill prevents. - -## The Recurrence Rule - -If the same class of symptom returns after your fix, your fix was symptomatic. -Do not patch again. - -A returning symptom is a signal, not a todo. Reopen the cause statement, -assume your first cause was wrong, and look one layer deeper. One fix per -cause. A second fix for the same symptom is reason to re-examine the cause. - -## What This Rules Out - -These are the recurring shapes of the failure. Recognize them and refuse them. - -- fix-output-not-cause: editing the producing string or display layer to hide - a symptom while the data contract underneath is wrong. -- patch-and-pray: stacking a second guard on a guard that "did not fully work." - Layers mean you missed the cause. -- declare-done-on-disappearance: calling it fixed because the symptom vanished - in one run. Symptom gone is not cause fixed. Re-run from a clean state and - confirm the cause is gone. -- suppress-the-signal: catching, swallowing, filtering, or defaulting past the - error instead of removing its source. -- swap-instead-of-diagnose: rewriting the format or delivery shape, or swapping - a component, because the real fix is hard. Diagnose first; swap only if - diagnosis says swap. -- react-to-surface-signal: reshaping behavior around a heuristic you inferred - ("these look simple") instead of the stated requirement. Re-read the spec. - The spec beats your read of the surface. -- enshrine-as-policy: rewriting docs, evals, or READMEs to make a symptomatic - fix permanent instead of reverting it. - -## When To Stop And Surface - -- You have written more than one fix for the same symptom. Stop. -- The spec is ambiguous or self-contradictory. Ask; do not infer and proceed. -- Fixing the cause would delete or reshape behavior the user did not ask to - change. Confirm scope first. - -## Judgment Over Checklist - -The lists above are guardrails against known failures, not a replacement for -thinking. Keep the stance: causes first, symptoms second, and a returning -symptom is always a reason to go deeper, never a reason to patch again. +Repair the mechanism that produces the failure. This skill exists because a +visible error invites guards, retries, catches, rewrites, and suppressions that +make the symptom disappear while the broken ownership remains. + +The first deliverable is a causal model strong enough to locate the repair. + +## State The Causal Model + +Before production edits, state: + +> The observed symptom is S. The supported cause is X. The repair belongs at Y +> because Z. The evidence is E. + +`X` names the producing mechanism. `Y` names the narrowest ownership boundary +that can correct it. `Z` explains why that boundary owns the behavior. `E` +distinguishes observation from inference. + +Some failures have interacting or independent causes. Name the causal chain or +cause set when one site cannot truthfully explain the result. + +When the statement is not yet supportable, investigate. Trace inputs, state, +ownership, execution flow, and the earliest divergence from the required +contract. + +## Let Recurrence Reopen The Model + +A recurring symptom is new evidence. Reopen the causal model before adding +another layer. Determine whether: + +- the first cause was incomplete; +- another independent cause produces the same symptom; +- the repair landed outside the owning boundary; +- stale state or a different runtime path bypasses the repair; +- the verification never exercised the real failure path. + +A second patch begins with a changed explanation, not a larger pile of guards. + +## Repair The Owning Boundary + +Make the smallest coherent change that removes the supported cause while +preserving required behavior. Verification should reproduce the original path +from a clean state and show that the mechanism, not only the visible message, +changed. + +Crisp boundaries remain firm: + +- Error suppression is not a repair when the error source remains. +- A rewritten requirement is not evidence that a broken implementation became + correct. +- A component swap follows diagnosis; it does not substitute for diagnosis. + +## Subtractive Review + +After the repair works, inspect the changed and neighboring surface: + +- Which guard, wrapper, fallback, branch, state, or compatibility path became + obsolete? +- Did the patch introduce a second source of truth? +- Did an existing abstraction already own the behavior? +- Is the changed surface broader than the causal boundary requires? +- Can the same behavior remain with fewer maintained concepts or states? + +Line reduction is useful evidence, not the target. The target is a system with a +simpler truthful explanation. + +## Completion Evidence + +Report the symptom, causal model, evidence, owning boundary, repair, focused +checks, clean-state reproduction, removed obsolete machinery, and any remaining +unverified cause. diff --git a/codex/skills/root-cause-not-symptom/agents/openai.yaml b/codex/skills/root-cause-not-symptom/agents/openai.yaml index 3a1517dd..1dc05faa 100644 --- a/codex/skills/root-cause-not-symptom/agents/openai.yaml +++ b/codex/skills/root-cause-not-symptom/agents/openai.yaml @@ -1,7 +1,7 @@ interface: display_name: "Root Cause, Not Symptom" - short_description: "Fix causes, not symptoms" - default_prompt: "Use $root-cause-not-symptom to force root-cause-first on this bug: name the cause before any fix, and refuse to patch, suppress, swap, or declare done on a symptom." + short_description: "Repair the mechanism and simplify the boundary" + default_prompt: "Use $root-cause-not-symptom to establish the causal model and owning boundary before editing, then perform a subtractive review after the repair." policy: allow_implicit_invocation: true diff --git a/codex/skills/run-a-micro-experiment/SKILL.md b/codex/skills/run-a-micro-experiment/SKILL.md new file mode 100644 index 00000000..8dcac328 --- /dev/null +++ b/codex/skills/run-a-micro-experiment/SKILL.md @@ -0,0 +1,70 @@ +--- +name: run-a-micro-experiment +description: Answer one technical uncertainty with the smallest disposable program, preserve the finding, then reimplement deliberately. +--- + +# Run A Micro-Experiment + +Answer one uncertainty with the smallest disposable program that makes the +mechanism visible. This skill exists because prototypes easily grow into hidden +partial products whose copied code, accidental architecture, and broad context +contaminate the real implementation. + +The terminal result is a verified finding that changes a production decision. +The experiment itself remains disposable. + +## Define One Question + +State the uncertainty in a form the experiment can settle: + +> Given X, does Y produce Z under conditions C? + +Name: + +- the decision this result will change; +- the smallest observation that answers the question; +- what the experiment intentionally does not represent; +- the stopping condition. + +A vague goal such as "prototype the feature" is too broad. Reduce it until one +mechanism can be observed directly. + +## Build The Smallest Revealing Program + +Create only the code, input, dependency, and output needed to expose the +mechanism. Optimize for fast iteration and legibility of the result, not +production architecture. + +A micro-experiment lives outside production code and does not copy the whole +project. Mock or reduce surrounding systems when the question permits it. + +When the uncertainty genuinely depends on the real build, integration boundary, +performance profile, or repository behavior, use a clearly labeled disposable +integration-spike worktree instead. That is not a micro-experiment. + +## Observe And Record + +Run enough controlled cases to distinguish the proposed mechanism from plausible +alternatives. Record: + +- question; +- environment and relevant versions; +- tiny program or command; +- observed output; +- interpretation and uncertainty; +- production consequence; +- timestamp. + +Preserve the finding in a compact note or artifact when it will inform later +work. + +## Graduate The Finding + +Experimental code does not graduate into production. The finding graduates. +Return to the production repository, create or use the correct worktree, and +implement the learned behavior against real ownership, tests, style, and review +requirements. + +Delete or archive the experiment after the decision is captured. Promote a +reusable test fixture or tool only through an explicit review that justifies its +new durable purpose. diff --git a/codex/skills/run-a-micro-experiment/agents/openai.yaml b/codex/skills/run-a-micro-experiment/agents/openai.yaml new file mode 100644 index 00000000..182e91bd --- /dev/null +++ b/codex/skills/run-a-micro-experiment/agents/openai.yaml @@ -0,0 +1,7 @@ +interface: + display_name: "Run A Micro-Experiment" + short_description: "Answer one uncertainty with disposable code" + default_prompt: "Use $run-a-micro-experiment to reduce this uncertainty to one tiny disposable program, record the finding, and keep experimental code out of production." + +policy: + allow_implicit_invocation: true diff --git a/codex/skills/subagent-driven-development/SKILL.md b/codex/skills/subagent-driven-development/SKILL.md index a943630d..732c1afc 100644 --- a/codex/skills/subagent-driven-development/SKILL.md +++ b/codex/skills/subagent-driven-development/SKILL.md @@ -1,126 +1,95 @@ --- name: subagent-driven-development -description: Execute a real implementation plan through independent worker slices with shared-checkout safety and staged review. +description: Execute an approved implementation plan through bounded worker-owned slices, safe checkouts, and independent evidence gates. --- # Subagent-Driven Development -Use this skill when a real implementation plan exists and its tasks are -independent enough to hand off with local context and concrete checks. Do not use -it for exploration, tightly coupled work, branch triage, ordinary review, or a -one-shot manual change. - -## Posture - -This is a disciplined implementation pipeline, not permission to maximize -fan-out. Delegate only when a fresh execution owner gains clarity or reduces the -controller's working set. The controller holds the parent outcome and acceptance -criteria above execution. It is accountable for task boundaries, sequence, -review, integration, and completion, but should be reluctant to prove its value -by editing the worker's slice. - -The implementer owns the assigned artifact and carries ordinary setup, -debugging, testing, and recovery inside that boundary. Ordinary continuation is -implicit. A worker keeps the slice until it verifies its postcondition or reaches -a real exception; it does not return merely to ask whether it should keep -working. Completion and exception reports are evidence for routing, not -self-verifying runtime state. - -A slice is a route for advancing the parent outcome. It is not permission to -replace that outcome with the current implementation task. The parent outcome -and assertion text remain read-only unless the user explicitly amends them. - -## Task Shape - -A slice is ready for delegation when it has: - -- one coherent observable slice outcome or postcondition; -- the parent assertion IDs it is meant to advance; -- an integration target that explains how the artifact contributes to the - parent result; -- an owner who can work without constant shared reasoning; -- exact context and scope boundaries; -- a concrete validation target; -- limited collision with other active work. - -Do not split work merely because several agents are available. Keep coupled -changes with one owner. Do not derive a slice only from the latest symptom; -derive it from an unmet parent assertion and the current evidence about the gap. - -## Ownership Boundaries - -- The controller owns the stable parent outcome, required assertions, plan, task - boundaries, sequence, review gates, integration, and completion judgment. -- The implementer owns assigned edits, focused tests, narrow validation, and - ordinary recovery inside the slice. Route repairs back through the implementer - path instead of editing worker-owned artifacts. -- The implementer may adapt its local route, but it may not rewrite the parent - outcome or parent assertion text. -- Use a fresh implementer for an unrelated slice. -- Do not run multiple editing implementers against the same checkout. While a - child may edit shared files, keep controller work read-only and outside that - slice. Account for the child before the controller edits shared files. -- Do not start implementation on the default branch without explicit consent. - -## Required Handoffs - -Use these templates: - -- [implementer-prompt.md](implementer-prompt.md) -- [spec-reviewer-prompt.md](spec-reviewer-prompt.md) -- [code-quality-reviewer-prompt.md](code-quality-reviewer-prompt.md) - -Give the implementer the parent outcome as read-only context, parent assertion -IDs, observable slice outcome, integration target, full task text, absolute repo -path, exact files or artifacts, scope boundaries, validation target, and known -pitfalls. - -Require one return record only when the slice is complete or a real exception -prevents further safe useful work. The return kind describes why control is -being returned; it is not a repeated progress status: - -- `completed`: the slice postcondition is evidenced, the artifact exists, focused - checks ran, and self-review is done. Proceed to independent spec review; do not - accept the claim as proof or infer parent completion. -- `needs_input`: an exact fact, decision, permission, or context item blocks all - remaining safe work. Supply it or route it to the correct owner. -- `waiting_external`: a named process or event remains and no useful parallel - work is available. Assign a bounded monitor rather than spending model turns - waiting. -- `failed`: local recovery is exhausted or a safety boundary prevents further - execution. Diagnose the failed action, evidence, current state, smallest - reversible move, and next owner. - -Keep residual concerns in a separate field. Do not encode concern severity as a -different completion state. A negative search or test result belongs in evidence -and may still support completion, replanning, or a more precise input request. - -A progress update, timeout, or quiet child is not an automatic pause or takeover -signal. Collect partial evidence, account for shared-checkout ownership, and -restore a concrete next move. If the host forces a checkpoint, preserve the -parent assertion mapping, slice outcome, current route, and evidence, then -requeue the same owner unless the route changes. - -## Required Sequence - -1. Dispatch the implementer with the parent assertion mapping and slice - postcondition. -2. After implementation, run spec compliance review, then code quality review. -3. Send findings back through the implementer path and repeat the failed review - until clear. -4. Map accepted evidence to the parent assertions, update their status, and - recompute which assertions remain unmet before choosing another slice or - declaring completion. - -The two reviews are independent gates, not ceremony. Spec review compares the -artifact with the requested slice. Quality review tests whether the accepted -slice is well built. Do not replace either with implementer self-review or a -controller summary. - -## Completion - -Complete only when every required parent assertion is verified by current -evidence, every delegated slice used as proof has passed both reviews, -integration checks pass, and branch readiness or the next repair owner is named. -Completing the predefined task list is not sufficient if the parent outcome is -still unmet. +Use fresh implementers when an approved implementation plan contains slices that +can be owned and verified independently. This skill exists to reduce context and +increase focus without losing integration, scope, or review discipline. + +It is an implementation pipeline, not an alternate controller. The user-facing +principal keeps the parent goal, plan, control documents, assignment authorship, +and final completion judgment. + +## Delegate Only A Coherent Slice + +A slice is ready when it has: + +- one observable postcondition; +- the parent assertion IDs it advances; +- an integration target; +- authoritative anchors; +- exact scope and preservation boundaries; +- production and public mutation authority; +- a concrete evidence target; +- limited collision with other active work; +- a named return channel. + +The principal prepares and reviews the assignment before launch. Material slice +boundaries remain available for user review unless existing authority or an +explicit waiver covers them. + +Keep coupled changes with one owner. A fresh worker is useful when it gains a +cleaner context, not merely because another agent slot exists. + +## Preserve Checkout Ownership + +One editing owner operates in one checkout at a time. Use a dedicated worktree +for production-bound work when parallel activity or a dirty main checkout would +create collisions. + +The principal stays read-only against worker-owned files until the worker +returns or the assignment is explicitly held, cancelled, or reassigned. + +## Worker Ownership + +The implementer owns ordinary setup, repository reading, debugging, focused +tests, and local recovery inside the assignment. It continues while safe, +authorized work remains and returns only when: + +- the slice postcondition is verified; +- one exact decision or permission blocks all useful work; +- a named external event remains with no useful parallel work; +- recovery is exhausted or a safety boundary stops execution. + +The worker returns artifacts and evidence. It does not edit the parent goal, +catalog, ledger, checkpoint, or assignment after dispatch. + +Use [implementer-prompt.md](implementer-prompt.md) for the assignment handoff. + +## Independent Evidence Gates + +After implementation, test two different claims: + +1. **Specification:** the accepted artifact matches the assigned slice and adds + no unauthorized scope. +2. **Quality:** the accepted slice is correct, robust, tested, maintainable, + integrated, and no larger than its ownership boundary requires. + +Use separate reviewers for substantial or risky slices. A narrow low-risk slice +may use one combined independent review when the approved assignment says so. +Implementer self-review supports these gates and does not replace them. + +Route findings back to the implementation owner or a fresh explicitly assigned +repair worker. Re-run the failed evidence gate after material changes. + +Use [spec-reviewer-prompt.md](spec-reviewer-prompt.md) and +[code-quality-reviewer-prompt.md](code-quality-reviewer-prompt.md). + +## Return To The Principal + +The pipeline returns: + +- slice postcondition; +- artifact and exact changed files; +- checks and results; +- independent review results; +- evidence mapped to parent assertions; +- integration status; +- remaining concerns or repair owner. + +The principal reconciles this evidence against the complete parent goal. +Completing the planned slice list is not sufficient while a required parent +assertion remains unverified. diff --git a/codex/skills/subagent-driven-development/agents/openai.yaml b/codex/skills/subagent-driven-development/agents/openai.yaml index a971a6dc..103aacd0 100644 --- a/codex/skills/subagent-driven-development/agents/openai.yaml +++ b/codex/skills/subagent-driven-development/agents/openai.yaml @@ -1,6 +1,6 @@ interface: display_name: "Subagent-Driven Development" - short_description: "Execute independent plan slices safely" - default_prompt: "Use $subagent-driven-development to execute this plan through autonomous worker-owned slices, explicit completion or exception reports, one editing owner per checkout, and independent spec and quality gates." + short_description: "Execute approved implementation slices with fresh owners" + default_prompt: "Use $subagent-driven-development to turn this approved plan into reviewed worker-owned implementation slices, independent evidence gates, and a compact return to the principal." policy: allow_implicit_invocation: true diff --git a/codex/skills/subagent-driven-development/code-quality-reviewer-prompt.md b/codex/skills/subagent-driven-development/code-quality-reviewer-prompt.md index 7c9e529f..06153adc 100644 --- a/codex/skills/subagent-driven-development/code-quality-reviewer-prompt.md +++ b/codex/skills/subagent-driven-development/code-quality-reviewer-prompt.md @@ -1,32 +1,34 @@ -# Code Quality Reviewer Prompt Template +# Code Quality Reviewer Template ```text -Independently review implementation quality after spec compliance passed. +Independently review implementation quality after the accepted scope is known. -Spec compliance narrows the accepted scope. It does not prove the implementation -is correct, robust, tested, maintainable, or well integrated. +## Reviewed Assignment -## Requested Task - -[FULL TASK TEXT] +[FULL ASSIGNMENT] ## Evidence Locator -- Repo path: [ABSOLUTE_REPO_PATH] -- Diff: [BASE_SHA..HEAD_SHA, PR, patch, or exact changed files] -- Implementer summary: [SHORT SUMMARY] +- Repository or artifact root: [PATH] +- Diff or changed artifact: [LOCATOR] +- Implementer return: [SHORT RETURN] -Do not review until the repo path and diff locator are present. Inspect the code, -relevant tests, and nearby patterns yourself. Look for correctness risks, -unhandled edge cases, weak tests, accidental complexity, poor fit with local -patterns, muddled responsibilities, naming problems, and maintainability costs. +Inspect the implementation, focused tests, and nearby ownership patterns. +Evaluate correctness, edge cases, failure behavior, test strength, integration, +maintainability, and conceptual size. -Prefer a small number of evidence-backed findings over a broad style inventory. -Do not repeat spec findings unless they also create a quality risk. +Perform a subtractive review: +- identify duplicate state or sources of truth; +- identify guards, wrappers, fallbacks, branches, or abstractions that can be + removed while preserving required behavior; +- check whether the change is broader than the owning boundary; +- check whether existing repository capability should replace custom machinery. -Use the repo review format when one exists. Otherwise return: +Prefer a small number of evidence-backed findings. -- Strengths -- Issues: Critical | Important | Minor, with file:line evidence +Return: +- Strengths that matter to acceptance +- Issues: Critical | Important | Minor, with exact evidence +- Subtraction opportunities - Assessment ``` diff --git a/codex/skills/subagent-driven-development/implementer-prompt.md b/codex/skills/subagent-driven-development/implementer-prompt.md index 3b2c6be5..d532b77c 100644 --- a/codex/skills/subagent-driven-development/implementer-prompt.md +++ b/codex/skills/subagent-driven-development/implementer-prompt.md @@ -1,92 +1,60 @@ -# Implementer Prompt Template +# Implementer Assignment Template ```text -You are the execution owner for Task N: [task name] +You are the execution owner for assignment [ASSIGNMENT_ID]. -Success is an observable, validated slice outcome inside the assigned boundary. -A polished report is not a substitute for the artifact, and completing this -slice is not the same as completing the parent outcome. +Your result is the observable slice outcome inside the reviewed boundary. Return +artifacts and evidence through the named channel. The principal remains the +author of the parent goal and control documents. -## Parent Contract, Read-Only +## Parent Context, Read-Only -- Parent outcome: [FINISHED_STATE] -- Parent assertion IDs advanced by this slice: [ASSERTION_IDS] +- Parent goal and revision: [GOAL] +- Parent assertion IDs advanced: [ASSERTION_IDS] - Parent evidence standard: [EVIDENCE_STANDARD] -- Parent contract or acceptance-ledger path: [PATH_OR_NONE] - -Do not rewrite the parent outcome or assertion text. When evidence changes, -adapt the local route and report what it proves against the named assertions. +- Goal and control document paths: [PATHS] ## Slice Contract -- Slice outcome or postcondition: [OBSERVABLE_POSTCONDITION] -- Integration target: [HOW_THIS_ARTIFACT_ADVANCES_THE_PARENT] -- Full task text: [FULL_TASK_TEXT] - -## Context - -- Repo path: [ABSOLUTE_REPO_PATH] -- Exact files or artifacts: [PATHS] -- Scope boundaries: [BOUNDARIES] -- Validation target: [CHECKS] -- Live state surface and writer: [PATH_AND_WRITER_OR_NONE] -- Delegated edit authority: [EXACT_EDITS_OR_NONE] -- Known pitfalls: [PITFALLS] - -## Ownership And Continuation +- Slice outcome: [OBSERVABLE_POSTCONDITION] +- Integration target: [HOW_THIS_ADVANCES_THE_PARENT] +- Full task: [TASK] -Read repo guidance and inspect nearby files before editing. Resolve ordinary -path, setup, pattern, test, dependency, merge, and validation questions inside -the assigned slice. Carry local friction instead of returning it to the -controller in final-answer form. +## Authoritative Anchors -Keep working while useful, safe, authorized steps remain. A routine model turn -boundary, progress update, or controller silence does not suspend the assignment -or transfer ownership. Do not stop merely to ask whether to continue. +Read in this order: +1. [ANCHOR] +2. [ANCHOR] -A discovered prerequisite, repair, or changed implementation sequence updates -your local plan. It does not replace the slice postcondition or parent outcome. -After each material result, compare current evidence with the slice postcondition -and continue while it remains unmet. +## Scope And Authority -Ask for input only when an exact missing requirement, decision, permission, or -piece of context blocks all remaining safe work. Name the missing item, why it -blocks progress, and what you already tried. - -Use an external wait only when a named process or event remains and no useful -parallel work is available. Name its owner and the observable completion -condition. For a failure, exhaust reasonable local recovery first, then report -the failed action, evidence, current state, and smallest reversible next move. +- Repository or workspace: [ABSOLUTE_PATH] +- Owned files or artifacts: [PATHS] +- Allowed edits or actions: [AUTHORITY] +- Production mutation authority: [AUTHORITY] +- Public mutation authority: [NONE_OR_EXACT_ACTION] +- State to preserve: [BOUNDARIES] +- Validation target: [CHECKS] +- Return channel: [LOCATOR] -Implement exactly the requested slice. Keep edits scoped, add focused tests when -needed, run the narrowest useful checks, and self-review. Follow local patterns -unless the task explicitly requires a different shape. Commit only when the -controller explicitly asks or repo policy requires it. +Carry ordinary setup, repository reading, debugging, focused tests, and local +recovery inside this boundary. Keep working while safe, authorized actions can +advance the slice. -When the controller asks diagnostic questions, answer with evidence, ownership, -current state, unmet slice conditions, and the smallest reversible action. Keep -execution ownership unless the controller explicitly holds, cancels, or -reassigns the slice. +Return once when the postcondition is verified or a real exception prevents all +remaining safe useful work. ## Return Record -Return once when the slice postcondition is verified or a real exception -prevents further safe useful work. - -- Return kind: completed | needs_input | waiting_external | failed -- Slice outcome claimed -- Parent assertion IDs advanced -- What changed -- Files changed -- Checks run and results -- Evidence mapped to each named parent assertion -- Slice conditions still unmet, if any -- Self-review findings -- Remaining concerns, kept separate from completion -- Missing input or external dependency, when relevant -- Recovery tried and exact next action with owner - -A negative search or test result belongs under evidence. It is not a return kind -by itself. The controller decides whether the parent outcome is complete after -integrating this evidence with every other required assertion. +- Result: completed | needs decision | waiting external | failed +- Slice outcome claimed: +- Parent assertions advanced: +- Artifact or files changed: +- Checks and exact results: +- Evidence mapped to each parent assertion: +- Slice conditions still unmet: +- Recovery attempted: +- Exact missing decision, event, or boundary: +- Next action and owner: +- Residual concerns, separate from completion: ``` diff --git a/codex/skills/subagent-driven-development/spec-reviewer-prompt.md b/codex/skills/subagent-driven-development/spec-reviewer-prompt.md index 63bc41e8..1a7b1647 100644 --- a/codex/skills/subagent-driven-development/spec-reviewer-prompt.md +++ b/codex/skills/subagent-driven-development/spec-reviewer-prompt.md @@ -1,31 +1,25 @@ -# Spec Compliance Reviewer Prompt Template +# Specification Reviewer Template ```text -Independently review whether the implementation matches its specification. +Independently compare the implementation with the reviewed assignment. -Your job is comparison, not assistance. Do not help the implementation pass by -inferring intent, accepting a plausible summary, or overlooking extra work. +Your role is exact comparison. Read the artifact and evidence directly. The +implementer report is a locator, not proof. -## Requested Task +## Reviewed Assignment -[FULL TASK TEXT] - -## Implementer Report - -[IMPLEMENTER REPORT] +[FULL ASSIGNMENT] ## Evidence Locator -- Repo path: [ABSOLUTE_REPO_PATH] -- Diff: [BASE_SHA..HEAD_SHA, PR, patch, or exact changed files] +- Repository or artifact root: [PATH] +- Diff or changed artifact: [LOCATOR] +- Implementer return: [RETURN] -Do not review until the repo path and diff locator are present. Treat the report -as a locator, not evidence. Read changed files and compare them directly with the -task. Check for missing requirements, extra work, scope mistakes, behavior -mismatches, and unsupported claims. +Verify the slice outcome, every stated requirement, scope boundary, preserved +state, and absence of unauthorized extra work. Return one of: - -- [OK] Spec compliant -- [Issues] Specific missing or extra work with file:line evidence +- [OK] Specification compliant, with evidence inspected +- [Issues] Missing, mismatched, or extra work with exact location and consequence ``` diff --git a/codex/skills/using-codex-goals/SKILL.md b/codex/skills/using-codex-goals/SKILL.md deleted file mode 100644 index 97fbbfe2..00000000 --- a/codex/skills/using-codex-goals/SKILL.md +++ /dev/null @@ -1,91 +0,0 @@ ---- -name: using-codex-goals -description: Maintain durable outcomes, acceptance assertions, evidence, and live goal state across long-running work. ---- - -# Using Codex Goals - -Use this skill when work must survive turns, workers, compaction, or restarts -without losing what completion means. It owns outcome semantics and evidence -reconciliation. It does not own benchmark execution, process supervision, or -artifact recovery. - -## Keep Three Layers Distinct - -- **Parent outcome:** stable finished state, constraints, exclusions, and - amendment authority. -- **Acceptance ledger:** stable assertion text with current status and linked - evidence. -- **Execution state:** current owner, observed state, blockers, and next action. - -A failed command, discovered prerequisite, repair, phase, worker return, or -monitor timeout changes execution state. It does not rewrite the parent outcome. - -Read [goal-contracts.md](references/goal-contracts.md) when creating or repairing -a durable goal surface. - -## Start With Assertions - -Write the outcome as observable assertions. Each assertion needs: - -- a stable identifier; -- exact pass evidence; -- current status: unmet, in progress, verified, blocked, or removed by authorized - amendment; -- evidence locators; -- the owner of the next proof-producing action. - -Completion is a reconciliation operation. After material evidence arrives, -attach it to assertions, update status, recompute the unmet set, and route the -next action. A completed subtask is not completion while a required assertion -remains unverified. - -## Keep Live State Small - -The live surface should answer: - -- what finished state is still authoritative; -- which assertions remain unmet; -- who owns the current action; -- what evidence arrived; -- what action can reduce the remaining gap; -- what exact external event or decision is required, if any. - -Archive history elsewhere. Do not let a long diary become current authority. - -## Blocked Means No Safe Move Exists - -Mark the goal blocked only when current evidence names a specific external -dependency, authority boundary, or unavailable fact and no safe local action can -advance any unmet assertion. Repeated turns, failed attempts, uncertainty, or -controller silence are not blocker evidence. - -Before escalating, finish reversible local work, test alternative hypotheses, -prepare the exact decision, and name the event or owner that can unblock the -goal. Use waiting when an external event is expected and a bounded next check is -useful. - -## Ownership - -- The controller owns the parent outcome, assertion text, amendments, and final completion judgment. -- Execution owners produce artifacts and evidence for assigned slices. -- Reviewers and validators may change assertion status through evidence, but do - not silently rewrite the acceptance contract. -- `benchmark-run-operator` owns benchmark launch, provenance, valid-run rules, - and recovery. This skill consumes that evidence against the parent assertions. -- `monitor-to-completion` owns mechanical waiting, not goal completion. - -## Pause, Resume, And Handoff - -A pause stops owned work and monitors without claiming completion or blockage. -Record the current owner, active process state, unmet assertions, last evidence, -and first safe resume action. - -After compaction, restart, or handoff, reopen authoritative inputs in precedence order. Treat summaries and history as evidence, not authority. - -## Completion - -Complete only when every required assertion is verified by current evidence, or -when the authorized outcome owner explicitly amends the contract to accept an -incomplete endpoint. Record the amendment, remaining dependency, and responsible -owner. diff --git a/codex/skills/using-codex-goals/agents/openai.yaml b/codex/skills/using-codex-goals/agents/openai.yaml deleted file mode 100644 index 1f221ba2..00000000 --- a/codex/skills/using-codex-goals/agents/openai.yaml +++ /dev/null @@ -1,7 +0,0 @@ -interface: - display_name: "Using Codex Goals" - short_description: "Write durable Codex goal contracts" - default_prompt: "Use $using-codex-goals to draft or run a Codex goal with completion criteria, verification evidence, continuation rules, and bounded subagent slices." - -policy: - allow_implicit_invocation: true diff --git a/codex/skills/using-codex-goals/references/goal-contracts.md b/codex/skills/using-codex-goals/references/goal-contracts.md deleted file mode 100644 index 43ed72fb..00000000 --- a/codex/skills/using-codex-goals/references/goal-contracts.md +++ /dev/null @@ -1,210 +0,0 @@ -# Goal Contracts - -Use this reference when work needs a durable outcome and a small live control -surface. - -## Outcome Contract - -Write the stable layer first: - -```markdown -# Outcome - -## Finished State -Describe what exists when the work is done. - -## Required Assertions -- A1: Observable assertion. - - Pass evidence: - - Status: unmet - - Evidence: -- A2: Observable assertion. - - Pass evidence: - - Status: unmet - - Evidence: - -## Constraints -- Safety, scope, compatibility, budget, and authority limits. - -## Exclusions -- Work intentionally outside this outcome. - -## Amendment Authority -- Who may change finished state or assertion text. -``` - -Assertions should be independently checkable. Prefer product behavior, runtime -state, persisted artifacts, current-head checks, and attributable rows over -completion prose. - -## Live Execution State - -Keep mutable state compact and replace it rather than appending history: - -```markdown -# Live State - -Outcome revision: 3 -Control writer: controller -Execution owner: worker-7 -Observed state: -- ... - -Unmet assertions: -- A2 -- A4 - -Current action: -- ... - -Next proof: -- ... - -External wait or decision: -- none - -Last evidence: -- A1 verified by run:835 -``` - -The outcome revision changes only after an authorized amendment. Ordinary -progress changes observed state, assertion status, and next action. - -## Evidence Rules - -For each material result: - -1. identify which assertion it supports or falsifies; -2. record an exact locator; -3. distinguish direct observation from inference; -4. update status; -5. recompute the remaining assertion set; -6. route the smallest proof-producing action. - -Evidence locators can be a commit SHA, current-head check, test command, artifact -path, benchmark row set, screenshot, runtime query, or reviewer result. Do not -use "worker says done" as a locator. - -## Assignment Shape - -A delegated slice should include: - -```text -Parent outcome, read-only: -Parent assertions advanced: -Slice postcondition: -Allowed edits or actions: -Authoritative inputs: -Evidence required: -Return conditions: -``` - -The worker returns when the slice postcondition is verified or a real exception -exists. A turn boundary or progress update does not transfer ownership. - -## Exception Diagnosis - -A useful exception report answers: - -```text -Which parent assertion remains unmet? -What exact condition prevents the next safe action? -What did the last attempt prove? -What state exists now? -What changed since the prior attempt? -What smallest action could produce new evidence? -Who owns that action? -``` - -Do not route another identical attempt when failure signature, inputs, and -runtime path are unchanged and no new discriminating evidence exists. - -## Blocked And Waiting - -Use `blocked` only when: - -- a specific external dependency, missing authority, or unavailable fact is - named; -- no safe local action can advance any unmet assertion; -- reversible preparation and alternative hypotheses are exhausted; -- the unblocking owner or event is identified. - -Use `waiting` when an external event is expected and the next useful judgment -can be scheduled or triggered. Put mechanical polling inside one bounded command -rather than spending model turns. - -No fixed number of turns or attempts proves blockage. Evidence about available -actions does. - -## Human Decision Packet - -When authority is required, prepare: - -```markdown -## Decision -Exact question: - -## Why It Is Required -Assertion or constraint affected: - -## Options -1. Option with consequence. -2. Option with consequence. - -## Safe Work Already Completed -- ... - -## Recommendation -- ... -``` - -Do not ask the user to solve routine diagnosis. - -## Pause Packet - -```markdown -## Paused Goal -Outcome revision: -Execution owner: -Active processes stopped: -Monitors stopped: -Unmet assertions: -Last evidence: -First safe resume action: -External conditions to recheck: -``` - -Pause is not complete, blocked, or cancelled. - -## Completion Packet - -```markdown -## Completion -Outcome revision: -Verified assertions: -- A1: evidence locator -- A2: evidence locator - -Authorized amendments: -- none - -Residual concerns: -- ... - -Public mutations: -- authorized action and verification, or none -``` - -Residual concerns do not erase verified completion, but they must remain -separate from assertion status. - -## Benchmark Boundary - -For benchmark work: - -- this goal contract owns final assertions, evidence mapping, and completion; -- `benchmark-run-operator` owns launch contracts, worker and stack execution, - provenance, valid-row rules, recovery, and aggregate rebuilds; -- benchmark evidence returns here as attributable artifacts and row sets. - -Do not duplicate benchmark process doctrine in the goal surface. diff --git a/codex/skills/using-goals/SKILL.md b/codex/skills/using-goals/SKILL.md new file mode 100644 index 00000000..4bcb80dc --- /dev/null +++ b/codex/skills/using-goals/SKILL.md @@ -0,0 +1,100 @@ +--- +name: using-goals +description: Preserve stable outcomes, anchors, evidence, authority, and resumable control state across long-running work. +--- + +# Using Goals + +Use a goal when work must survive turns, compaction, restarts, or delegated +assignments without losing what completion means. This skill exists to keep the +finish line stable while plans, workers, failures, and next actions change. + +The principal authors the goal and control packet. Delegates return artifacts +and evidence. They do not rewrite the objective or maintain parallel ledgers. + +## Stable Goal + +A durable goal names: + +- a stable ID and revision; +- the finished state; +- independently observable assertions; +- exact pass evidence for each assertion; +- constraints and exclusions; +- authoritative anchors in precedence order; +- planning and implementation authority; +- public mutation authority; +- amendment authority. + +The goal remains stable until its named authority records an amendment. A failed +command, new prerequisite, implementation choice, worker return, review, +timeout, or discovered repair changes the route or observed state. It does not +change what finished means. + +Read [references/goal-contracts.md](references/goal-contracts.md) when creating or +repairing the control packet. + +## Principal-Authored Control + +Keep one logical author across finite contexts. The user-facing principal, or +the user directly, prepares and reviews goals, plans, catalogs, assignments, and +checkpoints. + +Delegation is lossy. Give each delegate a reviewed assignment with the smallest +complete set of anchors, scope, authority, evidence, and return conditions. The +delegate owns its assigned artifact and returns evidence through the named +channel. The principal verifies that evidence and updates current state. + +## Separate Stable Meaning From Current State + +Keep current state compact and replace it as evidence changes. It should answer: + +- which goal revision is authoritative; +- what observable state exists now; +- which assertions remain unmet; +- what work is active and where; +- what evidence arrived; +- what decision or next proof can reduce the gap; +- when the state was last verified. + +Historical narrative belongs in an archive. The current ledger is not a diary. + +## Preserve Planning Authority + +Record whether the objective is in planning or implementation. Planning may +include inspection, research, questions, plans, and explicitly scoped +experiments. Production mutation begins when the named authority opens that +phase. + +Material assignments should be reviewable before dispatch. User review may be +covered by previously granted authority or explicitly waived. + +## Reconcile Evidence + +After each material result: + +1. identify which assertion it supports or falsifies; +2. record an exact evidence locator and observation time; +3. distinguish direct observation from inference; +4. update current status; +5. recompute the remaining assertion set; +6. choose the smallest proof-producing next action. + +A completed task, phase, review, process, or wait is progress until the whole +required assertion set is verified. + +## Survive Context Change + +Before compaction, restart, pause, or deliberate handoff, write a checkpoint +that names the goal revision, anchors, observed state, accepted evidence, +remaining gap, active work, and next verification. + +A successor principal reopens authoritative anchors in order and verifies +changeable state before continuing. The fresh-context test passes when that +successor can resume correctly without private conversation history. + +## Completion + +Complete only when current evidence verifies every required assertion, or the +amendment authority explicitly records an accepted different endpoint. Keep +residual concerns separate from assertion status. diff --git a/codex/skills/using-goals/agents/openai.yaml b/codex/skills/using-goals/agents/openai.yaml new file mode 100644 index 00000000..f8b74312 --- /dev/null +++ b/codex/skills/using-goals/agents/openai.yaml @@ -0,0 +1,7 @@ +interface: + display_name: "Using Goals" + short_description: "Preserve stable outcomes across finite contexts" + default_prompt: "Use $using-goals to create or repair a principal-authored goal, current control state, assignment boundary, and resumable checkpoint for this long-running objective." + +policy: + allow_implicit_invocation: true diff --git a/codex/skills/using-goals/references/goal-contracts.md b/codex/skills/using-goals/references/goal-contracts.md new file mode 100644 index 00000000..d7dd84c9 --- /dev/null +++ b/codex/skills/using-goals/references/goal-contracts.md @@ -0,0 +1,164 @@ +# Goal Contracts + +Use this reference to create a compact principal-authored control packet for +long-running work. + +## Stable Goal + +```markdown +# Goal: + +Goal ID: +Revision: 1 +Created at: +Principal: +Amendment authority: + +## Finished State + + + +## Required Assertions + +- A1: + - Pass evidence: +- A2: + - Pass evidence: + +## Constraints + +- + +## Exclusions + +- + +## Authoritative Anchors + +1. +2. + +## Implementation Authority + +Phase: planning | implementation +Production edits authorized by: +Public mutations authorized: + +## Live State + +See `` and ``. +``` + +Assertions should be independently checkable. Prefer product behavior, runtime +state, persisted artifacts, current-head checks, and attributable result rows +over completion prose. + +## Current Catalog + +```markdown +# Work Catalog + +Goal: revision +Control author: +Updated at: +Last verified at: +Applies to commit or runtime identity: + +## Observed State + +... + +## Unmet Assertions + +- A2 + +## Active Work + +| ID | Assignment | Worker or process | Worktree or artifact root | State | Return channel | Last evidence | +| --- | --- | --- | --- | --- | --- | --- | + +## Current Decision + +... + +## Next Proof + +... +``` + +The principal updates this document from verified returns. A worker report is +an evidence locator, not automatic acceptance. + +## Assignment + +```text +Assignment ID: +Prepared by: +Review state: draft | approved | user-waived +Parent goal and assertion IDs: +Slice outcome: +Integration target: +Authoritative anchors, in order: +Allowed edits or actions: +Production mutation authority: +Public mutation authority: +State to preserve: +Evidence required: +Return channel: +Return conditions: +``` + +The assignment advances the goal and cannot amend it. + +## Checkpoint + +```text +Goal and revision: +Principal role: +Written at: +Last verified at: +Reason for checkpoint: +Anchors to reopen, in order: +Observed state: +Accepted evidence mapped to assertions: +Remaining gap: +Active delegates, processes, and worktrees: +Risks and decisions: +Next proof-producing action: +Successor verification: +``` + +Write the checkpoint before context loss, not after the successor discovers the +missing state. + +## Blocked, Waiting, And Decisions + +Use `blocked` when a named external dependency, missing authority, or unavailable +fact prevents every safe local action that could advance any unmet assertion. + +Use `waiting` when a named external event is expected and the next useful check +can be scheduled. Put pure polling inside one bounded command. + +When human authority is required, prepare the exact question, affected +assertion, options and consequences, safe work already completed, and a +recommendation. + +## Completion Packet + +```markdown +## Completion + +Goal revision: +Verified assertions: +- A1: +- A2: + +Authorized amendments: +- none + +Residual concerns: +- ... + +Public mutations: +- +``` diff --git a/codex/skills/workspace-steward/SKILL.md b/codex/skills/workspace-steward/SKILL.md index 90800806..436467e8 100644 --- a/codex/skills/workspace-steward/SKILL.md +++ b/codex/skills/workspace-steward/SKILL.md @@ -1,153 +1,132 @@ --- name: workspace-steward -description: Organize and audit local multi-repo workspaces with clean main checkouts, PR worktrees, experiments, local docs, artifacts, tmp space, and evidence rules. +description: Organize and audit agentic multi-repo workspaces, worktrees, control docs, experiments, evidence, scratch, and archives. --- # Workspace Steward -Use this skill to make a workspace easier to enter, operate, and review while -preserving active work and evidence. The first move is to make the requested -change earn its place. +Create a workspace that makes parallel agent work easy to enter, isolate, +resume, review, and retire. This skill exists because repositories, worktrees, +control documents, experiments, artifacts, and scratch acquire different +lifecycles, and a flat directory turns those differences into hidden risk. -An umbrella workspace coordinates multiple child repos and local operating -surfaces. It is not automatically a monorepo, and its root might not be the repo -that a command should operate on. +The requested organization must earn its maintenance. Preserve active work and +make the smallest layout change that removes real confusion, repeated cost, or +safety risk. -## Decision Filter +## Apply The Reduction Filter -Run this filter in order before changing layout, moving files, adding scripts, -or automating cleanup: +Before moving files or adding process: -1. Challenge the requirement. State the current confusion, repeated cost, or - safety risk the change is meant to fix. -2. Remove what does not earn maintenance. Delete proposed buckets, docs, scripts, - or conventions that do not solve that stated problem. -3. Simplify what remains. Prefer fewer paths, clearer names, and existing Git - or shell behavior over new process. -4. Speed up only after the shape is right. Add aliases, scripts, templates, or - manifests only when they shorten a proven workflow. -5. Automate last. Automate only stable, repeated operations with clear inputs, - outputs, rollback, and preservation boundaries. +1. Name the current confusion, repeated cost, or preservation risk. +2. Remove proposed buckets, docs, scripts, or automation that do not solve it. +3. Simplify names and paths around existing Git and shell behavior. +4. Accelerate a proven workflow only after its shape is clear. +5. Automate stable repeated operations with explicit inputs, outputs, rollback, + and preservation boundaries. -If a proposed folder, move, script, or automation fails an earlier filter, stop -and report the smaller change that survived. +A smaller note, ignore rule, catalog, or worktree convention may solve the +problem better than a new hierarchy. -When creating a new umbrella workspace from scratch, use -`references/project-template/` only after the decision filter leaves a full -skeleton as the smallest useful shape. Read -`references/project-template/README.md`, copy the template contents into the new -workspace root, and replace placeholders with real project and repo names. +## Separate Lifecycles -## Operating Model +An umbrella workspace coordinates child repositories and local operating state. +It is not automatically a monorepo. -Question the target layout before moving anything. Ask what problem the change -solves, who will use it next, and whether a smaller note, ignore rule, or -worktree convention would solve it. +Use visible, purpose-named areas when they match the work: -Keep top-level areas tied to one lifecycle: +- canonical repositories and clean default-branch checkouts at the root; +- `worktrees/prs/` for branch work intended to become reviewed repository + changes; +- `worktrees/spikes/` for disposable integration questions against the real + repository; +- `experiments/` for tiny disposable mechanism tests; +- `local-docs/` for principal-authored goals, plans, catalogs, assignments, + checkpoints, and handoffs; +- `docs/` for durable project or workspace documentation; +- `artifacts/` for generated evidence, reports, exports, logs, and manifests; +- `tmp/` for recreatable scratch; +- `archived/` for inactive material retained as reference. -- canonical repo checkouts stay visible at the root; -- clean main checkouts, usually `-main`, stay on the default branch for - reading, syncing, and creating worktrees; -- `worktrees/prs/` holds branch or PR work that is intended to be pushed; -- `experiments/` holds exploratory work that is not yet a repo, artifact, or - PR; -- `local-docs/` holds controller notes, plans, and handoffs; -- `docs/` holds durable project or workspace documentation; -- `artifacts/` holds generated evidence, reports, exports, logs, and manifests; -- `tmp/` holds scratch files that can be recreated or deleted; -- `archived/` holds inactive reference material. +Use names that reveal repository and workstream identity. Generic buckets such +as `src/` weaken an umbrella workspace unless the root is truly one repository. -Use names that reveal repo identity. Do not move active repos under generic -buckets such as `src/` unless the workspace is actually one repository with -internal packages and every path dependency has a migration plan. +## Worktrees Are Real Work -## Before Editing +Keep a clean default-branch checkout for reading, syncing, and creating +worktrees. Start production-bound work from the intended current remote base, +usually `origin/main`, after fetching and verifying state. -1. Read root `AGENTS.md`, root `README.md`, and the nearest docs index. -2. Identify the actual Git repo before branch, commit, push, or status work: +Use `git-branch-resolver` whenever branch identity, divergence, registration, +cleanup, or PR state needs interpretation. -```powershell -git rev-parse --show-toplevel -git status --short --branch -git remote -v -``` +Move registered worktrees with Git. Remove them after merge, preservation, or +explicit disposable evidence. A dirty worktree remains active work until its +contents are understood and preserved. -3. Classify each uncertain directory by evidence, not name: +## Experiments Are Disposable Learning -```powershell -git -C rev-parse --git-common-dir -git -C worktree list --porcelain -git -C status --short --branch -``` +A micro-experiment answers one uncertainty with tiny code that will never be +copied into production. Keep it independent of the project when the mechanism +can be isolated. Record the finding, then implement deliberately in a real +worktree. -4. Inspect dirty state and preserve useful work before moving or deleting files. -5. Draft the smallest target layout that solves the specific confusion. +Use `run-a-micro-experiment` for that contract. Use a disposable integration +spike worktree when the uncertainty requires the real repository. -## Worktree Rules +## Preserve Principal Control State -Keep the clean main checkout clean. Use it for reading, syncing, and creating -worktrees, not ordinary implementation edits. +Long-running goals, plans, catalogs, assignments, and checkpoints are authored +by the user-facing principal or the user. Delegated workers return evidence and +artifacts through named channels rather than maintaining independent control +files. -Start PR worktrees from `origin/main` by default, not from a dirty local main -checkout: +Keep current state compact. Timestamp operational documents with the fields that +answer freshness questions, such as: -```powershell -git -C fetch origin -git -C status --short --branch -git -C worktree add -b \worktrees\prs\ origin/main -``` +- created at; +- updated at; +- last verified at; +- next check at; +- applies to commit or runtime identity; +- archived at. -If local project guidance names a different default branch, use that branch -explicitly and explain the deviation. +Use absolute ISO 8601 timestamps with time zones. Source code and ordinary code +comments do not need historical timestamps. -Treat `worktrees/prs/` as pushed-work territory. If the work is exploratory or -local-only, use `experiments/`, `artifacts/`, or `local-docs/` instead. +## Promote Useful State -Move registered worktrees with `git worktree move`. Remove them with -`git worktree remove` only after merge, preservation, or explicit disposable -evidence. +Scratch must not become a hidden source of truth. Promote useful material to the +surface that owns its lifecycle: -Before cleanup, inspect registration: +- reproducible evidence to `artifacts/`; +- reusable tooling to a reviewed script or repository; +- durable project guidance to `docs/`; +- principal control state to `local-docs/`; +- production-bound edits to a branch and PR. -```powershell -git -C worktree list --porcelain -git -C worktree prune --dry-run --verbose -``` +Generated evidence should record source, owner, observed time, secret-scan state, +and regeneration instructions when those facts are not obvious. -Treat stale or prunable entries as report targets first. Run `git worktree -prune` only after confirming the path is gone and no work needs preservation. +## Copyable Workspace -## Evidence Rules - -Do not let `tmp/` become a hidden source of truth. Promote useful scratch work -to the right durable surface: +For a new umbrella workspace, use `references/project-template/` only when the +reduction filter leaves the full structure as the smallest useful shape. Read +its root README, glossary, runtime guidance, and lifecycle READMEs before +copying it. -- reproducible evidence or reports: `artifacts/`; -- reusable tooling: `scripts/`; -- project or workspace docs: `docs/`; -- controller notes or handoffs: `local-docs/`; -- branch-bound code changes: a repo branch or PR. +## Audit Result -When preserving generated evidence, add nearby notes with source, owner, date -range, retention, secret-scan status, and regeneration instructions when those -details are not obvious. +A workspace audit should make these answers immediate: -Keep secrets, credentials, browser state, local trust state, and machine-only -runtime caches ignored and local. +- Where is each canonical repository? +- Which checkout is clean default branch? +- Which worktrees are active production work? +- Which experiments are disposable and what question did each answer? +- Which control documents are current and when were they last verified? +- Which artifacts are accepted evidence and how were they produced? +- Which paths are safe to delete because they are recreatable scratch? +- Which inactive material should be archived or removed? -## Maintenance Pass - -When auditing an existing workspace, answer these questions in the final report -or the changed README: - -- Where is the canonical repo? -- Which checkout is clean main? -- Which worktrees are active PR work? -- Which artifacts are evidence, and how were they produced? -- Which notes are local controller state instead of product docs? -- Which files are safe to delete because they are recreatable scratch? - -Prefer one small ownership README or ignore rule over a broad cleanup. Cleanup -is done when the workspace is easier to operate, not when the root has the -fewest folders. +Cleanup is complete when the workspace is easier to operate and resume, not when +it has the fewest visible folders. diff --git a/codex/skills/workspace-steward/agents/openai.yaml b/codex/skills/workspace-steward/agents/openai.yaml index b4162ded..f94d450a 100644 --- a/codex/skills/workspace-steward/agents/openai.yaml +++ b/codex/skills/workspace-steward/agents/openai.yaml @@ -1,7 +1,7 @@ interface: display_name: "Workspace Steward" - short_description: "Organize multi-repo workspaces" - default_prompt: "Use $workspace-steward to organize or audit an umbrella workspace with clean main checkouts, PR worktrees, experiments, local docs, artifacts, tmp space, and cleanup boundaries." + short_description: "Organize parallel agent work by lifecycle" + default_prompt: "Use $workspace-steward to make this workspace easy to isolate, resume, review, and retire across repositories, worktrees, control docs, experiments, evidence, scratch, and archives." policy: allow_implicit_invocation: true diff --git a/codex/skills/workspace-steward/references/project-template/.gitignore b/codex/skills/workspace-steward/references/project-template/.gitignore index 10a26f68..69af45e5 100644 --- a/codex/skills/workspace-steward/references/project-template/.gitignore +++ b/codex/skills/workspace-steward/references/project-template/.gitignore @@ -1,16 +1,18 @@ -# Scratch - recreatable and deletable. Keep the directory, ignore its contents. +# Recreatable scratch. Keep the directory contract, ignore its contents. /tmp/* !/tmp/README.md -# Child-repo worktrees - linked through git, not tracked in this root repo. +# Child-repository worktrees are linked through Git, not tracked by this root. /worktrees/prs/* -!/worktrees/prs/.gitkeep +!/worktrees/prs/README.md +/worktrees/spikes/* +!/worktrees/spikes/README.md -# Canonical child repo checkouts - add concrete names before cloning. +# Canonical child checkouts. Add concrete names before cloning. # /example-repo/ # /example-repo-main/ -# Secrets and credentials - never commit. +# Secrets and credentials. .env .env.* !.env.example @@ -18,8 +20,9 @@ *.key *.p12 secrets/ +credentials/ -# Local runtime state - browser profiles, sessions, logs, and databases. +# Machine-only runtime state. /browser/ /browser-profile/ /cache/ @@ -39,7 +42,7 @@ secrets/ *.db-wal *.log -# Machine-only runtime caches and build state. +# Build and tool caches. **/__pycache__/ **/.venv/ **/node_modules/ diff --git a/codex/skills/workspace-steward/references/project-template/AGENTS.md b/codex/skills/workspace-steward/references/project-template/AGENTS.md index 972f306a..2ffd5e02 100644 --- a/codex/skills/workspace-steward/references/project-template/AGENTS.md +++ b/codex/skills/workspace-steward/references/project-template/AGENTS.md @@ -1,7 +1,7 @@ -# Agent Guidance for Workspace +# Codex Guidance for Workspace -This root is an umbrella workspace, not a single product repo. Identify the -actual git repo before any branch, commit, push, or status work: +This root coordinates several repositories and local operating surfaces. Identify +the actual Git repository before branch, commit, push, or status work. ```sh git rev-parse --show-toplevel @@ -9,18 +9,32 @@ git status --short --branch git remote -v ``` -Operating rules: - -- Canonical repo checkouts live at the root by name. A `-main` checkout - stays on the default branch and stays clean of implementation edits. -- PR work goes in `worktrees/prs/`, started from the child repo's - `origin/main`, not a dirty local main. -- `docs/` is durable documentation. `local-docs/` is controller operating state - for this workspace. -- `artifacts/` holds generated evidence with a provenance note. `tmp/` is - deletable scratch and is gitignored. -- Keep secrets, credentials, browser state, and machine-only caches ignored and - local. - -Read the root `README.md` for the full layout before moving files or adding -conventions. +## Direction + +Preserve one coherent objective across finite contexts. The user or user-facing +principal authors goals, plans, catalogs, assignments, and checkpoints under +`local-docs/`. Delegated workers execute reviewed assignments and return +artifacts plus evidence. They do not invent independent control state. + +Lead with the desired state and evidence. Use prohibitions for crisp safety, +authority, and lifecycle boundaries. + +## Workspace Boundaries + +- Keep `-main` checkouts on the declared default branch and free of + implementation edits. +- Put production-bound work in `worktrees/prs/` from the intended current + remote base. +- Put real-repository integration spikes in `worktrees/spikes/`. +- Put isolated one-question disposable programs in `experiments/`. +- Let findings graduate from experiments. Reimplement production behavior in a + real worktree. +- Keep durable product truth in `docs/` and principal operating state in + `local-docs/`. +- Keep generated evidence in `artifacts/` with provenance and timestamps. +- Treat `tmp/` as deletable. +- Preserve secrets, credentials, browser state, sessions, and machine caches + outside tracked files. + +Read the root README and the lifecycle README nearest the work before moving, +promoting, or deleting material. diff --git a/codex/skills/workspace-steward/references/project-template/CLAUDE.md b/codex/skills/workspace-steward/references/project-template/CLAUDE.md new file mode 100644 index 00000000..3ed409cb --- /dev/null +++ b/codex/skills/workspace-steward/references/project-template/CLAUDE.md @@ -0,0 +1,29 @@ +# Claude Code Guidance for Workspace + +This root coordinates several repositories and local operating surfaces. Resolve +the actual repository before using Git or changing product files. + +## Direction + +Preserve one coherent objective across finite contexts. The user or user-facing +principal authors goals, plans, catalogs, assignments, and checkpoints under +`local-docs/`. Delegated GLM-5.2 workers receive reviewed assignments and return +artifacts plus evidence. They do not create competing control documents. + +Point toward the desired result, evidence, and ownership boundary. Keep +procedures exact only where mechanics or authority are fragile. + +## Workspace Boundaries + +- Keep clean-main checkouts clean and current. +- Put production-bound changes in `worktrees/prs/`. +- Put disposable real-repository integration spikes in `worktrees/spikes/`. +- Put isolated micro-experiments in `experiments/`. +- Graduate findings, then implement deliberately in the production codebase. +- Keep durable project truth in `docs/` and current principal control state in + `local-docs/`. +- Preserve generated evidence in `artifacts/` and recreatable scratch in `tmp/`. +- Keep secrets and machine-only runtime state local and ignored. + +Read the root README and the nearest lifecycle README before reorganizing the +workspace. diff --git a/codex/skills/workspace-steward/references/project-template/README.md b/codex/skills/workspace-steward/references/project-template/README.md index e44009ca..671004f8 100644 --- a/codex/skills/workspace-steward/references/project-template/README.md +++ b/codex/skills/workspace-steward/references/project-template/README.md @@ -1,58 +1,78 @@ # Workspace -Umbrella workspace for . This root coordinates several child repos and -local operating surfaces. It is usually its own git repo, but it is not a -monorepo: canonical repo checkouts stay visible at the root by name. +Umbrella workspace for . This root coordinates child repositories, +production worktrees, disposable experiments, control documents, evidence, and +archives. It may be its own small Git repository, but it is not automatically a +monorepo. Canonical child checkouts stay visible at the root by name. + +## Operating Model + +One user-facing principal preserves the objective across contexts. The user or +principal authors goals, plans, catalogs, assignments, and checkpoints under +`local-docs/`. Delegates execute reviewed assignments and return artifacts plus +evidence. A fresh principal context resumes from those anchors rather than from +conversation memory. + +Use absolute timestamps with time zones in mutable control documents and +evidence notes. `Last verified at` matters more than a vague modification date. ## Layout -- `/` and `-main/` - canonical repo checkouts live at the root, - revealed by name, never tucked under `src/` or a generic bucket. A `-main` - checkout stays on the default branch for reading, syncing, and spawning - worktrees; keep it clean of implementation edits. -- `worktrees/prs/` - branch and PR work that is meant to be pushed. Start each - from the child repo's `origin/main`, not a dirty local main. -- `experiments/` - exploratory work that is not yet a repo, artifact, or PR. - Promote it out when it earns a place. -- `local-docs/` - controller notes, plans, and handoffs: state about operating - this workspace. -- `docs/` - durable project and workspace documentation. -- `artifacts/` - generated evidence: reports, exports, logs, manifests. -- `tmp/` - scratch files that can be recreated or deleted. -- `archived/` - inactive reference material, preserved as-is. - -Each directory above has its own README with the rules that keep it honest. - -## Adopt this template - -1. Copy the contents of this directory into your new project root. -2. If the root is not yet a git repo, `git init` it. The shipped `.gitignore` - keeps `tmp/` and child-repo worktrees out, and ignores secrets and caches. -3. Add each real root checkout name to `.gitignore`, such as - `/example-repo/` and `/example-repo-main/`, before cloning child repos. -4. Clone each child repo as a clean `-main` on the default branch, used - only for reading, syncing, and creating worktrees. -5. Start PR work in `worktrees/prs/` from the child repo's `origin/main`. -6. Replace this heading and the bracketed placeholders with the project name and - real repo identities. - -## Worktree convention - -Keep the clean main checkout clean. Create PR worktrees from the child repo: +- `-main/`: clean default-branch checkout for reading, syncing, and + creating worktrees. +- `/`: canonical checkout when the project needs one distinct from the + clean-main checkout. +- `worktrees/prs/`: production-bound branch and PR work. +- `worktrees/spikes/`: disposable integration spikes that require the real + repository but are not production-bound. +- `experiments/`: tiny isolated programs that answer one uncertainty and never + become production code. +- `local-docs/`: principal-authored goals, plans, catalogs, assignments, + checkpoints, and decisions. +- `docs/`: durable project and workspace documentation. +- `artifacts/`: generated evidence, reports, exports, logs, and manifests. +- `tmp/`: recreatable scratch. +- `archived/`: inactive material preserved with dated context. +- `glossary.md`: terms whose distinctions change behavior. + +Each lifecycle area has its own README. Read it before creating or promoting +material there. + +## Adopt This Template + +1. Copy the template contents into a new workspace root. +2. Replace `` and other placeholders with real names. +3. Initialize the root repository when it will own these control documents. +4. Add concrete child checkout names to `.gitignore` before cloning. +5. Clone each child as a clean `-main` checkout. +6. Record repository identities and default branches in the root documentation. +7. Create production work in `worktrees/prs/` from the intended current + remote base, usually `origin/main`. +8. Keep experiments and spikes visibly disposable. +9. Review `AGENTS.md`, `CLAUDE.md`, and `glossary.md` for project-specific truth. + +## Fresh Worktree Convention ```sh git -C -main fetch origin -git -C -main worktree add -b /worktrees/prs/ origin/main +git -C -main status --short --branch +git -C -main worktree add -b /worktrees/prs/ origin/main ``` -If local project guidance names a different default branch, use it explicitly -and note why. Move worktrees with `git worktree move`, and remove them with -`git worktree remove` only after merge, preservation, or explicit disposable -evidence. +Use the project-declared default branch when it differs. Move registered +worktrees with `git worktree move`. Remove them with `git worktree remove` only +after merge, preservation, or explicit disposable evidence. + +## Continuity Test + +A fresh principal context should be able to open the current goal, plan, +catalog, checkpoint, and named repository state, then answer: -## Operating notes +- What finished state remains authoritative? +- What phase is authorized? +- Which assignments are active? +- What evidence is current? +- What remains unresolved? +- What action can produce the next useful proof? -Read this README and `AGENTS.md` before changing layout. Treat `tmp/` as -deletable: promote useful scratch to `artifacts/`, `scripts/`, `docs/`, or -`local-docs/`. Add `scripts/` or `manifests/` only when a repeated operation -earns the maintenance. +When it cannot, repair the control documents before adding more work. diff --git a/codex/skills/workspace-steward/references/project-template/archived/README.md b/codex/skills/workspace-steward/references/project-template/archived/README.md index 6777f2d6..4b6da5af 100644 --- a/codex/skills/workspace-steward/references/project-template/archived/README.md +++ b/codex/skills/workspace-steward/references/project-template/archived/README.md @@ -1,13 +1,8 @@ # archived -Historical folders that should be preserved but are not active work targets. +Inactive material retained for reference. Archive only after current catalogs +and control documents point to the active replacement or record closure. -Rules: - -- Do not use archived folders as current runbooks or the current source of truth. -- Do not move active worktrees here. Active, review, preserved, and - delete-candidate worktrees belong under `../worktrees/`. -- Do not delete archived folders unless a later cleanup pass records explicit - owner approval and preservation evidence. -- Keep archive evidence intact. Prefer adding a dated note over editing old - chronology. +Preserve chronology. Add a dated archive note instead of rewriting historical +state. Active worktrees, current runbooks, and authoritative control documents +remain in their live lifecycle locations. diff --git a/codex/skills/workspace-steward/references/project-template/artifacts/README.md b/codex/skills/workspace-steward/references/project-template/artifacts/README.md index 05d2b74a..d4268cb8 100644 --- a/codex/skills/workspace-steward/references/project-template/artifacts/README.md +++ b/codex/skills/workspace-steward/references/project-template/artifacts/README.md @@ -1,11 +1,17 @@ # artifacts -Generated evidence: reports, exports, logs, run outputs, and manifests produced -by tools or runs. +Generated evidence and deliverables: reports, exports, logs, screenshots, +scoreboards, run outputs, manifests, and validation packets. -When you preserve evidence here, add a nearby note with source, owner, date -range, retention, secret-scan status, and how to regenerate it, unless those are -obvious. Prefer a dated folder name such as `benchmark-run-20260101/`. +Preserved evidence names: -Do not commit raw dumps or large binaries without a retention note. Pure scratch -that can be regenerated belongs in `../tmp/`, not here. +- source or producing command; +- owner or producer; +- observed date range and time zone; +- relevant commit, build, or target identity; +- secret-scan status; +- retention or archive decision; +- regeneration instructions when practical. + +Prefer dated, descriptive folders. Keep recreatable scratch in `../tmp/`. Keep +raw private or secret-bearing output outside tracked files. diff --git a/codex/skills/workspace-steward/references/project-template/docs/README.md b/codex/skills/workspace-steward/references/project-template/docs/README.md index b6f65161..3d38ff65 100644 --- a/codex/skills/workspace-steward/references/project-template/docs/README.md +++ b/codex/skills/workspace-steward/references/project-template/docs/README.md @@ -1,8 +1,8 @@ # docs -Durable project and workspace documentation that is meant to be read over time: -indexes, glossaries, standards, designs, and runbooks that describe how the -workspace operates. +Durable project and workspace truth: architecture, standards, glossaries, +decisions intended for broad reuse, and runbooks that remain authoritative over +time. -This is product and workspace truth, checked into git. Put controller operating -state, plans, and handoffs in `../local-docs/` instead. +Current principal operating state, assignments, and checkpoints belong in +`../local-docs/`. Generated evidence belongs in `../artifacts/`. diff --git a/codex/skills/workspace-steward/references/project-template/experiments/README.md b/codex/skills/workspace-steward/references/project-template/experiments/README.md index 793946fc..becb4277 100644 --- a/codex/skills/workspace-steward/references/project-template/experiments/README.md +++ b/codex/skills/workspace-steward/references/project-template/experiments/README.md @@ -1,9 +1,28 @@ # experiments -Exploratory work that is not yet a repo, an artifact, or a PR: spikes, drafts, -and prototypes whose home is not decided. +Use this directory for micro-experiments: the smallest disposable program that +answers one technical uncertainty without copying the production project. -Promote work out of here when it earns a place: a repo checkout at the root, a -PR worktree under `../worktrees/prs/`, evidence under `../artifacts/`, or a doc -under `../docs/`. Long-lived experiments are a signal that they should have been -promoted already. +Every experiment records: + +- question; +- decision the result will change; +- smallest revealing program or command; +- environment and relevant versions; +- observed output; +- interpretation and remaining uncertainty; +- production consequence; +- created and observed timestamps with time zones; +- disposition: delete or archive. + +Optimize for fast learning and visible mechanism, not production architecture. +The experiment does not become a partial product, shadow implementation, or +source of copied production code. + +Experimental code does not graduate. The finding graduates. Implement the +learned behavior deliberately in a production worktree with the real ownership, +style, tests, and review requirements. + +When the question requires the real repository, build, integration boundary, or +performance profile, use a disposable integration-spike worktree under +`../worktrees/spikes/` instead. diff --git a/codex/skills/workspace-steward/references/project-template/experiments/TEMPLATE.md b/codex/skills/workspace-steward/references/project-template/experiments/TEMPLATE.md new file mode 100644 index 00000000..0fc9c210 --- /dev/null +++ b/codex/skills/workspace-steward/references/project-template/experiments/TEMPLATE.md @@ -0,0 +1,36 @@ +# Micro-Experiment: + +Created at: +Observed at: +Owner: +Disposition: active | delete | archive + +## Question + + + +## Decision This Changes + + + +## Smallest Revealing Test + + + +## Environment + +- + +## Observation + + + +## Finding + + + +## Production Consequence + + + +Experimental code does not graduate. The finding graduates. diff --git a/codex/skills/workspace-steward/references/project-template/glossary.md b/codex/skills/workspace-steward/references/project-template/glossary.md new file mode 100644 index 00000000..26a585dc --- /dev/null +++ b/codex/skills/workspace-steward/references/project-template/glossary.md @@ -0,0 +1,54 @@ +# Workspace Glossary + +Use these terms consistently because confusing them changes ownership and +lifecycle behavior. + +## Principal + +The user-facing logical owner of the objective. A new model context may resume +this role after reading and verifying the current anchors. + +## Goal + +The stable finished state, evidence standard, constraints, exclusions, and +amendment authority. It does not narrate current progress. + +## Plan + +The current reviewed route toward the goal. Evidence may change the plan without +silently changing the goal. + +## Catalog + +The principal-authored index of active assignments, repositories, worktrees, +experiments, evidence, decisions, and checkpoints. + +## Assignment + +A reviewed delegate packet containing one bounded result, context, authority, +validation target, and return evidence. + +## Checkpoint + +A principal-authored resume point written before compaction, interruption, or +handoff. It points to current anchors and observable state. + +## Worktree + +A real repository checkout attached to a branch. A PR worktree may produce +production code. A spike worktree is explicitly disposable. + +## Micro-Experiment + +A tiny isolated program that answers one uncertainty. Its finding may graduate. +Its code does not. + +## Artifact + +A generated output retained as evidence or a deliverable, with provenance and +retention context. + +## Evidence + +A current observation or artifact that supports or falsifies a claim. A worker's +summary is a locator for verification, not proof by itself. diff --git a/codex/skills/workspace-steward/references/project-template/local-docs/README.md b/codex/skills/workspace-steward/references/project-template/local-docs/README.md index 58552530..4d2c714e 100644 --- a/codex/skills/workspace-steward/references/project-template/local-docs/README.md +++ b/codex/skills/workspace-steward/references/project-template/local-docs/README.md @@ -1,10 +1,22 @@ # local-docs -Controller operating state for this workspace: plans, handoffs, maintenance -notes, and other context about running the workspace day to day. - -This complements `../docs/`, which holds durable product and workspace -documentation. Use `local-docs/` for notes that are about operating this -workspace, and `docs/` for material meant to be read over time as product truth. -If a note should stay on one machine only, keep it ignored locally rather than -abandoning the directory convention. +Principal-authored operating state for this workspace. These documents preserve +one intention across context limits, compaction, delegation, interruption, and +replacement workers. + +- `goals/`: stable finished states and evidence standards. +- `plans/`: current reviewed routes and implementation authority. +- `catalogs/`: indexes of active work, locations, assignments, and evidence. +- `assignments/`: reviewed delegate packets. +- `checkpoints/`: compact resume points written before handoff or compaction. +- `decisions/`: material decisions and their authority. + +Use absolute timestamps with time zones. Name authoritative inputs in precedence +order. Replace current state rather than appending an endless diary. Archive +superseded documents with a clear replacement locator. + +Delegates return artifacts and evidence to the principal. They do not each +maintain a private ledger or redefine these documents. + +Durable project and workspace truth belongs in `../docs/`. Generated evidence +belongs in `../artifacts/`. diff --git a/codex/skills/workspace-steward/references/project-template/local-docs/assignments/README.md b/codex/skills/workspace-steward/references/project-template/local-docs/assignments/README.md new file mode 100644 index 00000000..86c93e51 --- /dev/null +++ b/codex/skills/workspace-steward/references/project-template/local-docs/assignments/README.md @@ -0,0 +1,15 @@ +# assignments + +Assignments are reviewed packets authored by the principal before delegation. +Each packet names: + +- parent goal and assertions advanced; +- bounded desired result; +- authoritative context and exact paths; +- allowed edits or actions; +- validation target; +- return evidence and real exception conditions; +- controller return channel when available. + +A delegate owns the assigned artifact, not the parent objective or control +documents. diff --git a/codex/skills/workspace-steward/references/project-template/local-docs/assignments/TEMPLATE.md b/codex/skills/workspace-steward/references/project-template/local-docs/assignments/TEMPLATE.md new file mode 100644 index 00000000..21c63f02 --- /dev/null +++ b/codex/skills/workspace-steward/references/project-template/local-docs/assignments/TEMPLATE.md @@ -0,0 +1,38 @@ +# Assignment: + +Assignment ID: +Prepared by: +Prepared at: +Review state: draft | approved | user-waived +Parent goal and assertions: +Return channel: + +## Slice Outcome + + + +## Integration Target + + + +## Authoritative Anchors + +1. +2. + +## Scope And Authority + +- Owned artifact or investigation: +- Allowed edits or actions: +- Production mutation authority: +- Public mutation authority: +- State to preserve: + +## Evidence Required + +- + +## Return Conditions + +Return when the slice outcome is verified or one exact decision, authority +boundary, external event, or exhausted recovery path prevents further safe work. diff --git a/codex/skills/workspace-steward/references/project-template/local-docs/catalogs/README.md b/codex/skills/workspace-steward/references/project-template/local-docs/catalogs/README.md new file mode 100644 index 00000000..6ae5705c --- /dev/null +++ b/codex/skills/workspace-steward/references/project-template/local-docs/catalogs/README.md @@ -0,0 +1,7 @@ +# catalogs + +A catalog is the current index of active repositories, worktrees, assignments, +experiments, monitors, evidence artifacts, decisions, and checkpoints. + +Keep locators and current status concise. Point to source documents instead of +copying them. Include `Last verified at` so a fresh context can judge freshness. diff --git a/codex/skills/workspace-steward/references/project-template/local-docs/catalogs/TEMPLATE.md b/codex/skills/workspace-steward/references/project-template/local-docs/catalogs/TEMPLATE.md new file mode 100644 index 00000000..fa0da24d --- /dev/null +++ b/codex/skills/workspace-steward/references/project-template/local-docs/catalogs/TEMPLATE.md @@ -0,0 +1,28 @@ +# Work Catalog + +Goal: revision +Control author: +Updated at: +Last verified at: +Applies to commit or runtime identity: + +## Current State + + + +## Remaining Gap + +- + +## Active Work + +| ID | Role | Assignment | Worker or process | Worktree or artifact root | State | Return channel | Last evidence | +| --- | --- | --- | --- | --- | --- | --- | --- | + +## Current Decisions + +- + +## Next Proof + + diff --git a/codex/skills/workspace-steward/references/project-template/local-docs/checkpoints/README.md b/codex/skills/workspace-steward/references/project-template/local-docs/checkpoints/README.md new file mode 100644 index 00000000..bbcbcce2 --- /dev/null +++ b/codex/skills/workspace-steward/references/project-template/local-docs/checkpoints/README.md @@ -0,0 +1,11 @@ +# checkpoints + +Write a checkpoint before compaction, restart, interruption, or principal-context +replacement. + +A checkpoint names the goal revision, current phase, authoritative inputs, +observed state, evidence locators, active assignments, still-unmet conditions, +next principal judgment, and exact re-anchor action. + +A fresh context must verify current repository and runtime state rather than +trusting the checkpoint blindly. diff --git a/codex/skills/workspace-steward/references/project-template/local-docs/checkpoints/TEMPLATE.md b/codex/skills/workspace-steward/references/project-template/local-docs/checkpoints/TEMPLATE.md new file mode 100644 index 00000000..f65495ab --- /dev/null +++ b/codex/skills/workspace-steward/references/project-template/local-docs/checkpoints/TEMPLATE.md @@ -0,0 +1,42 @@ +# Checkpoint + +Goal: revision +Principal role: +Written at: +Last verified at: +Reason: compaction | restart | handoff | pause | milestone + +## Reopen First + +1. +2. +3. +4. + +## Observed State + + + +## Accepted Evidence + +- : + +## Remaining Gap + +- + +## Active Work + +- + +## Risks And Decisions + +- + +## Next Proof-Producing Action + + + +## Successor Verification + +- diff --git a/codex/skills/workspace-steward/references/project-template/local-docs/decisions/README.md b/codex/skills/workspace-steward/references/project-template/local-docs/decisions/README.md new file mode 100644 index 00000000..0ab887ae --- /dev/null +++ b/codex/skills/workspace-steward/references/project-template/local-docs/decisions/README.md @@ -0,0 +1,8 @@ +# decisions + +Record choices that materially change outcome, scope, interface, authority, +risk, or lifecycle. Include the question, options considered, decision, owner, +evidence, timestamp, and affected goal or plan revision. + +Routine implementation choices stay with the assigned worker and do not need a +permanent decision record. diff --git a/codex/skills/workspace-steward/references/project-template/local-docs/decisions/TEMPLATE.md b/codex/skills/workspace-steward/references/project-template/local-docs/decisions/TEMPLATE.md new file mode 100644 index 00000000..2cea7767 --- /dev/null +++ b/codex/skills/workspace-steward/references/project-template/local-docs/decisions/TEMPLATE.md @@ -0,0 +1,28 @@ +# Decision: + +Decision ID: +Prepared at: +Decided at: +Owner: +Affected goal or plan: + +## Question + + + +## Options + +1.