diff --git a/AGENTS.md b/AGENTS.md
new file mode 100644
index 0000000..d120ee5
--- /dev/null
+++ b/AGENTS.md
@@ -0,0 +1,20 @@
+# 仓库维护入口
+
+本仓库发布双语下游工作流模板、canonical `workflow-docs-sync` Skill 和安装器。
+
+- `zh/` 是中文语义源;`en/` 是从中文派生的模板与说明。
+- 根 `.github/` 是本仓库 CI 与 GitHub 基础设施;`zh/.github/`、`en/.github/` 是下游模板源。
+- 修改模板:先改 `zh/` 对应九份核心文件,再同步 `en/`。
+- 修改 Skill:进入 `zh/skills/workflow-docs-sync/`。
+- 修改安装器:进入 `zh/scripts/install_skills.py`。
+- 修改入口说明:更新根 README、`zh/README.md` 与 `en/README.md`;详细工作流在
+ `zh/docs/development_workflow/`,实现决策在其 `decisions.md`。
+- 修改测试:进入 `tests/test_workflow_docs_sync.py`;具体约束以测试代码为准,不在此复制。
+
+最短验证入口:
+
+```bash
+python3 -m pytest -q
+```
+
+完整维护地图与补充验证见 [zh/README.md](zh/README.md#维护者地图)。
diff --git a/README.md b/README.md
index ca71862..4b149d8 100644
--- a/README.md
+++ b/README.md
@@ -2,35 +2,20 @@
[中文](zh/README.md) | English
-This repository publishes bilingual workflow-document templates and the
-`workflow-docs-sync` Skill that specializes them against a real target repository.
+This repository publishes bilingual downstream workflow-document templates, the canonical
+`workflow-docs-sync` Skill, and its installer. Chinese under `zh/` is the semantic source; `en/` is derived.
-## Quick Start
-
-Invoke the Skill once. Provide only the target repository, optional language
-(`zh` or `en`), and whether to create a draft PR after successful validation.
+Invoke the Skill once with only the target Git repository, `zh` or `en`, and whether a draft PR should be
+created after success:
```text
Use $workflow-docs-sync for /absolute/path/to/repository in English.
Do not create a draft PR.
```
-The main agent is the only workspace writer. Four domain analyses and the
-adversarial audit are read-only; the final checker validates repository state,
-not execution history. Upstream checkout and commit resolution are internal.
-
-## Directory Map
-
-- [en/](en/): English templates and workflow documentation.
-- [zh/](zh/): Chinese source templates, prompts, decisions, and Skill implementation.
-- [zh/skills/workflow-docs-sync/](zh/skills/workflow-docs-sync/): single-session orchestration, read-only analysis references, and the deterministic checker.
-- [tests/test_workflow_docs_sync.py](tests/test_workflow_docs_sync.py): sync and installer regression tests.
-
-## Install Path Rule
-
-The `zh/` and `en/` directories are upstream source prefixes. The Skill strips
-only the selected leading language directory and installs the remaining paths at
-the target repository root. Inner paths such as `.github/` remain unchanged.
+The repository root contains CI and GitHub infrastructure. Downstream `.github/` templates live under the
+language directories and are installed without that leading language prefix.
-Chinese remains the source-of-truth workflow. English is its derived language
-path; unfinished English coverage must be identified explicitly as `en-pending`.
+For source ownership, edit locations, and validation commands, use the
+[Chinese maintainer map](zh/README.md#维护者地图). English template and directory guidance is available in
+[en/README.md](en/README.md).
diff --git a/en/.github/pull_request_template.md b/en/.github/pull_request_template.md
index cc8edd8..836d62b 100644
--- a/en/.github/pull_request_template.md
+++ b/en/.github/pull_request_template.md
@@ -1,114 +1,50 @@
## 1. Background and Goal
----
+
-## 2. Implementation
+## 2. Implementation and Tradeoffs
-
-
----
-
-## 3. Change Scope
-
-
+
-| File / Directory | Change Type | Notes |
-|---|---|---|
-| | Added / Modified / Deleted | |
+## 3. Actual Change Scope
----
+
## 4. Documentation Impact
-
-
-Affected documents:
-
-- None
-
-Notes:
-
--
-
----
-
-## 5. User and Architecture Impact
-
-User-visible change:
-
-- Yes / No
-- Notes:
-
-Architecture change:
-
-- Yes / No
-- Notes:
-
----
-
-## 6. Review / Fix Record
-
-
+
-| Round | Source | Issue Summary | Judgment | Result | Evidence |
-|---|---|---|---|---|---|
-| R0 | Initial submission | N/A | N/A | Initial implementation | |
-| R1 | Codex / Claude / Human | | Real / Invalid / Defer | Fixed / Won't fix / N/A | |
+## 5. User-visible and Architecture Impact
----
+
-## 7. Known Limits and Rollback
+## 6. Testing Evidence
-Known limits:
+- Exact command: Record the command verbatim, or write `Not run`.
+- Scope: State the layer, entrypoint, and boundary the command actually proves.
+- Result: Record pass, failure, skip, and important counts or errors.
+- Not-run reason: Write `Not applicable` when run; otherwise give the concrete reason and risk.
+- Environment: Record the actual execution environment, isolation method, side effects, and cleanup result.
--
+## 7. Review / Fix Record
-Rollback:
+
--
+## 8. Known Limits, Open Decisions, and Rollback
----
+
-## 8. Final Self-Check
+## 9. Final Self-check
-- [ ] Current branch is not the main branch.
-- [ ] Ran `git diff --name-only ...HEAD`.
-- [ ] Change Scope matches the actual diff.
-- [ ] PR body contains no stale drafts, old branch names, or unimplemented plans.
-- [ ] Testing and test evidence follow `TESTING.md`.
-- [ ] User-visible changes were checked against `interact.md`.
-- [ ] Architecture changes were checked against `architecture.md`.
-- [ ] Every review / fix round is recorded in "Review / Fix Record".
+- [ ] Actual Change Scope matches the real diff.
+- [ ] Test commands, scope, results, and not-run reasons are accurate.
+- [ ] User-visible and architecture impact were checked against their authoritative documents.
+- [ ] BLOCKERs and actionable WARNs are closed; open decisions are not presented as complete.
+- [ ] The PR body contains no historical draft, unimplemented plan, wrong base/head, or repository-local
+ temporary body path.
diff --git a/en/AGENTS.md b/en/AGENTS.md
index 0fae0b8..0c8a03a 100644
--- a/en/AGENTS.md
+++ b/en/AGENTS.md
@@ -1,72 +1,95 @@
-## File Overview
+# Agent Working Guide
-### Core Config
+## Authority Map
-- `AGENTS.md`: Agent entrypoint, file overview, coding rules, and user-facing document relationships.
-- `capability_contract.json`: Cross-project sample registry for capability boundaries, responsibility boundaries, and agent behavior commitments.
-- `.github/pull_request_template.md`: Long-term PR body template used to draft local `PR_BODY.md`.
+- Current code, configuration, tests, committed artifacts, and reproducible results are project facts.
+- `architecture.md` defines system structure and boundaries; `TESTING.md` defines test entrypoints and
+ evidence levels; `PR_Checklist.md` defines delivery checks; `SOP.md` keeps only stable process entrypoints.
+- `capability_contract.json` defines capability boundaries, `interact.md` defines user-visible behavior and
+ acceptance, and `docs/business_user_guide.md` only derives explanations from the first two.
+- Existing documents are claims to verify against implementation; they cannot prove themselves correct.
-### Core Modules
+
-### Business Logic
+## Repository Overview
-### Notes
+Describe stable modules, entrypoints, and responsibilities. Do not permanently mirror `git ls-files`.
-- When files are added or changed, update this file overview where relevant. Test files are governed by `TESTING.md`.
-- All repository files use UTF-8. Command-line reads and edits must explicitly use UTF-8.
-- One-off artifact folders are exempt from this overview when explicitly approved.
+### Core Configuration
-## Architecture
+
+
+### Runtime Entrypoints
-The authoritative architecture document is `architecture.md`. If a change affects module boundaries, runtime call flow, data flow, state model, error model, external dependencies, or extension points, update `architecture.md`; otherwise explain the no-update reason in the PR body.
+
-## Business Knowledge
+### Core Modules
-## Review Checklist
+
-When the user asks you to submit a PR, fully follow `PR_Checklist.md`; any exemption must be explained in the PR description.
+### Domain Logic
-## Testing Flow
+
-Before fixing bugs, starting tests, or submitting a PR, read and follow `TESTING.md`. Main branch changes must go through PR merge only.
+### Generated Artifacts and External State
-## SOP
+
+
+## Change Impact Rules
-When you execute a standard process, read and follow `SOP.md`; when SOP entries are added or changed, update this list with the SOP name.
+- Update or confirm `architecture.md` when module boundaries, runtime call flow, data flow, state, error
+ model, external dependencies, or extension points change.
+- For capability changes, update or confirm `capability_contract.json` first, then inspect `interact.md`
+ and the business guide. For user-visible behavior changes, update or confirm `interact.md` first.
+- Tests remain factual evidence; keep exact commands, fixtures, layers, and isolation details in
+ `TESTING.md` only.
+- Not every change requires every document to change. Give a current, evidence-based no-update reason for
+ each affected candidate document left unchanged.
+- Derive encoding, lint, formatter, build, and type rules from real repository configuration, not this
+ template.
-## User-Facing Document Relationships
+## Collaboration
-This project distinguishes three user-facing sources of truth:
+- The primary executor owns final judgments, deliverables, and writes; delegated results must be reviewed
+ and synthesized before use.
+- Assign non-overlapping path ownership before parallel writes; follow the target project's policy for the
+ isolation method.
+- Divide work dynamically by module, call flow, risk, or evidence type; do not require a fixed agent count
+ or schedule.
+- Agreement, voting, or consensus is not evidence. Important conclusions must trace to repository facts and
+ reproducible validation.
+- Investigation and review tasks are read-only by default; when changes are needed, hand them off explicitly
+ to an executor who owns the affected paths.
-1. `capability_contract.json`
- - Machine-readable source for capability boundaries.
- - Answers what the system can do, cannot do, must ask about, or must refuse.
+
-2. `interact.md`
- - Source for user-visible behavior and acceptance invariants.
- - Answers how the system must behave and what acceptance means.
+## Architecture
+
+Treat `architecture.md` as the architecture authority. Rebuild affected call paths from real entrypoints
+before a change, then verify invariants, module responsibilities, data contracts, state, side effects, and
+failure paths afterward.
+
+## Testing
+
+Read `TESTING.md` completely before testing and derive exact commands from repository configuration. Do not
+present light, mock, golden, or local repair success as a higher validation level. Choose the execution
+environment from command side effects, CI capabilities, and project policy, with isolation and cleanup
+verified before execution.
+
+## SOP
-3. `docs/business_user_guide.md`
- - Derived teaching document for first-time business users.
- - Answers what business users can ask, how to ask, how to read results, and when to ask a human.
- - It must not declare independent capabilities; it only explains capabilities and behavior already declared in `capability_contract.json` and `interact.md`.
+Read the corresponding `SOP.md` entry for a standard process. Keep execution checklists in the current
+session; do not create repository run state, receipts, or temporary process documents.
-Update rules:
+## PR Delivery
-- If capability boundaries change, update or confirm `capability_contract.json` first, then check `interact.md` and `docs/business_user_guide.md`.
-- If user-visible behavior changes, update or confirm `interact.md` first, then check `docs/business_user_guide.md`.
-- If business-user questions, prompts, result interpretation, or escalation guidance change, check `docs/business_user_guide.md`.
-- Any "can do / cannot do / must ask / must refuse" statement in `docs/business_user_guide.md` must anchor to `capability_contract.json`, `interact.md`, or tests.
+- Follow `PR_Checklist.md` and `.github/pull_request_template.md`; write delivery facts from the actual Git
+ diff, test output, and final repository state.
+- Resolve the default branch from the repository instead of hardcoding it. Follow target-project policy for
+ PR body draft location and publishing; never commit temporary drafts accidentally, and keep the body
+ consistent with the real diff and test evidence.
+- Do not commit, push, or create a PR unless the user explicitly requests it.
-## Coding Rules
+## Project-specific Conventions
-1. What I cannot create, I do not understand.
-2. Use the project's selected working language; answer in English unless user or project instructions require otherwise. Code volume is a liability after functionality is met; keep code as small as possible, then optimize for maintainability.
-3. Follow PEP 8 for Python. Use UTC time. Use UTF-8 text.
-4. Manage parameters centrally. Always call functions with explicit parameter names instead of relying on positional defaults. Do not use `get` for expected parameters; fail fast when a required parameter is missing.
-5. Every class and function needs a docstring. Each functional block inside a function needs comments explaining why, expected output, and parameter meaning, range, and format. Script-level docstrings must explain purpose and call relationships.
-6. Do not let `try/except` or `if/else` blocks run naked. Use explicit exception types and enough print/log information in `except` and `else` branches. Unexpected errors should fail inside the current function.
-7. Data in, data out: scripts, functions, and modules interact only through explicit data inputs and outputs, not hidden external state.
-8. Reused code blocks should be wrapped into functions or modules to keep code DRY.
-9. Use language features to reduce code and performance cost while keeping readability.
-10. Do everything necessary to help the user reach the goal.
+
diff --git a/en/PR_Checklist.md b/en/PR_Checklist.md
index 76618bd..1a5e0e8 100644
--- a/en/PR_Checklist.md
+++ b/en/PR_Checklist.md
@@ -1,52 +1,55 @@
# PR Submission Checklist
-## Commit / Push Strategy
-
-This project defaults to "one PR, one commit + PR body records review and fix rounds."
-
-Goals:
-
-- Keep public PR history easy to review.
-- Avoid making reviewers or LLMs reason from commit timeline noise.
-- Use the PR body's Review / Fix Record as the durable review history.
-
-Rules:
-
-1. One PR should normally keep one commit.
-2. After every review / fix round, update the PR body's Review / Fix Record first.
-3. Merge fixes into the current commit with `git commit --amend`.
-4. Push rewritten PR branches with `git push --force-with-lease`; never use bare `git push --force`.
-5. Use `.github/pull_request_template.md` as the PR body template.
-6. `.github/pull_request_template.md` is a long-term template file; do not submit it directly as the PR body.
-7. `PR_BODY.md` is a local temporary PR body draft generated from the template. It is not committed and is important review input.
-
-## Capability Contract and User Documentation Sync
-
-- [ ] If this PR changes `capability_contract.json`, check whether `interact.md` and `docs/business_user_guide.md` need matching updates. If not, explain why in the PR body.
-- [ ] If this PR changes "can do / cannot do / must ask / must refuse" claims in `interact.md` or `docs/business_user_guide.md`, confirm those claims anchor to `capability_contract.json`, `interact.md`, or tests.
-- [ ] If this PR adds agent behavior commitments such as "must ask", "must refuse", "must not guess", or "must degrade", register a stable `anchor_id` in `capability_contract.json` and add test evidence or an explicit untestable reason.
-- [ ] If this PR changes what business users can ask, how they ask, how they read results, or when they ask a human, check `docs/business_user_guide.md`.
-
-## PR Submission Steps
-
-Convert this checklist into a step-by-step todo list before submitting a PR.
-
-Use this fixed flow to avoid submitting the long-term template as the PR body:
-
-```bash
-cp .github/pull_request_template.md PR_BODY.md
-# Fill PR_BODY.md
-gh pr create --title "
" --body-file PR_BODY.md --head --base master
-```
-
-Before submitting:
-
-- [ ] Write a structured summary with background / goal, implementation, and change scope.
-- [ ] Confirm the current branch is not the main branch.
-- [ ] Inspect local changes with git diff and confirm no intended file is missing.
-- [ ] Use `git diff --name-only ...HEAD` to verify the PR body's change scope.
-- [ ] Use `TESTING.md` as the testing authority: decide whether tests need changes, which tests to run, and how to record evidence.
-- [ ] If tests were added or changed, update the test file overview or relevant testing notes in `TESTING.md`.
-- [ ] If files were added or changed, update the matching document overview where required.
-- [ ] If user-visible behavior changed, update `interact.md` and ensure acceptance evidence covers it.
-- [ ] Before the final commit, compare `git diff --name-only ...HEAD`, `git status`, and `PR_BODY.md` to ensure the PR body contains no stale drafts, local-only changes, or unimplemented plans.
+This file is the pre-submission todo. Check only items proven by the current diff, test output, or repository
+state; record a reason when an item does not apply. Do not commit, push, or create a PR unless the user
+explicitly requests it.
+
+
+
+## Scope and Git State
+
+- [ ] Resolve `` from the repository default branch and confirm the current and target branches.
+- [ ] Inspect `git status`, working-tree diff, staged diff, and `git diff --name-only ...HEAD`.
+- [ ] Ensure actual scope matches delivery notes and excludes local drafts, secrets, generated debris, and
+ unimplemented plans.
+- [ ] Treat a one-commit policy as a replaceable team default when the project uses one; otherwise follow
+ current repository policy. Rewriting remote history requires explicit authority and lease protection.
+
+## Tests and Evidence
+
+- [ ] Select real commands from `TESTING.md` and current repository configuration; do not infer a runner or
+ service from a template.
+- [ ] For each test, record exact command, scope, result, not-run reason, actual environment, and isolation
+ method.
+- [ ] Ensure environment choice follows command side effects, CI capabilities, and project policy, with
+ verifiable records for writes, external state, residue, and cleanup.
+- [ ] Describe failures, skips, and validation level accurately; do not present light, golden, or repair
+ evidence as full validation.
+
+## Documentation and Contracts
+
+- [ ] Check `AGENTS.md`, `architecture.md`, `capability_contract.json`, `interact.md`, the business guide,
+ `TESTING.md`, and `SOP.md` according to actual impact. Give a real no-update reason for affected candidates
+ left unchanged; do not edit every document merely for completeness.
+- [ ] Keep the authority direction `capability_contract.json → interact.md → business_user_guide.md` for
+ capability changes. User-visible claims have current implementation or test evidence and stable anchors.
+- [ ] Check architecture impact across entrypoints, module boundaries, data flow, state, error models,
+ external dependencies, artifacts, and side effects.
+- [ ] Replace or delete every active project-fill marker while preserving valid Markdown and JSON.
+
+## Review Closure
+
+- [ ] Complete the review gate required by this project's test and delivery policy, and accurately record
+ reviewer identity, scope, and limitations.
+- [ ] Fix every BLOCKER and actionable WARN that does not require a new product decision. Keep remaining
+ issues in open decisions with evidence and impact.
+- [ ] Rerun affected tests and mechanical checks after fixes, then recheck the final diff and Git state.
+
+## PR Delivery
+
+- [ ] Write only completed facts in the PR body and use `.github/pull_request_template.md` for structure.
+- [ ] Follow target-project policy for the PR body draft location, publishing tool, and commit treatment;
+ never commit a temporary draft accidentally, and keep the body consistent with the real diff and test
+ evidence.
+- [ ] Use `` or the repository default branch instead of hardcoding a branch name.
+- [ ] Create a draft PR only when requested, and reconfirm title, base, head, body, and actual diff first.
diff --git a/en/README.md b/en/README.md
index a8dce5d..3828ab2 100644
--- a/en/README.md
+++ b/en/README.md
@@ -2,45 +2,75 @@
[中文](../zh/README.md) | English
-This directory contains the English workflow-document templates. The canonical
-single-session Skill is shared from `zh/skills/workflow-docs-sync/` and reads the
-selected English templates from the pinned upstream commit.
+This directory provides English templates derived from the Chinese semantic source. The templates are
+language-, framework-, and project-neutral. The canonical `workflow-docs-sync` Skill remains under
+`zh/skills/workflow-docs-sync/` and reads English templates from the pinned upstream commit.
## Quick Start
-Invoke the Skill once and provide only the target repository, optional language,
-and optional draft-PR intent:
+Invoke the Skill once with the target Git repository, `zh` or `en`, and whether to create a draft PR after
+success:
```text
-Use $workflow-docs-sync for `/absolute/path/to/repository` in English.
+Use $workflow-docs-sync for /absolute/path/to/repository in English.
Do not create a draft PR.
```
-The main agent is the only target-workspace writer. Architecture, capability and
-user behavior, testing, governance, and adversarial audit analysis are read-only.
+The Skill pins target HEAD and upstream SHA, reconstructs facts from current code, configuration, tests,
+committed artifacts, reproducible results, and necessary Git history, then makes only the document changes
+those facts require. Existing documents and upstream templates are hypotheses, not evidence.
+
+Architecture, Capability / User Behavior, Testing, and Governance are coverage dimensions, not a fixed
+agent topology. The main agent is the only target-workspace writer. Test environments follow actual
+commands, side effects, CI capabilities, and project policy.
+
+Review prefers a fresh-context, blind-first independent reviewer. When cognitive isolation is unavailable,
+the result is reported honestly as self-review. The deterministic checker proves final repository state
+only, not investigation, test, or review history.
+
+## Template Contract
+
+Markdown project-fill slots use ``; JSON uses strings prefixed with
+`__PROJECT_FILL__:`. Target projects replace or delete every active marker before final `check`. Templates
+at a pinned source object retain at least one active marker in every non-PR file; the PR template is exempt.
+Templates do not assume a programming language, framework, test runner, service, or default branch.
+
+## Maintainer Map
+
+- Downstream templates: edit the nine core files under `zh/` as the Chinese semantic source, then derive the
+ matching `en/` paths.
+- Canonical Skill: `../zh/skills/workflow-docs-sync/`.
+- Installer: `../zh/scripts/install_skills.py`.
+- README entrypoints: the root README is a summary, `../zh/README.md` is the Chinese maintainer entry, and
+ this file is derived from it.
+- Development workflow and decisions: `../zh/docs/development_workflow/`; the English overview is under
+ `docs/development_workflow/README.md`.
+- Scenario tests: `../tests/test_workflow_docs_sync.py`; test code owns the detailed constraints.
+- GitHub paths: root `.github/` serves this repository, while `.github/` here and under `zh/` are downstream
+ template sources.
+
+The shortest entrypoint is `python3 -m pytest -q`. Full closure commands are maintained in the
+[Chinese maintainer map](../zh/README.md#维护者地图).
## Directory Map
-- [AGENTS.md](AGENTS.md): agent entrypoint, rules, and document relationships.
-- [architecture.md](architecture.md): architecture and system-boundary template.
-- [capability_contract.json](capability_contract.json): machine-readable capability contract.
-- [interact.md](interact.md): user-visible behavior and acceptance template.
-- [TESTING.md](TESTING.md): testing strategy and evidence template.
-- [PR_Checklist.md](PR_Checklist.md): general PR submission template.
-- [SOP.md](SOP.md): standard-process entrypoint template.
-- [.github/pull_request_template.md](.github/pull_request_template.md): downstream PR body template.
-- [docs/business_user_guide.md](docs/business_user_guide.md): business-user teaching template.
+- [AGENTS.md](AGENTS.md): authority entrypoint, stable module map, and impact rules.
+- [architecture.md](architecture.md): system purpose, call flows, boundaries, state, and side effects.
+- [capability_contract.json](capability_contract.json): capability, boundary, responsibility, and behavior
+ anchors.
+- [interact.md](interact.md): user-visible behavior and acceptance.
+- [docs/business_user_guide.md](docs/business_user_guide.md): first-use business guide.
+- [TESTING.md](TESTING.md): test entrypoints, layers, isolation, and evidence.
+- [PR_Checklist.md](PR_Checklist.md): general PR todo and target-project publishing-policy boundary.
+- [SOP.md](SOP.md): stable standard-process entrypoints.
+- [.github/pull_request_template.md](.github/pull_request_template.md): long-term PR body structure.
- [docs/development_workflow/README.md](docs/development_workflow/README.md): English workflow overview.
- [../zh/skills/workflow-docs-sync/](../zh/skills/workflow-docs-sync/): canonical Skill implementation.
-## Install Path Rule
-
-`en/` is an upstream source prefix, not a target directory. Sync strips only the
-leading `en/` and preserves the rest of each path:
+## Install and Language Boundary
-- `en/AGENTS.md` -> `/AGENTS.md`
-- `en/docs/business_user_guide.md` -> `/docs/business_user_guide.md`
-- `en/.github/pull_request_template.md` -> `/.github/pull_request_template.md`
+`en/` is an upstream source prefix, not a target directory. Sync removes only the leading `en/` and keeps
+the remaining path, including `.github/`.
-Chinese remains the workflow source of truth. English is derived; unfinished
-coverage must be marked `en-pending` instead of being presented as ready.
+Chinese is the semantic source and English is derived. Bilingual content changed by a PR closes in that PR;
+translation status in unchanged historical decisions remains a historical record.
diff --git a/en/SOP.md b/en/SOP.md
index f9af1b7..e8fb130 100644
--- a/en/SOP.md
+++ b/en/SOP.md
@@ -1,12 +1,31 @@
-# Guidance
+# Standard Operating Procedures
-When asked to execute an SOP, convert the required SOP steps into a todo list and complete them step by step.
+## Purpose and Authority
-## SOP Principles
+`SOP.md` keeps stable process entrypoints and does not copy volatile commands, test lists, or publishing
+details. When sources conflict, current code, configuration, tests, contracts, and focused authorities such
+as `TESTING.md` and `PR_Checklist.md` take precedence. Keep execution checklists in the current session;
+do not write them as repository run state, receipts, or temporary SOPs.
-- Principle A: Every SOP step uses the same structure: what to do, where to look for the authority, and how to verify completion. Do not repeat full rules inside the SOP.
-- Principle B: SOPs do not contain volatile lists. They point to entrypoints. If stages or environment variables change, update `TESTING.md` or scripts, not the SOP.
-- Principle C: `SOP.md` is not a rules document. It is a process skeleton plus pointers to authoritative documents, commands, and tests. When conflicts exist, tests, contracts, and rule documents override SOP.
-- Example: if `PR_Checklist.md` and `TESTING.md` already explain what to run, update, and deliver, do not repeat PR or testing details here.
+## Available SOPs
-## SOP 0
+
+
+## SOP Entry Structure
+
+Every SOP step contains only:
+
+1. Action: the stable action to perform.
+2. Authority / Source: the authoritative entrypoint to read without copying volatile details.
+3. Acceptance: how current tests, artifacts, or observable results prove completion.
+
+## Failure, Rollback, and Escalation
+
+On failure, stop at a safe boundary and preserve the exact error and current repository state. Rollback
+must match real persistence and side effects. Escalate missing authority, product decisions, or external
+coordination to the responsible person instead of guessing or bypassing the boundary.
+
+
+
+Use LF line endings and UTF-8 for text files unless repository configuration explicitly requires another
+format.
diff --git a/en/TESTING.md b/en/TESTING.md
index af07fff..d25d072 100644
--- a/en/TESTING.md
+++ b/en/TESTING.md
@@ -1,88 +1,86 @@
-# Testing Flow
+# Testing
-Read and follow this guide before submitting any PR or running regression tests. Unless stated otherwise, run commands from the repository root and prefer the project-provided test runner when one exists.
+## 0. Canonical Test Entrypoints
-## Testing Philosophy
+Derive every exact command from current repository scripts, task configuration, CI, build files, or test
+framework configuration, and verify it from the repository root or a recorded working directory. Do not
+infer a language, runner, service, or phase from this template.
-- Reject tests written only for the sake of tests. Tests should verify behavior and contracts, not implementation trivia.
-- Avoid redundancy. If an end-to-end or scenario test already covers a behavior, do not duplicate it with a mock-only unit test unless it gives a much faster feedback loop or covers an edge case the live test cannot cover.
-- Keep the suite lean. Regularly remove obsolete tests that no longer provide value.
-- Keep tests deterministic. Except for explicit live monitors, tests should not depend on changing production data.
-- Keep tests isolated. One test must not depend on another test's order or leftover state.
-- Make failures diagnosable. Assertions should explain what was expected and what was observed.
-- Keep this document current when test files are added or changed.
+
-## Capability Contract Alignment Tests
+## 1. Testing Philosophy
-When a project uses `capability_contract.json`, `interact.md`, or `docs/business_user_guide.md`, provide a lightweight contract alignment test such as `tests/.../test_capability_contract_alignment.py`.
+- Test behavior, contracts, and failure boundaries without locking in implementation details that have no
+ user value.
+- Each new test should cover a real gap. A higher-level test does not automatically make a fast,
+ diagnosable lower-level regression redundant.
+- Use fixed inputs by default instead of changing production data. Mark live tests with their external
+ dependencies and risks.
+- Keep tests isolated from order and residual state, and make failures explain expected versus actual
+ behavior.
+- Record scope and reason accurately when a test is not run, skipped, or limited to static checks; do not
+ infer a pass.
-The test does not verify business logic. It verifies that machine-readable capability contracts and user-readable claims have not obviously drifted.
+## 2. Test Layers and What Each Proves
-### anchor_id Extraction
+- **Unit**: proves local behavior of one function, class, or module under isolated input.
+- **Contract**: proves a public schema, interface, file format, or cross-module agreement.
+- **Scenario**: proves a user or caller path through multiple real components.
+- **Golden**: proves reviewed output for deterministic input; it does not alone prove external systems or
+ the complete runtime chain.
+- **Report build**: proves a report or deliverable can be generated; it does not automatically prove
+ business correctness.
+- **Repair validation**: proves a repaired artifact satisfies a specific gate; it does not prove every
+ upstream phase is correct.
+- **Light review**: proves only the limited scope its implementation checks; never describe it as full
+ validation.
+- **Full validation**: use this name only when the complete target path, dependencies, and acceptance
+ boundary are actually covered.
+- **Live**: proves one run against real external dependencies; record environment, time sensitivity, and
+ reproducibility risk.
-Alignment tests should recursively scan the full `capability_contract.json` tree for objects containing `anchor_id`. Do not hardcode JSON paths, bucket names, array indexes, or the current schema hierarchy.
+## 3. Capability Contract Alignment
-### Markdown Anchor Syntax
+An alignment test belongs to the target project's test suite, not the documentation sync checker. It
+should recursively collect stable `anchor_id` values from every object in `capability_contract.json` and
+check uniqueness and Markdown references without hardcoding buckets, JSON paths, array positions, or
+requiring every contract entry to appear in the business guide.
-All user-readable documents must reference contract anchors with this exact format:
+Use `test_anchor: null` with a concrete reason for declarations without automation. Register the real test
+anchor when a test exists. Before claiming an alignment test exists, verify its implementation and command
+in the target repository.
-```text
-
-```
+
-Rules:
+## 4. Change Type to Required Evidence
-- Do not use variants such as ``, ``, or ``.
-- `` must exist in `capability_contract.json`.
-- Do not reference JSON paths, array indexes, or schema-internal paths.
-- Alignment tests recognize only this syntax.
+
-### What Tests Should Cover
+## 5. Side Effects and Isolation
-1. `anchor_id` uniqueness.
-2. Recursive `anchor_id` extraction.
-3. Valid Markdown anchor syntax.
-4. No naked placeholder anchors such as `capability-anchor: TODO`.
-5. Agent behavior commitments are registered.
-6. Not every contract entry must appear in the business guide.
-7. Teaching copy style is not a test target.
-8. Alignment tests should read local files only and must not call real external services.
+Before running a command, identify its write paths, external services, credentials, concurrency, ordering,
+cleanup, and CI policy, then choose an environment that isolates those real side effects. The environment
+may be CI, a container, a separate checkout, a remote test environment, or another project-validated
+execution surface; this template does not prescribe one implementation. Record the actual environment,
+isolation method, residual state, and cleanup result.
-### Failure and Warning Rules
+
-- A document references a missing `anchor_id`: fail.
-- Duplicate `anchor_id`: fail.
-- Naked TODO anchors: fail or high-priority warning.
-- Untested behavior with an explicit untested reason: warn, do not fail by default.
-- Contract entries missing from the business guide: do not fail unless marked as required for the guide.
+## 6. Test Suite Overview
-## Test Layers and Naming
+Describe stable test directories, entrypoints, and responsibilities instead of permanently listing every
+test file.
-1. Module-level tests
- - Goal: fast checks for one module's behavior.
- - Naming: `/.py` and `tests//test_.py`.
- - These tests should not depend on external services.
+
-2. Contract / scenario / live tests
- - Goal: validate public API contracts, full business scenarios, or external dependencies.
- - Use only when the behavior cannot be covered by faster deterministic tests.
+## 7. Known Gaps and Untested Reasons
-## When to Add or Modify Tests
+
-If a code change fixes a bug not covered by existing tests, add a minimal regression test that reproduces the bug before or with the fix. After the fix, ensure the new test passes in the applicable gate.
+## 8. Lessons Learned
-Any behavioral code change needs test evidence. If no tests changed, explain why existing tests already cover the behavior and provide rerun evidence.
+Record reusable test-decision rules supported by real failures, not incident chronology or volatile
+commands. If a failure came from layers passing independently while their combination failed, keep both a
+minimal regression and a scenario test that crosses the real boundary.
-## Test File Overview
-
-## Recommended Test Gate by Change Type
-
-## Lessons Learned
-
-### Lesson Maintenance Rules
-
-- Add a lesson only when a real defect shows that existing testing guidance could not reliably lead to the right test strategy.
-- Update existing lessons by raising abstraction level and clarifying boundaries, not by rewriting them for one implementation detail.
-- Merge lessons that describe the same failure mode.
-- Delete or rewrite a lesson only when a stronger rule, process, or automation fully replaces it.
-- Lessons should guide future testing decisions, not preserve incident chronology.
+
diff --git a/en/architecture.md b/en/architecture.md
index a8922a3..0970bc7 100644
--- a/en/architecture.md
+++ b/en/architecture.md
@@ -1,97 +1,60 @@
-# architecture.md
+# Architecture
-This document describes the project's system structure, module boundaries, data flow, architecture invariants, and extension points.
+## 0. Scope and Update Triggers
-This document does not cover:
+This document is the authority for the current system structure. Update or confirm the relevant section
+when runtime entrypoints, module boundaries, call flows, data contracts, state, error models, external
+dependencies, authentication, configuration, artifacts, side effects, extension points, or architecture
+debt change. Every claim must come from current implementation, configuration, tests, committed artifacts,
+or reproducible evidence.
-- Agent work rules: see `AGENTS.md`
-- PR process: see `PR_Checklist.md`
-- Testing strategy: see `TESTING.md`
-- Capability boundaries, responsibility boundaries, and agent behavior commitments: see `capability_contract.json`
-- User-visible behavior: see `interact.md`
-- First-time business-user teaching: see `docs/business_user_guide.md`
-- Standard operating procedures: see `SOP.md`
+
----
-
-## 0. Update Triggers
-
-Update this document when a change affects:
+## 1. System Purpose
-- Core modules added or removed
-- Module responsibility boundaries
-- Runtime call flow
-- Data flow, data contracts, or schema
-- State model
-- Error handling model
-- External dependencies, authentication, or configuration entrypoints
-- Important extension points
-- Important architecture debt or constraints
+
----
+## 2. Runtime Entrypoints and Main Flows
-## 1. System Purpose
+
-
+## 3. Architecture Invariants
-This system is used for:
+Each invariant should state the positive constraint, scope, falsification method, and consequence of
+violation. Do not present a vision or proposed design as a current invariant.
-Inputs:
+
-Outputs:
+## 4. Module Responsibility Boundaries
-Core value:
+Describe stable modules by responsibility, non-responsibility, permitted dependencies, and forbidden
+dependencies. Do not copy the repository tree file by file.
----
+
-## 2. Architecture Invariants
+## 5. Data Flow and Data Contracts
-
+
-### 2.1 Invariant Name
+## 6. State and Persistence Model
-- Positive statement:
-- Negative statement:
-- Scope:
-- Review check:
-- Automated check, if any:
-- Consequence if violated:
+
----
+## 7. Error and Failure Model
-## 3. Module Responsibility Boundaries
+
-| Module / Directory | Responsibility | Non-responsibility | May Depend On | Must Not Depend On |
-|---|---|---|---|---|
-| | | | | |
+## 8. External Dependencies, Authentication, and Configuration
-### 3.1 Boundary Rules
+
--
--
--
+## 9. Artifacts and Side Effects
----
+
-## 4. Main Data Flow
+## 10. Extension Points and Architecture Debt
-
+Mark future or proposed items explicitly; do not present them as current capabilities or existing extension
+points.
-```mermaid
-flowchart LR
- Input[Input] --> Entry[Entry / Parser]
- Entry --> Service[Service / Orchestration]
- Service --> Core[Core Logic]
- Core --> Output[Output]
-```
+
diff --git a/en/capability_contract.json b/en/capability_contract.json
index eecac34..a825c6c 100644
--- a/en/capability_contract.json
+++ b/en/capability_contract.json
@@ -1,124 +1,107 @@
{
"schema_version": "0.1.0",
- "status": "sample",
- "purpose": "Sample registry for stable capability, boundary, responsibility, behavior, and document anchors.",
+ "status": "__PROJECT_FILL__: replace with the verified contract status",
+ "purpose": "Machine-readable registry for current capability, boundary, responsibility, behavior, and document anchors.",
"source_language": "en-US",
"rules": [
- "Markdown documents reference stable anchor_id values only.",
- "Markdown documents must not reference JSON paths, array indexes, or schema-specific internal paths.",
- "Deprecated anchors should stay registered and must not be reused for a different meaning.",
- "Untested contracts use test_anchor: null with untested_reason or pending_since instead of scattered TODO markers."
+ "Every fill entry must be replaced with verified project content or deleted before validation.",
+ "Every active statement must have evidence in the current implementation, configuration, tests, committed artifacts, or reproducible results.",
+ "Future or proposed behavior must use an explicit non-active status and must not be presented as currently available.",
+ "Markdown documents reference stable anchor_id values only, never JSON paths, array indexes, or schema-internal paths.",
+ "Deprecated anchors remain registered for their original meaning and must never be reused.",
+ "A contract without automation uses test_anchor: null and records a concrete untested_reason or pending_since value."
],
"contracts": {
"capabilities": [
{
- "anchor_id": "CAPABILITY.sample_supported_question",
+ "anchor_id": "__PROJECT_FILL__:CAPABILITY.identifier",
"type": "capability",
- "status": "experimental",
- "statement": "Sample capability placeholder for a project-supported business question type.",
+ "status": "__PROJECT_FILL__: replace with active, experimental, future, proposed, or deprecated",
+ "statement": "__PROJECT_FILL__: replace with a verified project capability",
"audience": [
- "business_user",
- "agent",
- "reviewer"
+ "__PROJECT_FILL__: replace with the real audiences"
],
"test_anchor": null,
"test_status": "not_automated",
- "untested_reason": "Sample entry only; replace with a project-specific contract and test anchor.",
- "pending_since": "2026-04-26",
- "since": "2026-04-26"
+ "untested_reason": "__PROJECT_FILL__: replace with the reason automation is absent, or replace test_anchor and remove this field",
+ "pending_since": "__PROJECT_FILL__: replace with the applicable date or remove this field",
+ "since": "__PROJECT_FILL__: replace with the first verified version or date"
}
],
"capability_boundaries": [
{
- "anchor_id": "BOUNDARY.sample_multi_object_comparison_not_supported",
+ "anchor_id": "__PROJECT_FILL__:BOUNDARY.identifier",
"type": "capability_boundary",
- "status": "experimental",
- "statement": "Sample boundary placeholder for a currently unsupported capability that may be added later.",
+ "status": "__PROJECT_FILL__: replace with the verified status",
+ "statement": "__PROJECT_FILL__: replace with a verified current limit, rejection, or degradation boundary",
"audience": [
- "business_user",
- "agent",
- "reviewer"
+ "__PROJECT_FILL__: replace with the real audiences"
],
"test_anchor": null,
"test_status": "not_automated",
- "untested_reason": "Sample entry only; replace with a project-specific boundary and test anchor.",
- "pending_since": "2026-04-26",
- "since": "2026-04-26"
+ "untested_reason": "__PROJECT_FILL__: replace with the reason automation is absent, or replace test_anchor and remove this field",
+ "pending_since": "__PROJECT_FILL__: replace with the applicable date or remove this field",
+ "since": "__PROJECT_FILL__: replace with the first verified version or date"
}
],
"responsibility_boundaries": [
{
- "anchor_id": "RESPONSIBILITY.sample_no_final_business_decision",
+ "anchor_id": "__PROJECT_FILL__:RESPONSIBILITY.identifier",
"type": "responsibility_boundary",
- "status": "experimental",
- "statement": "Sample responsibility boundary placeholder for decisions the system should not make on behalf of humans.",
+ "status": "__PROJECT_FILL__: replace with the verified status",
+ "statement": "__PROJECT_FILL__: replace with a verified human or system responsibility boundary",
"audience": [
- "business_user",
- "agent",
- "reviewer"
+ "__PROJECT_FILL__: replace with the real audiences"
],
"test_anchor": null,
"test_status": "not_automated",
- "untested_reason": "Sample entry only; replace with a project-specific responsibility boundary and test anchor.",
- "pending_since": "2026-04-26",
- "since": "2026-04-26"
+ "untested_reason": "__PROJECT_FILL__: replace with the reason automation is absent, or replace test_anchor and remove this field",
+ "pending_since": "__PROJECT_FILL__: replace with the applicable date or remove this field",
+ "since": "__PROJECT_FILL__: replace with the first verified version or date"
}
],
"agent_behaviors": [
{
- "anchor_id": "BEHAVIOR.sample_requires_context_before_answer",
+ "anchor_id": "__PROJECT_FILL__:BEHAVIOR.identifier",
"type": "agent_behavior",
- "status": "experimental",
- "statement": "Sample behavior placeholder requiring the agent to ask for missing critical context instead of guessing.",
+ "status": "__PROJECT_FILL__: replace with the verified status",
+ "statement": "__PROJECT_FILL__: replace with a verified ask, refuse, explain, or degrade behavior",
"audience": [
- "business_user",
- "agent",
- "developer",
- "reviewer"
+ "__PROJECT_FILL__: replace with the real audiences"
],
"test_anchor": null,
"test_status": "not_automated",
- "untested_reason": "Sample entry only; replace with a project-specific behavior contract and test anchor.",
- "pending_since": "2026-04-26",
- "since": "2026-04-26"
+ "untested_reason": "__PROJECT_FILL__: replace with the reason automation is absent, or replace test_anchor and remove this field",
+ "pending_since": "__PROJECT_FILL__: replace with the applicable date or remove this field",
+ "since": "__PROJECT_FILL__: replace with the first verified version or date"
}
],
"documents": [
{
- "anchor_id": "DOC.business_user_guide",
+ "anchor_id": "DOC.interact",
"type": "document",
- "status": "experimental",
- "statement": "docs/business_user_guide.md is a teaching document derived from capability_contract.json and interact.md.",
+ "status": "active",
+ "statement": "interact.md is the source of truth for user-visible behavior and acceptance invariants.",
"audience": [
"business_user",
"agent",
"reviewer"
],
- "document_path": "docs/business_user_guide.md",
- "language": "en-US",
- "test_anchor": null,
- "test_status": "not_automated",
- "untested_reason": "Alignment principles are documented in TESTING.md; project-specific tests are added by each target project.",
- "pending_since": "2026-04-26",
- "since": "2026-04-26"
+ "document_path": "interact.md",
+ "language": "en-US"
},
{
- "anchor_id": "DOC.interact",
+ "anchor_id": "DOC.business_user_guide",
"type": "document",
"status": "active",
- "statement": "interact.md is the source of truth for user-visible behavior and acceptance invariants.",
+ "statement": "docs/business_user_guide.md is a teaching document derived from capability_contract.json and interact.md.",
"audience": [
"business_user",
"agent",
"reviewer"
],
- "document_path": "interact.md",
- "language": "en-US",
- "test_anchor": null,
- "test_status": "not_automated",
- "untested_reason": "Alignment principles are documented in TESTING.md; project-specific tests are added by each target project.",
- "pending_since": "2026-04-26",
- "since": "2026-04-26"
+ "document_path": "docs/business_user_guide.md",
+ "language": "en-US"
}
]
}
diff --git a/en/docs/business_user_guide.md b/en/docs/business_user_guide.md
index 1190340..5e4f987 100644
--- a/en/docs/business_user_guide.md
+++ b/en/docs/business_user_guide.md
@@ -1,135 +1,40 @@
-# : First-Time Business User Guide
+# First-use Guide
-> Status: experimental
-> Audience: business users
-> Scope:
-> Capability boundary source: `capability_contract.json`
-> User-visible behavior source: `interact.md`
-> Rule: This guide is a derived teaching document. It must not declare independent capabilities. Any "can do / cannot do / must ask / must refuse" statement must anchor to `capability_contract.json`, `interact.md`, or tests.
-> Template note: all ``, sample case titles, and generic business scenarios are scaffolding only. Replace them with real project business questions before publishing.
+This guide is for business users encountering the project for the first time. It only explains capability
+boundaries declared in `capability_contract.json` and user-visible behavior declared in `interact.md`; it
+does not independently promise capabilities or describe implementation details.
-This is a cross-project template. In a concrete project, keep only what a first-time business user truly needs; do not turn it into a complete feature manual.
+## 1. Value
-## 1. Start Here: What Value Does It Provide?
+
-Use three to five sentences to explain what business problem the system helps solve, what information it takes as input, and what judgment support it returns.
+## 2. Best-fit Business Questions
-Do not independently promise new capabilities here. Capability statements must trace back to `capability_contract.json` or `interact.md`.
+
-## 2. Best-Fit Business Questions
+## 3. Capability and Responsibility Boundaries
-- **Sample capability: answer status, trend, or anomaly questions about one clear object**
-
- Replace this with a real project capability, written in business-user language.
+
-## 3. Capability Boundaries
+## 4. Context to Provide
-The current version does not support the following capabilities, though future versions may:
+
-- **Sample boundary: comparing multiple objects in one request is not supported yet**
-
- Replace this with a real project capability boundary.
+## 5. Representative Real Cases
-## 4. Responsibility Boundaries
+Keep only one to three real cases supported by current implementation or tests. When there is no real case,
+delete this section or write `Not configured —` with a verified reason. Do not keep a generic case skeleton.
-The system intentionally does not do the following:
+
-- **Sample responsibility boundary: it does not make final business decisions for humans**
-
- The system may provide evidence, explanations, and risk signals, but final business decisions remain with the responsible human.
+## 6. Reading Results
-## 5. First Use: Classify Your Question
+
-Classify the question first, then provide context. Keep only the three to five most common question types, for example:
+## 7. Human Escalation
-- I want to check whether one object changed noticeably.
-- I want to understand why an abnormal result may have happened.
-- I want to know whether current data is sufficient for a judgment.
+
-## 6. What Context Should You Provide?
+## 8. Feedback and Ownership
-Business users should usually provide:
-
-- Target object: which customer, product, region, model, or process you care about.
-- Time range: which period matters.
-- Judgment purpose: trend judgment, anomaly diagnosis, health check, or result explanation.
-- Business context: known campaigns, strategy changes, or data definition changes.
-
-If critical context is missing, the agent should ask follow-up questions instead of guessing.
-
-
-## 7. Common Business Cases
-
-### Case 1: Check Whether One Object Is Abnormal
-
-#### Business Question
-
-I want to know whether `