Просмотр исходного кода

governance: define final convergence operating rules

Codex Resource Selftest 4 месяцев назад
Родитель
Сommit
bb31d234a5

+ 3 - 2
.codex/agents/cpld_engineer.toml

@@ -3,7 +3,8 @@ description = "Scoped CPLD implementation engineer constrained to Root-owned pat
 sandbox_mode = "workspace-write"
 developer_instructions = """
 Implement only the task and owned paths assigned by Root.
-Do not modify files outside the assigned ownership boundary, stage or commit unless Root explicitly assigns that action, or access COM/JTAG, TD, or hardware.
-Respect the active phase contract; Phase 0 changes are coordination-only and must not touch product RTL, project configuration, protocol, pins, TD, or product contracts.
+Do not modify files outside the assigned ownership boundary, stage or commit, or access COM/JTAG or physical hardware.
+Use the active Prod2U door-temperature contract and generated source closure. Do not restore legacy protocol or product behavior.
+Run builds and static checks only with an explicit assigned cwd and external work root when applicable. Root owns TD execution and integration commits.
 Return changed paths, validation commands, and unresolved risks without fabricating evidence.
 """

+ 2 - 2
.codex/agents/cpld_explorer.toml

@@ -2,8 +2,8 @@ name = "cpld_explorer"
 description = "Read-only CPLD code, constraint, log, and evidence explorer."
 sandbox_mode = "read-only"
 developer_instructions = """
-Trace the real code paths, constraints, logs, and hardware evidence requested by Root.
+Trace the real code paths, constraints, logs, manifests, receipts, and offline evidence requested by Root.
 Return concise file, symbol, and conclusion references.
 Do not edit files, stage, commit, access hardware, launch external Codex tools, or invent unobserved evidence.
-Follow Root-assigned read-only scope and report uncertainty explicitly.
+Follow Root-assigned read-only scope, report uncertainty explicitly, and treat blocked/not_run as non-pass.
 """

+ 1 - 1
.codex/agents/cpld_reviewer.toml

@@ -4,6 +4,6 @@ sandbox_mode = "read-only"
 developer_instructions = """
 Review independently and report concrete correctness, ownership, compatibility, security, and evidence findings.
 Do not edit files, stage, commit, access hardware, launch external Codex tools, or complete implementation on behalf of an author.
-Check the active phase contract and distinguish observed facts from inference.
+Check the active Prod2U contract and distinguish observed facts from inference.
 Return findings with file and symbol references plus residual risks.
 """

+ 2 - 2
.codex/agents/cpld_test_engineer.toml

@@ -2,8 +2,8 @@ name = "cpld_test_engineer"
 description = "Scoped test and evidence engineer for CPLD coordination contracts."
 sandbox_mode = "workspace-write"
 developer_instructions = """
-Modify only tests, formal wrappers, test manifests, and receipt-validation logic assigned by Root.
-Never modify production RTL, project configuration, protocol, pins, TD, or product contracts.
+Modify only tests, formal wrappers, cocotb, fixtures, test manifests, and test receipt-validation logic assigned by Root.
+Never modify production RTL, project configuration, protocol, pins, generator, or production tools. Report production-tool findings to Root for cpld_engineer.
 Use focused deterministic tests with negative cases and preserve fail-closed evidence semantics.
 Return changed paths, exact test commands, and any blocked validation layers.
 """

+ 58 - 37
AGENTS.md

@@ -1,37 +1,58 @@
-# Prod2U CPLD Operating Rules
-
-This repository is the active `dev` branch for the Prod2U multi-project UART refactor.
-
-## Authority
-
-- `projects/<project_id>/project.json` is the only machine configuration source.
-- `projects/prod2u-door-temp/requirements.zh-CN.md` records the project requirements.
-- `docs/prod2u-door-temp-protocol.zh-CN.md` records the host-facing frame contract.
-- Generated files and the active ADC are derived outputs; do not hand-edit them independently.
-- Phase 1 covers the door-temperature project contract only. Production RTL, TD/top, hardware, and RTL/TD behavior tests remain outside this worktree ownership; Python contract tests are in scope.
-
-## Coordination
-
-- Root builds a dependency graph before delegation and only runs independent, clearly bounded work in parallel.
-- Normal concurrency is 2-4 agents; 6 is the hard upper bound.
-- Tasks marked `[DYNAMIC-NATIVE-MA]` use the current client's native coordination tools.
-- Root owns interface freezes, integration, conflict resolution, and final candidate selection.
-- Each temporary worktree or owned path has one coordinator-assigned owner.
-- Test agents do not modify production RTL. The coordinator does not modify tests owned by the test engineer.
-- The Harness must not start Codex, call model APIs, or create agent threads.
-
-## Phase boundaries
-
-- Phase 0 must not implement product functionality or modify RTL, project configuration, protocol, pins, TD, or product contracts.
-- Phase 0 established coordination, Git isolation, ownership validation, and minimal evidence.
-- Phase 1 freezes the 25 MHz / 115200 8N1 contract, project mappings, schema, generator, protocol reference model, generated artifacts, and active ADC.
-- Phase 2 owns production RTL, simulations, TD scripts, bitstreams, and broader verification.
-- Phase 1 must review every nested `AGENTS.md` and replace rules that conflict with the accepted product contract; this run audited them and kept non-conflicting rules unchanged.
-- Physical hardware access, programming, drivers, global PATH changes, and external model services are prohibited.
-
-## Safety and evidence
-
-- Keep source, offline simulation, formal, TD, package, and physical-hardware evidence separate.
-- Blocked, dry-run, fixture, and partial evidence is not a pass.
-- Preserve unrelated dirty changes and ignored generated evidence.
-- Every run uses one 32-character lowercase hexadecimal `run_id`.
+# Prod2U CPLD Final Convergence Rules
+
+This checkout implements the Prod2U door-temperature controller. The active product
+contract is defined by `projects/prod2u-door-temp/project.json`,
+`projects/prod2u-door-temp/requirements.zh-CN.md`, and
+`docs/prod2u-door-temp-protocol.zh-CN.md`. Generated contracts, constraints, source
+manifests, tests, TD inputs, and packages must derive from that contract.
+
+## Coordination and ownership
+
+- Root builds the dependency graph, freezes interfaces, assigns exclusive paths,
+  integrates changes, stages, commits, and selects the final candidate.
+- Agents may edit only their assigned paths. No agent stages or commits in a shared
+  worktree. A path has one owner at a time; overlapping assignments are rejected.
+- `cpld_engineer` owns assigned production RTL, generator, build/package/receipt
+  implementation, and production `tools/*.py` paths.
+- `cpld_test_engineer` owns assigned `tests/**`, formal wrappers, cocotb, fixtures,
+  and test receipt logic. A test finding in production tools is reported to Root and
+  fixed by `cpld_engineer`.
+- Reviewers and explorers are read-only and must verify tracked paths before and
+  after their task.
+- The Harness runs ordinary commands with explicit `cwd`; it never starts Codex,
+  calls model APIs, or creates agent threads.
+
+## Execution and model policy
+
+- `MODEL_POLICY=unconstrained`.
+- `REASONING_EFFORT_POLICY=unconstrained`.
+- `MODEL_OR_EFFORT_IS_ACCEPTANCE_GATE=false`.
+- Observed model, effort, or selection source may be `not_exposed`; none is an
+  acceptance gate.
+- Protected repositories and dirty developer worktrees are read-only. All writes,
+  builds, receipts, TD roots, candidate worktrees, and packages use an explicitly
+  assigned isolated worktree or external root.
+
+## Product and evidence boundaries
+
+- UART is 25 MHz, 115200 8N1, 217 clocks/bit, with A5 5A framing and CRC-16/
+  CCITT-FALSE. Supported types are SET_ALL, GET_TEMPERATURE, and TEMPERATURE_DATA.
+- SET_ALL is 14 bytes: 8 PTC values, 4 FAN values, and X/Y motor commands.
+- PTC/FAN mapping, ADC order, motor, watchdog, PWM, and temperature behavior come
+  only from the project contract. Do not restore legacy protocol or hardware
+  behavior. Host rejects duty values above 100; RTL behavior for 0x65..0xFF is
+  unspecified.
+- Distinguish source, simulation, formal, TD, package, and physical-hardware
+  evidence. `fail`, `blocked`, `not_run`, placeholder, and exploratory evidence are
+  never pass evidence.
+- Receipts bind the run ID, exact full commit, project hash, source-manifest hash,
+  command, tool version, status, and applicable bitstream hash.
+
+## Protected operations
+
+- Never access COM or JTAG, program hardware, install drivers, modify global PATH,
+  or create ChatGPT Adviser artifacts.
+- Never use reset, clean, stash, restore, destructive checkout, silent overwrite,
+  automatic merge, or branch movement on a protected developer repository.
+- Hardware validation is separate from offline verification and remains `not_run`
+  unless explicitly authorized in a future task.