Skip to content

Make Codex and Claude Code subscriptions go further: a local model router that gives routine agent work to economical models and keeps your strongest model for the hard parts.

chore(planning): adopt incremental requirements and durable reconciliation (#120)

澄潭9c174414e57b
diff --git a/.agents/skills/hiroute-design-author/SKILL.md b/.agents/skills/hiroute-design-author/SKILL.md
index eb27d86c..fa43b1b2 100644
--- a/.agents/skills/hiroute-design-author/SKILL.md
+++ b/.agents/skills/hiroute-design-author/SKILL.md
@@ -11,7 +11,8 @@ The assigned Proposal thread owns its authorized planning and later implementati
## Reference policy
-- Use current code, related issue-spec Issues, and repository durable specs as the design inputs.
+- Use current code, related issue-spec Issues, and repository durable specs as the design inputs. Before defining Proposal SPECs, follow the [code map](../../../docs/code-map/README.md) to the affected production owner and a representative scenario. Apply the shared [requirement scope guide](../issue-spec-workflow/references/planning-scope.md); identify HiRoute capabilities to reuse and the integration or behavior gaps this change must close.
+- Preserve applicable shared configuration, routing, security and recovery contracts as constraints of the affected capability. Use their owning specs and the compatibility register where applicable; do not turn unchanged platform contracts into independent feature deliverables.
- When those sources lack required intent, investigate available repository evidence and record the missing decision self-contained in the selected Proposal or Design.
- Treat historical Issues as context, not fixed execution itineraries. Choose the architecture from current requirements and code without carrying obsolete scope forward.
- Make the issue-native Proposal/SPEC/Design/TASK chain self-contained for product behavior, shared interfaces, invariants, failure behavior, decisions, and acceptance. Private helpers and internal layouts need not be predetermined unless they protect an invariant or another package depends on them. A reader with only the repository and selected Issues must be able to review and implement the Design.
diff --git a/.agents/skills/hiroute-design-author/references/executable-design.md b/.agents/skills/hiroute-design-author/references/executable-design.md
index 0c613f0a..aa78efef 100644
--- a/.agents/skills/hiroute-design-author/references/executable-design.md
+++ b/.agents/skills/hiroute-design-author/references/executable-design.md
@@ -4,9 +4,9 @@ Use when preparing a detailed handoff for bounded implementation. The objective
## Put information in its owning artifact
-- Proposal/SPEC: user outcomes, scope/non-goals and observable long-lived behavior.
-- Design body: architecture, shared contracts, state/data ownership, significant failure behavior, settled decisions, and a short TASK/dependency index. Give each TASK a descriptive purpose and exact locator so discovery does not require opening every comment.
-- TASK: one coherent implementation unit with a verifiable result. Several TASKs can belong to the same owner; they do not imply additional agents, worktrees or reviews.
+- Proposal: capability baseline, user outcomes, scope and non-goals; SPEC: the required product increment and observable behavior, following the shared [requirement scope guide](../../issue-spec-workflow/references/planning-scope.md).
+- Design body: architecture, shared contracts, state/data ownership, significant failure behavior, settled decisions, overall verification strategy, and a short TASK/dependency index. Give each TASK a descriptive purpose and exact locator so discovery does not require opening every comment.
+- TASK: one coherent implementation or verification unit with a verifiable result and coverage of the relevant product SPECs. Several TASKs can belong to the same owner; they do not imply additional agents, worktrees or reviews.
- QUESTION/ANSWER: genuine unresolved contract decisions and their resolution, not routine private coding choices.
- Repository fixtures/goldens: large executable examples, precisely linked by path and known revision. Copy required contract facts into Design/TASK; an external archive is not an implementation prerequisite.
@@ -15,10 +15,10 @@ Use when preparing a detailed handoff for bounded implementation. The objective
Use these fields where relevant; omit inapplicable detail rather than manufacture work. Preserve the CLI's canonical TASK template and relationship fields.
1. **Outcome and boundary:** what must work, what is excluded, owned paths and shared-file writer.
-2. **Starting evidence:** inspected code revision, exact entrypoints/types, reusable capabilities and gaps. Do not invent symbols or require the owner to rediscover the architecture.
+2. **Starting evidence:** refine the Proposal's capability baseline into the inspected code revision, exact entrypoints/types, reusable capabilities and remaining gaps for this TASK. Do not invent symbols or require the owner to rediscover the architecture.
3. **Contract:** inputs, outputs, errors, state/persistence, compatibility and security invariants. Link the owning shared decision instead of maintaining duplicate definitions.
4. **Work sequence:** a short dependency-ordered sequence of changes; identify unavailable peer implementations and allowed contract-level test doubles.
-5. **Verification:** observable expected results for normal, failure and integration cases; relevant commands/test locations; distinguish component evidence from production-path acceptance. A test that only confirms the proposed helper shape is insufficient.
+5. **Verification:** concrete normal, failure and integration cases, required environments/platforms, relevant commands/test locations, and expected results/evidence, selected through [HiRoute validation](../../hiroute-validation/SKILL.md). Distinguish component evidence from production-path acceptance. Keep these execution requirements in TASKs rather than Proposal SPECs. A test that only confirms the proposed helper shape is insufficient.
6. **Escalation boundary:** which discoveries invalidate the design or require a shared decision. Routine helper/layout choices stay with the owner; only affected work pauses.
Split a TASK when it spans unrelated contracts or cannot be read and verified as one unit, not at an arbitrary word count. Do not introduce extra phases, reporting systems or per-TASK approval gates.
diff --git a/.agents/skills/hiroute-implementation-writer/references/durable-spec.md b/.agents/skills/hiroute-implementation-writer/references/durable-spec.md
index 4744129e..080d46ea 100644
--- a/.agents/skills/hiroute-implementation-writer/references/durable-spec.md
+++ b/.agents/skills/hiroute-implementation-writer/references/durable-spec.md
@@ -2,12 +2,15 @@
Use when updating repository durable specs for an implemented change or repairing a stage-review finding. Preserve the configured issue-spec workflow and confirmed decisions; this guidance does not authorize an unrelated specification rewrite or bypass canonical validation.
+Follow the shared [Durable contract maintenance](../../issue-spec-workflow/references/durable-maintenance.md) guide for merging confirmed changes into complete current contracts, choosing `current-spec` versus `inline`, and the limits of projection checks. The implementation owner performs this maintenance with the code; Proposal authoring alone does not publish planned behavior as a current contract.
+
## What to preserve
-- Organize by lasting product scenario/capability under `issue-spec/specs`, reusing existing files before adding a new scene. Maintain the index when adding or moving a file.
+- Use the [specification index](../../../../issue-spec/specs/README.md) and [code map](../../../../docs/code-map/README.md) to locate lasting product capabilities and their owners under `issue-spec/specs`. Reuse existing files and requirements before adding a new capability. A consumer integration may update Agent connections, shared clients and request routing; it does not require one new file per Proposal SPEC. Maintain the index when adding or moving a file.
- Extract confirmed requirements into testable behavior: user outcomes, authorization, data lifecycle, compatibility, meaningful failure behavior and necessary architectural invariants.
- Capture technical constraints only when they protect a lasting contract, not merely because the current implementation has a particular helper, database table or tuning value.
-- Keep source Issue/typed-artifact references for traceability, separate from normative requirements. Use the workflow's durable-spec preview/apply/check facilities when applicable and inspect the resulting content; projection is not a substitute for semantic review.
+- Keep source Issue/typed-artifact references for traceability, separate from normative requirements. For a selected Proposal projection, declare complete resulting requirements and use preview/apply/check; MODIFIED replaces all scenarios inside the target Requirement. For a simple-Issue change, use the ordinary repository edit/review path without manufacturing Proposal artifacts.
+- Keep HiRoute's readable document titles and independent `Implementation references` sections. The CLI identifies capabilities by their path slugs and preserves those sections outside Requirement operations; do not rename titles to slugs or move references into the last Requirement. Inspect the preview for both retained references and correctly placed additions. Resolve unsupported structure before applying rather than dropping content or declaring a changed contract `UNCHANGED`.
## What not to promote
@@ -17,4 +20,6 @@ Do not paste whole Design/TASK/PROCESS records into durable specs. Exclude stage
Check the affected requirements against confirmed Design/answers, existing specs, code and executable tests. Do not weaken a requirement merely to match incomplete code or claim completion because its SPEC exists. If a conflict requires a contract decision, pause the affected change and request amendment; identify implementation gaps separately from expected behavior.
+Inspect the old and new Requirement blocks, not only newly added text. Preserve applicable configuration ownership, recovery and rollback, routing continuity/isolation, security and data-lifecycle guarantees. For compatibility-sensitive changes, follow [compatibility maintenance](../../hiroute-compatibility/SKILL.md) and its register; a new consumer does not silently retire existing guarantees. Confirm that any removed condition has an authorized contract change, that other capability files do not duplicate or contradict the updated definition, and that validation commands/results remain in TASK or PR records. A passing projection check proves equality to the declared result, not these semantic properties.
+
Preserve unrelated requirements and apply the agreed ownership/convergence protocol for shared SPEC files. In the normal handoff, list the updated paths and product behaviors, evidence locations and unresolved mismatches. Do not create a separate receipt or per-SPEC review gate. Human PR review checks the specification. A designated coordinator additionally checks cross-Proposal consistency only in explicitly coordinated work.
diff --git a/.agents/skills/issue-spec-apply/SKILL.md b/.agents/skills/issue-spec-apply/SKILL.md
index 89ee6014..9d1fb1f0 100644
--- a/.agents/skills/issue-spec-apply/SKILL.md
+++ b/.agents/skills/issue-spec-apply/SKILL.md
@@ -21,6 +21,8 @@ Every new typed ID MUST be `<TYPE>-<issue><three-digit sequence>`: Issue 1 start
Read the complete Design, applicable answers, selected TASKs and required SPECs/dependencies. Confirm base/worktree, ownership, shared interfaces and required checks. Implement and self-test within that scope; recover derivable facts and pause only work affected by missing or conflicting requirements. Keep durable specifications current, without turning temporary development stages into product requirements.
+For repository durable specs, follow [Durable contract maintenance](../issue-spec-workflow/references/durable-maintenance.md) to reconcile the requested increment with the complete current contract before handoff.
+
Run affected checks and explicit gates. After they pass, expand testing only for a change, failure or concrete unresolved risk. Evidence names the revision actually checked; after a repair rerun affected checks and preserve reused evidence at its original revision. Report the candidate, results, gaps and remaining review needs. Self-tests do not constitute independent review or approval. Do not dispatch a reviewer, publish, push or merge as a workflow side effect.
Delegation remains optional and requires actual authorization. Each assigned owner implements and tests its bounded package; any designated convergence owner handles shared changes and integration. Do not manufacture phase artifacts, PROCESS or role receipts to record ordinary single-owner work.
diff --git a/.agents/skills/issue-spec-propose/SKILL.md b/.agents/skills/issue-spec-propose/SKILL.md
index a693094c..e57c2ea5 100644
--- a/.agents/skills/issue-spec-propose/SKILL.md
+++ b/.agents/skills/issue-spec-propose/SKILL.md
@@ -17,6 +17,8 @@ For selected issue-spec steps, the built-in phase sequence and canonical artifac
Every new typed ID MUST be `<TYPE>-<issue><three-digit sequence>`: Issue 1 starts with `QUESTION-1001`, Issue 44 with `QUESTION-44001`. Allocate 001-999 only within the target Issue and type after reading that Issue's typed comments, and never renumber a legacy ID. New writes reject wrong Issue prefixes; `--allow-legacy-id` is only for intentional legacy-compatible creates.
+Before authoring or revising Proposal/SPEC or Design/TASK, read [Requirement scope and verification ownership](../issue-spec-workflow/references/planning-scope.md).
+
1. Validate workflow config, search related issues, and open only selected discussions. If the issue is already in a later phase, continue that phase rather than duplicating it.
2. Keep unconfirmed investigation in a simple issue with issue-spec issue create simple; a proposal states a confirmed problem and intended change, so never promote an investigation issue into the proposal or attach SPEC/Design to it. Create phase issues with body files, starting with issue-spec issue create proposal --repo higress-group/HiRoute --body-file <file>. Follow `rules.language` and `rules.language_instructions`. For localized titles, pass an explicit `--title` for Proposal, Design, and Implement; the derived title retains an English stage prefix. Keep standardized stage prefixes and avoid style-only title rewrites.
3. Perform the Proposal's first QUESTION discovery/create pass. Record each genuine unresolved decision as a blocking typed QUESTION with issue-spec question create, attaching credible options; never leave an open decision as body or projection prose. Do not manufacture a question or reopen a settled choice; keep unresolved decisions distinct from evidence-dependent items. Resolve routine private details within the confirmed scope; self-contained contracts need not prescribe every helper or layout.
diff --git a/.agents/skills/issue-spec-workflow/references/durable-maintenance.md b/.agents/skills/issue-spec-workflow/references/durable-maintenance.md
new file mode 100644
index 00000000..0362716a
--- /dev/null
+++ b/.agents/skills/issue-spec-workflow/references/durable-maintenance.md
@@ -0,0 +1,27 @@
+# Durable contract maintenance
+
+Use during implementation when the selected workflow maintains repository durable specs. The current implementation owner reconciles the affected contracts on the implementation branch and includes them in the same reviewable change. Proposal SPECs define the requested increment; durable specs define the complete current contract after that change. Proposal-only work does not require publishing future behavior as a current durable contract.
+
+## Reconcile the contract
+
+Read the affected existing durable requirements together with the confirmed change requirements, current Design and effective decisions when present. Identify what is added, changed, explicitly removed or renamed. Preserve still-applicable behavior and scenarios, including meaningful failure, authorization, data lifecycle and compatibility constraints. Check code and executable tests against that intent; incomplete implementation is a gap to fix or report, not permission to weaken the contract. Resolve consequential conflicts before affected work.
+
+Organize by lasting capability and contract ownership, reusing existing files and requirements. Proposal SPECs and durable requirements need not map one-to-one: one change may affect multiple capability files, and successive changes may update the same requirement. Keep the resulting behavior self-contained, avoid duplicate normative definitions, and retain source references separately for traceability. Do not copy change-relative wording, implementation schedules, TASK verification procedures or execution evidence into the durable contract. Preserve unrelated content; this does not authorize a repository-wide rewrite.
+
+## Select the appropriate projection
+
+When using the CLI's durable-spec preview/apply/check protocol for a selected Proposal, record explicit Durable Intent operations on its source SPECs for the affected paths and requirements. A MODIFIED operation replaces the entire target Requirement block, including its scenarios; it does not merge individual sentences or preserve omitted scenarios inside that block. Supply the complete intended replacement, retaining every still-applicable contract condition.
+
+Capability identity comes from the declared path slug, not the document's display title. Existing readable titles and independent sections after Requirements (such as Implementation references) are preserved; added requirements stay inside Requirements. Keep canonical Purpose and Requirements sections and Requirement headings. If preview reports unsupported or ambiguous structure, diagnose it before writing rather than changing the title or dropping other sections just to satisfy the tool. When multiple source SPECs affect the same Requirement, consolidate the final contract under one owning operation; duplicate target operations are rejected.
+
+- Use `current-spec` only when the source SPEC already expresses the complete intended durable Requirement and scenarios, with the matching target title and no temporary change context. It is suitable for a self-contained new requirement or a complete replacement, not an incremental note about an existing requirement.
+- Use `inline` when the durable Requirement needs consolidation with existing behavior or a different capability-oriented formulation. Author the complete resulting requirement and scenarios in the projection rather than expanding every Proposal SPEC into a full capability document.
+- Use explicit REMOVED or RENAMED operations for those intentions. Review omitted old behavior as a possible regression unless a confirmed decision authorizes its removal; absence from the Proposal is not such a decision.
+
+Preview the declared operations against the intended baseline, inspect the complete resulting contract, apply, and check the actual candidate. If the content needs correction, revise its declared projection and regenerate; do not hand-edit the result while leaving an inconsistent projection. These commands check structure, source/baseline consistency and equality to the declared result. They do not prove semantic completeness, preservation of old behavior or implementation correctness.
+
+For a simple-Issue change without Proposal SPECs, maintain affected durable files through the normal repository edit and review path. Do not manufacture Proposal/SPEC artifacts just to invoke projection commands. The same semantic reconciliation applies.
+
+## Review with the implementation
+
+Before handoff, inspect the durable diff for missing old constraints, duplicate or conflicting definitions, unauthorized scope and temporary validation details. Report updated capability paths, changed behaviors and unresolved implementation/spec mismatches with the normal implementation handoff. Preserve the project's required checks and human review; do not add a separate archive phase, receipt, reviewer or per-SPEC approval gate.
diff --git a/.agents/skills/issue-spec-workflow/references/planning-scope.md b/.agents/skills/issue-spec-workflow/references/planning-scope.md
new file mode 100644
index 00000000..41bbe7a3
--- /dev/null
+++ b/.agents/skills/issue-spec-workflow/references/planning-scope.md
@@ -0,0 +1,13 @@
+# Requirement scope and verification ownership
+
+Before authoring Proposal SPECs, inspect current code, applicable durable specs and representative tests. Summarize the existing capability, what can be reused, the actual gap or changed behavior, and inherited constraints in the Proposal's existing sections, with repository references. Distinguish observed implementation from intended contracts; do not present unverified assumptions as working capabilities. This is authoring context, not a new artifact or approval step.
+
+Each Proposal SPEC defines a new, changed or corrected observable product contract within the confirmed scope. Explain what must become possible or behave differently on top of that baseline. A new consumer or integration boundary can need a SPEC even when its underlying engine is reused. Keep unchanged capabilities as baseline and inherited contracts as constraints; do not restate them as separate new deliverables unless the change modifies or newly exposes that contract.
+
+WHEN/THEN scenarios describe product inputs, states, outcomes and meaningful failure behavior. They remain precise enough to reject an incorrect implementation, without prescribing private helpers or a test procedure. Platforms and environments belong in SPEC only when they define supported product behavior, not merely where a check happens to run.
+
+Design explains the implementation and overall verification strategy. Its TASKs carry concrete verification work: relevant cases, environment or platform matrix, commands or test entry points, and expected results/evidence. Put this in a Verification subsection of the TASK summary or actionable checklist items while preserving canonical TASK fields. A dedicated integration-validation TASK is useful only when it is a coherent work unit; link it to the actual SPECs it verifies rather than inventing a validation-only SPEC for coverage. If existing behavior only needs evidence, keep that work in the selected Design/TASK or simple Issue; it does not create a new product requirement. A Proposal-only request does not require creating Design or TASK early.
+
+Keep the affected contract self-contained: change scope is incremental, but an implementer must not reconstruct intended behavior from a patch description. Repository durable specs describe the complete current contract after the change, including still-applicable behavior; do not replace them with delta-only notes.
+
+For example, when an existing router gains a headless client, SPEC can require that client's CLI configuration and task-based routing through the existing engine. Existing routing algorithms are baseline unless changed. Running a Linux tool-call journey and collecting the selected-model evidence belongs in a Design TASK; adding Linux as a newly supported product platform would itself be a requirement.
diff --git a/.agents/skills/issue-spec-workflow/release.json b/.agents/skills/issue-spec-workflow/release.json
index a33565a1..e79af7fc 100644
--- a/.agents/skills/issue-spec-workflow/release.json
+++ b/.agents/skills/issue-spec-workflow/release.json
@@ -1,13 +1,13 @@
{
"schema": "issue-spec.generated-workflow/v1",
- "release": "development-1008ee6",
- "source_revision": "1008ee6ec1ae77818ad67de82ac6ea901fa769fa",
+ "release": "development",
+ "source_revision": "6182e4fce4d42bae3a7cace03abc9d4c63967c04",
"requirements_skill_content_id": "sha256:35e55ba3b52b377acbd36ca4305cd958e3bd593008d576a7a82c9b06ab862ed1",
- "content_digest": "sha256:a6db97f59a05379c52889b4c2d5a1efd9f413363c0a4461bd579d51e8eedaaa7",
+ "content_digest": "sha256:3078d78d6f174a3a2233e6c96d3e4defca4c8dea852d449fca2c0915ef42039a",
"files": [
{
"path": ".agents/skills/issue-spec-apply/SKILL.md",
- "sha256": "fc230ae5d6b59c8a20c283540662c8ad0f9efc6136d5c16879b94c04f4050204"
+ "sha256": "3abd84063d2b0968d97f10b997c2fe77b2ac63fc03c593137451c87312d6e148"
},
{
"path": ".agents/skills/issue-spec-github/SKILL.md",
@@ -15,16 +15,24 @@
},
{
"path": ".agents/skills/issue-spec-propose/SKILL.md",
- "sha256": "0a04d83927c496b2ff3b2f7fae827ba0d519312898a837839e7723b40751bf64"
+ "sha256": "618a3b0b8770bf43a9ef42afd243fee705bc18450c5021f892057413466b195b"
},
{
"path": ".agents/skills/issue-spec-workflow/SKILL.md",
"sha256": "d12c41fa6d97680dccf02671ba7f0d954e044bd4602febb382b041e322cab02c"
},
+ {
+ "path": ".agents/skills/issue-spec-workflow/references/durable-maintenance.md",
+ "sha256": "22c082a779ba0de7fa8ec50c90fd4aa4711c365166972ea9ff81707be012aa5c"
+ },
{
"path": ".agents/skills/issue-spec-workflow/references/implementation-review.md",
"sha256": "448cfd953d847f0966aa12f0d880f603272abb73caba9a4709e4c6bf44ee5368"
},
+ {
+ "path": ".agents/skills/issue-spec-workflow/references/planning-scope.md",
+ "sha256": "e61e7e754b3643c4fdaa4e7b7d485f024d66756f77cbbce28a3db6f05306cc1f"
+ },
{
"path": ".agents/skills/issue-spec-workflow/references/progressive-reading.md",
"sha256": "ecdec3c7fa7ab4f32f443d7b9c85ca6f4608b290f271ca01db6767cd53d495f5"
diff --git a/issue-spec/project/planning.md b/issue-spec/project/planning.md
index 5e231816..5a3b8218 100644
--- a/issue-spec/project/planning.md
+++ b/issue-spec/project/planning.md
@@ -2,6 +2,6 @@
Use `hiroute-design-author` for authorized Proposal/Design authoring and its scoped product references. The same current session owns eventual authorized implementation. Authoring does not create a coordinator or another writer/reviewer.
-Keep investigation in a simple Issue until the problem and intended change are confirmed. Proposal/SPEC describe the product outcome, scope/non-goals and observable acceptance; Design/TASK contain executable construction details. Prefer structured choice questions for genuine product or shared-contract tradeoffs, with credible alternatives and a reasoned recommendation. Follow the shared QUESTION guide; do not manufacture options or reopen settled decisions.
+Keep investigation in a simple Issue until the problem and intended change are confirmed. Follow the generated [requirement scope and verification ownership](../../.agents/skills/issue-spec-workflow/references/planning-scope.md) guide for the current capability baseline, Proposal SPEC scope and Design TASK verification. Use HiRoute's code map to locate existing production owners and representative scenarios before defining the required increment. Prefer structured choice questions for genuine product or shared-contract tradeoffs, with credible alternatives and a reasoned recommendation. Follow the shared QUESTION guide; do not manufacture options or reopen settled decisions.
Make Design self-contained around a concrete product case, normal/failure paths, interfaces/state, alternatives, compatibility and verification. TASKs express invariants, dependencies, ownership, shared touchpoints and SPEC coverage; a TASK does not imply another agent or worktree. Follow `hiroute-design-author` for implementation handoff, model/effort constraints and remaining uncertainty. Stop at the authorized phase and return artifacts, decisions and blockers for cross-Proposal alignment.