From d61a7afefa9f1515b8401de1fe75ce0c24c8f396 Mon Sep 17 00:00:00 2001 From: Focus Date: Thu, 5 Nov 2026 18:34:22 +0800 Subject: [PATCH 1/8] =?UTF-8?q?=F0=9F=93=96=20docs=20(workflow):=20grade?= =?UTF-8?q?=20tasks=20into=20tiers=20before=20the=20gates?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- ADOPT.md | 2 +- AGENTS.md | 7 ++-- CHANGELOG.md | 9 +++++ UPGRADE.md | 2 +- book/README.md | 8 +++-- ...de-tasks-into-tiers-before-the-workflow.md | 34 +++++++++++++++++++ book/guidelines/README.md | 6 ++-- book/guidelines/review-checklist.md | 3 +- book/guidelines/task-tiers.md | 32 +++++++++++++++++ book/guidelines/workflow.md | 4 +-- skills/boscope/SKILL.md | 14 ++++++-- 11 files changed, 106 insertions(+), 15 deletions(-) create mode 100644 book/docs/decisions/ADR-008-grade-tasks-into-tiers-before-the-workflow.md create mode 100644 book/guidelines/task-tiers.md diff --git a/ADOPT.md b/ADOPT.md index 27d3434..2409447 100644 --- a/ADOPT.md +++ b/ADOPT.md @@ -18,7 +18,7 @@ Before starting, read in the BoCode repository: `AGENTS.md`, `book/guidelines/wo Copy from the BoCode repository into the project: -- `book/guidelines/` — all of it (README, workflow, writing-style, git-workflow, review-checklist, architecture, coding-style) +- `book/guidelines/` — all of it (README, workflow, task-tiers, writing-style, git-workflow, review-checklist, architecture, coding-style) - `book/docs/README.md`, `book/docs/architecture/README.md`, `book/docs/api/README.md`, `book/docs/decisions/README.md` - `book/notes/README.md`, `book/plans/README.md`, `book/changelogs/README.md` diff --git a/AGENTS.md b/AGENTS.md index 79656c7..1c39e67 100644 --- a/AGENTS.md +++ b/AGENTS.md @@ -27,7 +27,7 @@ This project runs on the **BoCode workflow**: `code/` holds the source, `book/` ## Workflow -Feature development strictly follows the six-phase gate workflow — see `book/guidelines/workflow.md`. +Feature development is graded first: every task is tiered S/M/L per `book/guidelines/task-tiers.md` (the tier lands in the first commit's motive); M/L tasks then strictly follow the six-phase gate workflow — see `book/guidelines/workflow.md`. Git commits and branching strictly follow `book/guidelines/git-workflow.md`: every non-merge commit uses the Clean Commit format; independent big features branch from `dev`; small verified fixes may commit to `dev` directly; PRs serve multi-contributor work and the `dev → main` release, which only ever merges. Never commit or push directly to `main`. @@ -67,8 +67,9 @@ Local commands are disposable and have no production access — npm scripts, tes ## Hard constraints -- Step 0 (the structured requirements brief) is required before any code -- No skipping between phases +- The task tier (S/M/L, `book/guidelines/task-tiers.md`) is decided before any code and recorded in the first commit's motive; S runs the light channel, M/L owe the full pipeline +- Step 0 (the structured requirements brief) is required before any M/L code +- No skipping between phases (M/L) - Phase 2 stops for the user only on real gaps — scope conflict, undetermined data shape, unclear external dependency — never just for confirmation - Problems found in Phase 5 / Phase 6 are **recorded, never fixed** - Feature work touches no code outside its scope: no opportunistic refactors, no new abstractions diff --git a/CHANGELOG.md b/CHANGELOG.md index 2287411..3a80a7b 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -2,6 +2,15 @@ Releases of the BoCode template itself. Adopting projects upgrade by handing [UPGRADE.md](UPGRADE.md) to an agent; each entry lists what changed and what an adopting project must do. History before 2026-11-05 lives in git log and [book/docs/decisions/](book/docs/decisions/) (ADR-001..ADR-004). +## 2026-11-05 — task tiers before the gates (ADR-008) + +Small tasks were paying the full six-gate tax — agents packaged ten-minute fixes as "feature development". Grading is now explicit and comes first, before Step 0. Distilled from adopter feedback (Lighthouse3.0, verified in their repo). + +- Added: `book/guidelines/task-tiers.md` (S/M/L criteria — "any one means at least this tier"; the four hard rules; the always-L mount point), `book/docs/decisions/ADR-008-grade-tasks-into-tiers-before-the-workflow.md` +- Changed: `book/guidelines/workflow.md` (tier-first paragraph; no-skipping scoped to M/L), `AGENTS.md` (hard constraints scoped to M/L; tier recorded in the first commit's motive), `skills/boscope/SKILL.md` (tier-first gate before Step 0, description, constraints), `book/guidelines/review-checklist.md` (eleventh check: task tier too low → issue, never backfill), `book/guidelines/README.md` (routing rows), `UPGRADE.md` and `ADOPT.md` (task-tiers in the template-owned lists) + +**Adopter action:** copy the changed files (Lighthouse3.0 already runs a local task-tiers.md — diff and merge, then declare your always-L list in it); sync translated variants of boscope (e.g. structured-feature-implementation) with the tier-first insertion; run `cd code && npm run book:index`. + ## 2026-11-05 — template updates reach adopters (ADR-007) The upgrade mechanism itself, plus a link-integrity fix. diff --git a/UPGRADE.md b/UPGRADE.md index b9ef3ef..e437ccf 100644 --- a/UPGRADE.md +++ b/UPGRADE.md @@ -10,7 +10,7 @@ The one table that decides everything. Template-owned files get refreshed; proje | Template-owned (refresh) | Project-owned (never touch) | |--------------------------|------------------------------| -| `book/guidelines/{README,workflow,writing-style,git-workflow,review-checklist}.md` | `AGENTS.md`, root `README.md` | +| `book/guidelines/{README,workflow,task-tiers,writing-style,git-workflow,review-checklist}.md` | `AGENTS.md`, root `README.md` | | the `README.md` of every `book/` directory (`docs/`, `docs/decisions/`, `docs/architecture/`, `docs/api/`, `notes/`, `plans/`, `changelogs/`) | `book/guidelines/architecture.md` and `coding-style.md` (project drafts since adoption) | | `skills/` — all four skills plus `skills/README.md` | everything under `book/docs/decisions/`, `book/docs/architecture/`, `book/docs/api/` (the project's own records) | | `code/tools/*.mjs`; the `scripts` block of `code/package.json` (keep the project's `name`) | everything under `book/notes/`, `book/plans/`, `book/changelogs/` | diff --git a/book/README.md b/book/README.md index d155c0c..29cd37c 100644 --- a/book/README.md +++ b/book/README.md @@ -55,15 +55,17 @@ description: Master index of the book — the map of every document. Regenerate - [ADR-005-distill-first-principles-into-design-phases.md](docs/decisions/ADR-005-distill-first-principles-into-design-phases.md) — Musk's first-principles engineering method is woven into the design phases — requirements face a physics test, estimates derive bottom-up, deletion precedes optimization - [ADR-006-distill-experience-first-design-into-phases.md](docs/decisions/ADR-006-distill-experience-first-design-into-phases.md) — Jobs's experience-first craft is woven in beside ADR-005 — the request is a proxy for an experience, design is how it works, focus is saying no, and gates are the polish point - [ADR-007-template-updates-reach-adopters.md](docs/decisions/ADR-007-template-updates-reach-adopters.md) — Template updates reach adopters through a root CHANGELOG, an agent-facing UPGRADE playbook, and a .bocode-version stamp — release-gated by CI; semver rejected, the commit SHA is the baseline +- [ADR-008-grade-tasks-into-tiers-before-the-workflow.md](docs/decisions/ADR-008-grade-tasks-into-tiers-before-the-workflow.md) — Tasks are graded S/M/L before any work — S runs a light channel whose only gate is a one-sentence motive, M/L run Step 0 and all six phases; the tier is decided before Step 0 and recorded in the first commit's motive - [README.md](docs/decisions/README.md) — How to write an ADR here — sections, naming, numbering, and when a decision needs a record ### guidelines/ -- [README.md](guidelines/README.md) — Index of the five guidelines and the input pointer table — which guideline to read for which kind of task, with no blanket pre-reading +- [README.md](guidelines/README.md) — Index of the guidelines and the input pointer table — which guideline to read for which kind of task, with no blanket pre-reading - [architecture.md](guidelines/architecture.md) — Template for your project's long-term architecture rules — boundary invariants, module map, tech baseline, with a worked example of boundary-style rules - [coding-style.md](guidelines/coding-style.md) — Template for your project's coding baseline — the language-specific rules any contributor or agent must follow - [git-workflow.md](guidelines/git-workflow.md) — Clean Commit message format and Clean Flow branch, PR, and merge rules for solo and team development -- [review-checklist.md](guidelines/review-checklist.md) — The ten code-review checks every change must pass — findings are recorded, never fixed in passing +- [review-checklist.md](guidelines/review-checklist.md) — The eleven code-review checks every M/L change must pass — findings are recorded, never fixed in passing +- [task-tiers.md](guidelines/task-tiers.md) — S/M/L task grading — criteria per tier, which channel a change runs, the four hard rules, and the always-L list each adopting project declares - [workflow.md](guidelines/workflow.md) — Six-phase gate workflow with the eight code↔book interaction rules and the document routing table - [writing-style.md](guidelines/writing-style.md) — Plain-language writing standard for every book document — fidelity contract first, then minimal style rules, intensity levels, and a read-back check @@ -75,4 +77,4 @@ description: Master index of the book — the map of every document. Regenerate - [README.md](plans/README.md) — Plans directory usage — implementation plans land here after Phase 2 approval, with naming and the plan template - + diff --git a/book/docs/decisions/ADR-008-grade-tasks-into-tiers-before-the-workflow.md b/book/docs/decisions/ADR-008-grade-tasks-into-tiers-before-the-workflow.md new file mode 100644 index 0000000..a441e5e --- /dev/null +++ b/book/docs/decisions/ADR-008-grade-tasks-into-tiers-before-the-workflow.md @@ -0,0 +1,34 @@ +--- +description: Tasks are graded S/M/L before any work — S runs a light channel whose only gate is a one-sentence motive, M/L run Step 0 and all six phases; the tier is decided before Step 0 and recorded in the first commit's motive +--- + +# ADR-008: Grade tasks into tiers before the workflow + +## Status + +Accepted — 2026-11-05. Ships as `guidelines/task-tiers.md` plus tier-first wording in `workflow.md`, `AGENTS.md`, and the boscope skill. First adopter-fed change: distilled from Lighthouse3.0's 2026-11-05 five-step audit (question the requirement → delete → simplify → accelerate → automate), verified in the adopter's repo before being proposed back. + +## Context + +The six gates were flat: any task entering boscope paid Step 0 plus six phases — a typo included. The observed failure: agents packaged ten-minute tasks as "feature development", producing excess briefs, documents, and gate overhead — process tax inversely proportional to task size. The design intent always allowed grading; the rules never said so: + +- boscope's routing exclusion ("do not use for one-line fixes…") lives at skill selection — once invoked, nothing inside grades first; +- workflow.md read "Every feature moves through these phases in order. No skipping." with no tier semantics; +- "feature" had no defined boundary, so every change qualified. + +## Decision + +- **Tier before Step 0, never a brief slot** — grading inside the brief means the small task already paid the brief tax. The tier is decided before any work and lands in the first commit's motive: auditable from the repository alone. +- **The tier table ships as `guidelines/task-tiers.md`** — criteria are "any one means at least this tier" statements; judgment words ("as appropriate", "case by case") stay out of the criteria column. +- **S is a separate channel, not an M with gates skipped** — motive (why + how verified) → change → self-test → single commit. The one-sentence motive is required, not an exemption: it is the anti-drift replacement for the brief's exclusions slot. +- **Correctness-critical domains are always ≥ L, one line included.** task-tiers.md carries the mount point where each adopting project declares its always-L list; the baseline names generic examples only — no business domains hardcoded. +- **Upgrade is one-way** (finished analysis and design carry over, missing gates run now); **under-grading found in review or wrap-up records an issue**, never a quiet document backfill — an eleventh review-checklist check operationalizes it. +- **"No skipping" narrows to M/L** in workflow.md, AGENTS.md, and boscope. Intent gates (ADR-003) — record-never-fix, scope discipline — stay hard at every tier; they exist for the work's sake, not from distrust of the model. + +## Consequences + +- A typo-class task produces: one-sentence motive + fix + green self-test + one commit — no brief, no phase documents +- A one-line fix touching funds pays full L — by design, not by accident +- Adopters declare an always-L list at adoption/upgrade (the CHANGELOG entry's adopter action says so) +- Translated boscope variants need the same tier-first insertion +- Grading is the agent's obligation, not a right: under-grading is auditable from commit history and records as issues diff --git a/book/guidelines/README.md b/book/guidelines/README.md index ed697e5..e44e87d 100644 --- a/book/guidelines/README.md +++ b/book/guidelines/README.md @@ -1,5 +1,5 @@ --- -description: Index of the five guidelines and the input pointer table — which guideline to read for which kind of task, with no blanket pre-reading +description: Index of the guidelines and the input pointer table — which guideline to read for which kind of task, with no blanket pre-reading --- # Guidelines @@ -9,9 +9,10 @@ The project's development rules. Every contributor — including AI agents — f | File | Content | |------|---------| | `workflow.md` | Six-phase gate workflow and the code↔book interaction rules | +| `task-tiers.md` | S/M/L grading — which channel a change runs and what each tier owes | | `writing-style.md` | Plain-language standard for every book document | | `git-workflow.md` | Clean Commit format and Clean Flow branch/PR/merge rules | -| `review-checklist.md` | The ten code-review checks | +| `review-checklist.md` | The eleven code-review checks | | `architecture.md` | Long-term architecture rules (template — replace per project) | | `coding-style.md` | Language-specific coding baseline (template — replace per project) | @@ -20,6 +21,7 @@ The project's development rules. Every contributor — including AI agents — f | When the task touches… | Read first | |--------|-----------| | Phases, gates, book sync | `workflow.md` | +| Grading a task, which channel it runs | `task-tiers.md` | | Module boundaries, data ownership, tech swaps | `architecture.md` | | The current shape of modules and data flow | `../docs/architecture/` snapshots | | Interface contracts | `../docs/api/` | diff --git a/book/guidelines/review-checklist.md b/book/guidelines/review-checklist.md index 201c349..3eb1949 100644 --- a/book/guidelines/review-checklist.md +++ b/book/guidelines/review-checklist.md @@ -1,5 +1,5 @@ --- -description: The ten code-review checks every change must pass — findings are recorded, never fixed in passing +description: The eleven code-review checks every M/L change must pass — findings are recorded, never fixed in passing --- # Code review checklist @@ -16,6 +16,7 @@ description: The ten code-review checks every change must pass — findings are - [ ] Parts that trace to no requirement (delete before optimize) - [ ] Experience seams treated as design (defaults, empty states, error messages) - [ ] Changes outside the approved scope +- [ ] Task tier too low (the change meets a higher tier's criteria in `task-tiers.md`) — record an issue, never backfill ## Principle diff --git a/book/guidelines/task-tiers.md b/book/guidelines/task-tiers.md new file mode 100644 index 0000000..1a047cc --- /dev/null +++ b/book/guidelines/task-tiers.md @@ -0,0 +1,32 @@ +--- +description: S/M/L task grading — criteria per tier, which channel a change runs, the four hard rules, and the always-L list each adopting project declares +--- + +# Task tiers + +Tier first. Grade every task **before any work** — before Step 0, never as a slot inside the brief (a tier filled in during the brief means the small task already paid the brief tax). The tier is a fact about the change, not a preference; it lands in the first commit's motive and stays auditable from the repository alone. + +S is not "an M with gates skipped" — it is a separate channel with no gates; its one-sentence motive **is** the gate. M and L run the full pipeline in `workflow.md`; gates may pass within one session, never be skipped. + +| Tier | Criteria — any one means at least this tier | Required gates | Doc weight | +|------|---------------------------------------------|----------------|------------| +| **S** small | single file or surface-only change; touches no contract, permission, or funds; no data migration; regression surface visible at a glance | one-sentence motive (why + how verified) → change → self-test green → single commit | none beyond a changelog line | +| **M** medium | a feature or defect inside one functional area; adds or changes API behavior; touches a UI flow; needs new tests | Step 0 brief (half a page is fine) → all six phases | brief + summary, half a page to one page | +| **L** large | crosses functional areas or changes architecture; hits anything on the always-L list below; changes a shared contract; deletes a whole feature area | Step 0 brief, every slot filled in full → all six phases + review checklist + an ADR when impact warrants | full; execution plan into `plans/` | + +## Hard rules + +1. **Correctness-critical domains are always ≥ L, one line of change included.** The list sits in its own section below. +2. **S's one-sentence motive is required, not an exemption.** Why the change + how it will be verified. Can't state it means haven't thought it through — go back. It is the anti-drift replacement for the brief's exclusions slot. +3. **Upgrade is one-way.** Hitting a higher tier's criteria mid-task: stop, re-tier, run the missing gates now — finished analysis and design carry over, missing gates don't. Never "start as S and grow". Catching it yourself owes nothing; that is the rule working. +4. **Under-grading found in review or wrap-up is an issue, never a quiet backfill.** Review checks the tier (`review-checklist.md`); a change that met a higher tier's criteria but ran the lower channel gets recorded in `notes/issue/`. + +## Always-L list — each adopting project declares its own + +Funds/ledger · authn/authz/permissions · verification semantics · schema/data migration · shared contracts — the baseline's generic list. Adopting projects replace or extend it here with their correctness-critical domains; declared once, enforced every time, one line of change included. + +## What stays hard at every tier + +S still owes a single-purpose commit, nothing outside the change, and an honest self-test. For S, the book interaction rules (`workflow.md`) shrink to the changelog line — no learn search, no plan status, no summary owed. Record-never-fix and scope discipline are intent gates (ADR-003) — they exist for the work's sake, not from distrust of the agent, so no tier softens them. S corresponds to the small-fix direct-commit path in `git-workflow.md`; M and L branch per the same file. + +Distilled from adopter feedback (Lighthouse3.0, 2026-11-05); the reasoning lives in ADR-008, in the BoCode repository's `book/docs/decisions/`. diff --git a/book/guidelines/workflow.md b/book/guidelines/workflow.md index 6bde44d..3c66a6c 100644 --- a/book/guidelines/workflow.md +++ b/book/guidelines/workflow.md @@ -6,7 +6,7 @@ description: Six-phase gate workflow with the eight code↔book interaction rule ## Development process — six phases, hard gates -Every feature moves through these phases in order. **No skipping.** +Grade the task first — S, M, or L per `task-tiers.md`; the tier is decided before any work and lands in the first commit's motive. S runs the light channel and never enters this table. Every M/L feature moves through these phases in order. **No skipping.** | Phase | Name | Output | Gate | |------|------|--------|------| @@ -18,7 +18,7 @@ Every feature moves through these phases in order. **No skipping.** | Phase 5 | Code review | Review findings | Record only — no fixes | | Phase 6 | Wrap-up | Docs, learnings, issues | Record only — no fixes | -Step 0 comes before any code. Fill the brief: background, scope (what it affects, what it explicitly does **not** affect, and the boundaries), and the requirement itself. An empty "does not affect" list is the number-one cause of out-of-scope changes in Phase 3 — the exclusions slot is required. Requirements arrive as suggestions; physics is the only law — correctness, data integrity, and the user's explicit hard constraints don't negotiate, while convention, past practice, and "how it's done" do. Question the inherited HOW; the user's WHAT holds (reasoning and sources in ADR-005, in the BoCode repository's `book/docs/decisions/`). The stated request is a proxy — the experience behind it is the requirement: capture what the user will see, do, and get. Focus is saying no; the exclusions slot gives the feature its shape (ADR-006). +Step 0 comes before any code (M and L). Fill the brief: background, scope (what it affects, what it explicitly does **not** affect, and the boundaries), and the requirement itself. An empty "does not affect" list is the number-one cause of out-of-scope changes in Phase 3 — the exclusions slot is required. Requirements arrive as suggestions; physics is the only law — correctness, data integrity, and the user's explicit hard constraints don't negotiate, while convention, past practice, and "how it's done" do. Question the inherited HOW; the user's WHAT holds (reasoning and sources in ADR-005, in the BoCode repository's `book/docs/decisions/`). The stated request is a proxy — the experience behind it is the requirement: capture what the user will see, do, and get. Focus is saying no; the exclusions slot gives the feature its shape (ADR-006). Phase 2 produces the full design — data flow, file list, interfaces — and proceeds; it stops for the user only when a real gap appears (scope conflict, undetermined data shape, unclear external dependency), never just for confirmation. Designs and estimates derive bottom-up from primitives — what the data and code actually are — never by analogy to last time; delete what no requirement calls for before optimizing anything that remains. Design is how it works — the surfaces the user touches (defaults, empty states, error messages) are designed with the data flow, never decorated after it (ADR-006). diff --git a/skills/boscope/SKILL.md b/skills/boscope/SKILL.md index 1c20782..0783cc3 100644 --- a/skills/boscope/SKILL.md +++ b/skills/boscope/SKILL.md @@ -1,6 +1,6 @@ --- name: boscope -description: BoCode's feature-development skill(中文名:薄界)— scope it thin, gate it hard. Splits a feature into a Step-0 structured requirements brief plus six hard-gated phases (analysis, design, implementation, testing, review, wrap-up). Use when the user asks to implement/add/support/change a feature and the request is sparse — missing background, scope, or detailed logic. Do not use for one-line fixes, typos, pure questions, or tasks whose scope the user has already fully specified. +description: BoCode's feature-development skill(中文名:薄界)— scope it thin, gate it hard, grade it first. First move inside: grade the task S/M/L (guidelines/task-tiers.md) — S exits to a light channel (one-sentence motive → change → self-test → single commit); M/L run a Step-0 structured requirements brief plus six hard-gated phases (analysis, design, implementation, testing, review, wrap-up). Use when the user asks to implement/add/support/change a feature and the request is sparse — missing background, scope, or detailed logic. Do not use for one-line fixes outside the always-L list, typos, pure questions, or tasks whose scope the user has already fully specified. --- # BoScope(薄界) @@ -11,10 +11,19 @@ Scope it thin. Gate it hard. ## Goal -Split a feature into **brief → six phases**, each phase a hard gate. Fill a structured requirements brief before touching code, and proactively raise the design axes the user didn't mention. Then move phase by phase — no skipping. +Grade the task first (tier first, below). An M/L feature then splits into **brief → six phases**, each phase a hard gate. Fill a structured requirements brief before touching code, and proactively raise the design axes the user didn't mention. Then move phase by phase — no skipping. **Core principle:** a request that says *what* but not *why / scope / boundaries* is not ready for code. Fill the gaps first; then surface the axes the user didn't know were missing. +## Tier first — grade before anything (REQUIRED — before Step 0) + +Grade the task against the tier table in `book/guidelines/task-tiers.md` (the criteria live there, not here — this project's copy, with its always-L list). The tier is a fact about the change, not a preference; it lands in the first commit's motive. + +- **S** — the light channel; this skill's phases never start: one-sentence motive (why + how verified) → change → self-test green → single commit. No brief, no phase docs — the changelog line is the only paperwork owed. +- **M / L** — continue to Step 0 and the six phases below. +- **Upgrade is one-way.** Hitting a higher tier's criteria mid-task: stop, re-tier, run the missing gates now — finished analysis and design carry over. +- Grading is an obligation, not a right: review finding the tier too low records an issue (`book/guidelines/review-checklist.md`), never a quiet backfill. + ## Step 0: the requirements brief (REQUIRED — before any code) Render the brief below and fill every slot. For empty slots you have two duties: @@ -100,6 +109,7 @@ Write back to the book: plan status, summary, learn entries, new issues, changel ## Constraints +- Tier before Step 0, the tier riding in the first commit's motive — S runs the light channel and never enters the phases; M/L skip none - Step 0 before any code, every brief slot filled - No skipping phases; every REQUIRED gate met before the next - Phase 2 design and Phase 3 scope boundaries advance only with explicit user approval From c6e0a33ae4eeaa6e7dacc8a50508069bc060ce75 Mon Sep 17 00:00:00 2001 From: Focus Date: Fri, 6 Nov 2026 00:15:01 +0800 Subject: [PATCH 2/8] =?UTF-8?q?=F0=9F=93=96=20docs=20(bowrite):=20voice=20?= =?UTF-8?q?rules=20on=20every=20write,=20conditions=20in=20the=20fidelity?= =?UTF-8?q?=20contract?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- CHANGELOG.md | 9 ++++++ book/README.md | 3 +- .../ADR-009-bowrite-voice-on-every-write.md | 31 +++++++++++++++++++ book/docs/decisions/README.md | 2 ++ book/guidelines/writing-style.md | 1 + book/notes/README.md | 2 ++ skills/book-writeback/SKILL.md | 2 +- skills/bowrite/SKILL.md | 23 ++++++++------ 8 files changed, 61 insertions(+), 12 deletions(-) create mode 100644 book/docs/decisions/ADR-009-bowrite-voice-on-every-write.md diff --git a/CHANGELOG.md b/CHANGELOG.md index 3a80a7b..704dc67 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -2,6 +2,15 @@ Releases of the BoCode template itself. Adopting projects upgrade by handing [UPGRADE.md](UPGRADE.md) to an agent; each entry lists what changed and what an adopting project must do. History before 2026-11-05 lives in git log and [book/docs/decisions/](book/docs/decisions/) (ADR-001..ADR-004). +## 2026-11-06 — bowrite's voice rules on every write (ADR-009) + +The skill could de-water a text but rarely made it human: voice rules were scoped to from-scratch drafts while most project writing is revision, and thinning could silently cut conditions(仅当/除非/不适用于)— facts survived, their boundaries didn't. + +- Added: `book/docs/decisions/ADR-009-bowrite-voice-on-every-write.md` +- Changed: `skills/bowrite/SKILL.md` (voice rules universal; conditions join the fidelity contract; read-back gains a regular voice pass; the skill thinned by its own rules — the 把书读薄 story once, the duplicated rule merged into the ledger); `book/guidelines/writing-style.md` (same conditions clause, keeping the fallback in sync); `skills/book-writeback/SKILL.md` (names bowrite, writing-style.md as fallback); `book/notes/README.md` and `book/docs/decisions/README.md` (style stated at the templates) + +**Adopter action:** copy the five changed files; if you localized bowrite, port the same four changes (voice scope, conditions clause, voice read-back pass, self-thinning); regenerate the index. + ## 2026-11-05 — task tiers before the gates (ADR-008) Small tasks were paying the full six-gate tax — agents packaged ten-minute fixes as "feature development". Grading is now explicit and comes first, before Step 0. Distilled from adopter feedback (Lighthouse3.0, verified in their repo). diff --git a/book/README.md b/book/README.md index 29cd37c..92ffeed 100644 --- a/book/README.md +++ b/book/README.md @@ -56,6 +56,7 @@ description: Master index of the book — the map of every document. Regenerate - [ADR-006-distill-experience-first-design-into-phases.md](docs/decisions/ADR-006-distill-experience-first-design-into-phases.md) — Jobs's experience-first craft is woven in beside ADR-005 — the request is a proxy for an experience, design is how it works, focus is saying no, and gates are the polish point - [ADR-007-template-updates-reach-adopters.md](docs/decisions/ADR-007-template-updates-reach-adopters.md) — Template updates reach adopters through a root CHANGELOG, an agent-facing UPGRADE playbook, and a .bocode-version stamp — release-gated by CI; semver rejected, the commit SHA is the baseline - [ADR-008-grade-tasks-into-tiers-before-the-workflow.md](docs/decisions/ADR-008-grade-tasks-into-tiers-before-the-workflow.md) — Tasks are graded S/M/L before any work — S runs a light channel whose only gate is a one-sentence motive, M/L run Step 0 and all six phases; the tier is decided before Step 0 and recorded in the first commit's motive +- [ADR-009-bowrite-voice-on-every-write.md](docs/decisions/ADR-009-bowrite-voice-on-every-write.md) — bowrite's voice rules now run on every write, not just from-scratch drafts; conditions and exceptions join the fidelity contract's never-move list; the writeback path names bowrite explicitly - [README.md](docs/decisions/README.md) — How to write an ADR here — sections, naming, numbering, and when a decision needs a record ### guidelines/ @@ -77,4 +78,4 @@ description: Master index of the book — the map of every document. Regenerate - [README.md](plans/README.md) — Plans directory usage — implementation plans land here after Phase 2 approval, with naming and the plan template - + diff --git a/book/docs/decisions/ADR-009-bowrite-voice-on-every-write.md b/book/docs/decisions/ADR-009-bowrite-voice-on-every-write.md new file mode 100644 index 0000000..62279e6 --- /dev/null +++ b/book/docs/decisions/ADR-009-bowrite-voice-on-every-write.md @@ -0,0 +1,31 @@ +--- +description: bowrite's voice rules now run on every write, not just from-scratch drafts; conditions and exceptions join the fidelity contract's never-move list; the writeback path names bowrite explicitly +--- + +# ADR-009: bowrite's voice rules run on every write + +## Status + +Accepted — 2026-11-06. Ships as a bowrite revision plus a writing-style.md sync and writeback wiring. Found in a user-driven audit of the skill's real output. + +## Context + +Three defects, one root: the skill could de-water a text but rarely made it human. + +- **Voice rules were scoped to from-scratch drafts** ("Voice and rhythm — for from-scratch writing") while most project writing — summaries, learn entries, issues, changelogs — is revision-path. On that path bowrite carried only negative lists (cut on sight, the pattern ledger): noise got removed, the remaining sentences kept machine rhythm. +- **The fidelity contract didn't protect conditions**(仅当 / 除非 / 不适用于). Thinning cut them as if they were modifiers: the fact survived, its boundary vanished — and the read-back couldn't catch it, because protected spans didn't include them. +- **The main prose path never loaded the skill**: book-writeback deferred to writing-style.md only, and the notes/decisions README templates said nothing about style at the point of writing. The skill itself also failed its own compression test — the 把书读薄 story appeared three times, and one rule lived in two places. + +## Decision + +- **Voice rules are universal.** 主干早出, keyword discipline, length breathing, 白话打底 run on revisions and from-scratch drafts alike; only the structure pair (know who is speaking, answer the reader's next question) stays from-scratch. Read-back gains a regular **voice pass** in place of the "only if it still smells" residue check. +- **Conditions, prerequisites, exceptions, and scope of application join the never-move list** — in the skill and in the writing-style.md fallback, same wording: cutting one doesn't remove a fact, it removes the fact's boundary. +- **The writeback path carries the skill by name**: book-writeback routes through bowrite(writing-style.md as the no-skill fallback); the notes/ and decisions/ READMEs state the standard at the templates. +- **The skill passed its own thinning**: the 把书读薄 story now appears once, the duplicated 不是X而是Y rule keeps only its more specific copy (the ledger entry with examples), golden-tail sentences cut. + +## Consequences + +- Revisions now humanize, not just shrink — the thinning and well mandates finally run together everywhere +- Thinning can no longer silently unbound a claim; the read-back checks conditions alongside numbers and names +- Every writeback-producing surface names its style rule at the point of writing +- The pattern ledger stays the single home for found patterns; cut-on-sight stays a bare list with no examples diff --git a/book/docs/decisions/README.md b/book/docs/decisions/README.md index f70e550..0c7fa53 100644 --- a/book/docs/decisions/README.md +++ b/book/docs/decisions/README.md @@ -26,3 +26,5 @@ An architecture decision record answers the question future readers — humans a `ADR-NNN-.md`, numbering monotonically up, never reused. A decision that reverses an earlier ADR gets a new number and flips the old one to "Superseded by ADR-NNN". ADR-001 in the BoCode repository is a worked example. + +ADR prose follows the project standard — thin and well: the `bowrite` skill(薄写)when loaded, `guidelines/writing-style.md` otherwise. diff --git a/book/guidelines/writing-style.md b/book/guidelines/writing-style.md index ea84e0d..4de2983 100644 --- a/book/guidelines/writing-style.md +++ b/book/guidelines/writing-style.md @@ -15,6 +15,7 @@ No rewrite may add facts, drop core facts, or change who is responsible. The fol - Numbers, versions, dates, commands, API names, parameter names, field names, config keys, logs, error messages - Code blocks, table data, directory structures - System-behavior subjects, domain terms, ADR conclusions, responsibility attribution (who did what, in what state) +- Conditions, prerequisites, exceptions, and scope of application(仅当、除非、不适用于)— cutting one doesn't remove a fact, it removes the fact's boundary - When a quantitative claim is ambiguous, keep the original relationship and flag it for confirmation — never add counts, years, or measurements the source doesn't have - Predicate strength must not drift: "improved performance" must not soften into "touches performance"; "saves time" must not grow into "saves time and money" diff --git a/book/notes/README.md b/book/notes/README.md index e4ecf70..2efa7f8 100644 --- a/book/notes/README.md +++ b/book/notes/README.md @@ -25,6 +25,8 @@ Obsidian can open `book/` directly as a vault; existing links are plain relative ## Templates +Every entry is written thin and well — the `bowrite` skill(薄写)when loaded, `guidelines/writing-style.md` otherwise. + ### summary — a report a human can read without opening the code ```markdown diff --git a/skills/book-writeback/SKILL.md b/skills/book-writeback/SKILL.md index 65a716c..0fdbf20 100644 --- a/skills/book-writeback/SKILL.md +++ b/skills/book-writeback/SKILL.md @@ -84,7 +84,7 @@ Flip `status:` to `completed` (or `in_progress`) so the blueprint doubles as the 1. Every new file carries frontmatter `description`. 2. Regenerate the index: `cd code && npm run book:index` — zero warnings or it didn't happen. -3. Writing follows `book/guidelines/writing-style.md`: plain language, fidelity contract above style (numbers, commands, names, and responsibility attribution never move). +3. Writing runs the **bowrite** skill(薄写 — thin and well, voice included); `book/guidelines/writing-style.md` is the fallback when no skill is loaded. ## Quality bar diff --git a/skills/bowrite/SKILL.md b/skills/bowrite/SKILL.md index e09be3e..3301e2c 100644 --- a/skills/bowrite/SKILL.md +++ b/skills/bowrite/SKILL.md @@ -27,6 +27,7 @@ No rewrite may add facts, drop core facts, or change who is responsible. The fol - Numbers, versions, dates, commands, API names, parameter names, field names, config keys, logs, error messages - Code blocks, table data, directory structures, links - System-behavior subjects, domain terms, ADR conclusions, responsibility attribution +- Conditions, prerequisites, exceptions, and scope of application(`仅当`、`除非`、`不适用于`)— cutting one doesn't remove a fact, it removes the fact's boundary; the claim survives unlimited - Predicate strength: "improved performance" never softens to "touches performance"; `性能提升` never dilutes to `涉及性能` - Ambiguous quantities stay as-is and get flagged, never "rounded" into new claims @@ -34,7 +35,7 @@ Thinning that loses facts isn't thinning — it's damage. ## How to write it thin — the method -把书读薄 is a reading craft: strip the book until its skeleton shows, then retell it with the book closed. Writing thin runs the same craft at writing time. Six moves, in order: +Six moves, in order: ### 1. 提骨架 — extract the skeleton @@ -54,7 +55,7 @@ Adjectives and adverbs convert into concrete facts or get cut: `非常快` → h ### 5. 复述检验 — the retell test -Thin it, read it once, close it, retell the core. What you can retell is the core that survived; what you can't means you cut into it — put that back. **内容变少,核心没变——核心保没保住,复述说了算。** This is 把书读薄's own test, applied at writing time. +Thin it, read it once, close it, retell the core. What you can retell is the core that survived; what you can't means you cut into it — put that back. ### 6. 段段有新货 — every paragraph pays new material @@ -80,7 +81,6 @@ Same facts survive — 三天、全部、120 篇. What got cut is the rent-free - Intensifier clusters(`重要 / 关键 / 核心 / significant`)→ the concrete fact behind them - Nominalized verbs(`进行 / 实现 / 完成` + 动名词)→ the action and its measure - Long attributive chains → short subjects, direct verbs -- 二元对比骨架(`不是 X,而是 Y`)usually keeps only Y ## How to write it well — the pattern ledger @@ -143,13 +143,16 @@ An opening paragraph that previews the document often restates the first section - Found: 引言说"每开一个新会话都从零开始",问题 1 又说"每个会话从零开始"——引言留钩子,事实归问题 1。 -## Voice and rhythm — for from-scratch writing +## Voice and rhythm — every document + +These run on revisions and from-scratch drafts alike — thinning removes the noise, voice is what makes what remains human. -- **Know who is speaking, and why now.** A document has an author with a position: what they did, what they checked, what they are still unsure of. State the load-bearing ones once each; don't perform an author. -- **Answer the reader's next question.** Write each section as the answer to what the previous section raised. Background arrives where it explains a choice — not up front to prove the writer knows a lot. - **主干早出**: subject and verb before their modifiers. `在经历了长达数年的……以后,最终促使他改变方向的,是一次邀请` → 他折腾了几年没挣到钱;后来老同事找过来,他才换了方向。 - **Repeat the right word.** The keyword stays the keyword(`修表` stays `修表`)— upgrading it to `这门手艺` then `这项技能` is model-speak. -- **Let lengths breathe.** A ten-character sentence next to a forty-character one is human; all-even sentences sound like a machine keeping time. 白话打底 — plain speech carries it; ornate archaism doesn't. +- **Let lengths breathe.** A ten-character sentence next to a forty-character one is human; all-even sentences sound like a machine keeping time. +- **白话打底** — plain speech carries it; ornate archaism doesn't. + +**From-scratch drafts also:** know who is speaking and why now — an author with a position: what they did, what they checked, what they are still unsure of; state the load-bearing ones once each, don't perform an author. And answer the reader's next question — each section is the answer to what the previous one raised; background arrives where it explains a choice, not up front to prove the writer knows a lot. ## Hard bans — from-scratch public prose only @@ -161,11 +164,11 @@ A public long-form piece(帖、公众号文章、知乎回答)drafted from s - No `——`; colons only to introduce a direct quote(`一句话总结:` is banned). - No business-report jargon: `赋能、抓手、闭环、底层逻辑、颗粒度、组合拳` → people, actions, money, time, consequences. -## Read-back — three passes before done +## Read-back — passes before done -1. **Fidelity**: protected spans intact, no facts lost, terms stable, nothing reads broken after the cuts. +1. **Fidelity**: protected spans intact — numbers, names, terms, conditions and exceptions — no facts lost, nothing reads broken after the cuts. 2. **Thinness**: what got removed — words, or information? Content shrinks, core doesn't. If the core shrank, put it back. -3. **Residue** (only if it still smells): openers, summary-closers, emphasis formulas, cleverness, over-even rhythm. +3. **Voice**: would a specific person say this sentence, in this situation, to this reader? Openers, summary-closers, emphasis formulas, cleverness, over-even rhythm get rewritten. 4. **From-scratch deliverables** (public prose drafted here): the material gate was passed before writing, forward motion holds(段段有新货), and the hard bans are clear. The finish line is "ready to send" — not "sounds human". Stop there. From e03ebd5f2547ad455edf524146f0292ecb8e57ab Mon Sep 17 00:00:00 2001 From: Focus Date: Fri, 6 Nov 2026 00:19:21 +0800 Subject: [PATCH 3/8] =?UTF-8?q?=F0=9F=93=A6=20new=20(tools):=20archive=20t?= =?UTF-8?q?asks=20and=20issues=20by=20status=20in=20the=20index?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit S-tier. Motive: handled task/issue entries were indistinguishable from the outside. Archive = flip the frontmatter status and regenerate the index (ADR-010); files never move, so links never break. Verified: grouped rendering (open first), missing/invalid status fails the build, book:index and book:release-check both green. --- CHANGELOG.md | 9 +++ book/README.md | 6 +- ...hive-by-status-flip-not-by-moving-files.md | 26 ++++++ book/notes/README.md | 10 ++- code/tools/gen-book-index.mjs | 79 ++++++++++++++++--- 5 files changed, 118 insertions(+), 12 deletions(-) create mode 100644 book/docs/decisions/ADR-010-archive-by-status-flip-not-by-moving-files.md diff --git a/CHANGELOG.md b/CHANGELOG.md index 704dc67..4d9a734 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -2,6 +2,15 @@ Releases of the BoCode template itself. Adopting projects upgrade by handing [UPGRADE.md](UPGRADE.md) to an agent; each entry lists what changed and what an adopting project must do. History before 2026-11-05 lives in git log and [book/docs/decisions/](book/docs/decisions/) (ADR-001..ADR-004). +## 2026-11-06 — tasks and issues archive by status (ADR-010) + +Handled and unhandled entries were indistinguishable from the outside; the tempting fix — a folder files move into — breaks the book's relative links. Archiving is now a status flip. + +- Added: `book/docs/decisions/ADR-010-archive-by-status-flip-not-by-moving-files.md` +- Changed: `code/tools/gen-book-index.mjs` (parses a frontmatter `status` in `notes/task/` and `notes/issue/`, validates `open|done` / `open|resolved`, lists open entries first; missing or unknown status warns and exits 1); `book/notes/README.md` (status convention, wrap-up step flips statuses, `status: open` in the task and issue templates) + +**Adopter action:** copy the two changed files; add a `status` line (`open`, `done`, or `resolved`) to every existing task and issue entry — the index build fails without it; rerun `cd code && npm run book:index`. + ## 2026-11-06 — bowrite's voice rules on every write (ADR-009) The skill could de-water a text but rarely made it human: voice rules were scoped to from-scratch drafts while most project writing is revision, and thinning could silently cut conditions(仅当/除非/不适用于)— facts survived, their boundaries didn't. diff --git a/book/README.md b/book/README.md index 92ffeed..d2d7427 100644 --- a/book/README.md +++ b/book/README.md @@ -5,13 +5,14 @@ description: Master index of the book — the map of every document. Regenerate # book — bocode master index > Generated by a script — do not edit by hand. After any book change run: `cd code && npm run book:index`. -> Every new file must carry a frontmatter `description` (one plain-language line about the content, not the genre); the build warns and exits 1 otherwise. +> Every new file must carry a frontmatter `description` (one plain-language line about the content, not the genre); entries under `notes/task/` and `notes/issue/` also need a `status` (`open|done` / `open|resolved`); the build warns and exits 1 otherwise. ## How to use this book - **AI agents**: read this file first for the full map, then follow links to what you need. Before writing any book document, read `guidelines/writing-style.md`. - **Humans**: browse by the directory table below. Rules live in `guidelines/`, blueprints in `plans/`, experience in `notes/learn/`, architecture in `docs/architecture/`, decisions in `docs/decisions/`. - **By time**: `changelogs/` and `notes/{summary,learn,issue}/` archive under `YYYY-MM/`; the month is a physical grouping only — do not nest deeper by feature. +- **By status**: entries in `notes/task/` and `notes/issue/` carry a frontmatter `status`; this index lists open entries first — flipping the field and rerunning is the archive step. - **By feature**: search this index for a feature name, keyword, or frontmatter summary; `notes/learn/` entries are also searchable by their `tags`. - **Obsidian**: open `book/` directly as a vault. Links are plain relative Markdown; if you move files, rerun the index. @@ -57,6 +58,7 @@ description: Master index of the book — the map of every document. Regenerate - [ADR-007-template-updates-reach-adopters.md](docs/decisions/ADR-007-template-updates-reach-adopters.md) — Template updates reach adopters through a root CHANGELOG, an agent-facing UPGRADE playbook, and a .bocode-version stamp — release-gated by CI; semver rejected, the commit SHA is the baseline - [ADR-008-grade-tasks-into-tiers-before-the-workflow.md](docs/decisions/ADR-008-grade-tasks-into-tiers-before-the-workflow.md) — Tasks are graded S/M/L before any work — S runs a light channel whose only gate is a one-sentence motive, M/L run Step 0 and all six phases; the tier is decided before Step 0 and recorded in the first commit's motive - [ADR-009-bowrite-voice-on-every-write.md](docs/decisions/ADR-009-bowrite-voice-on-every-write.md) — bowrite's voice rules now run on every write, not just from-scratch drafts; conditions and exceptions join the fidelity contract's never-move list; the writeback path names bowrite explicitly +- [ADR-010-archive-by-status-flip-not-by-moving-files.md](docs/decisions/ADR-010-archive-by-status-flip-not-by-moving-files.md) — task and issue entries archive by flipping a frontmatter status and regenerating the index — files never move, the index regroups with open entries first - [README.md](docs/decisions/README.md) — How to write an ADR here — sections, naming, numbering, and when a decision needs a record ### guidelines/ @@ -78,4 +80,4 @@ description: Master index of the book — the map of every document. Regenerate - [README.md](plans/README.md) — Plans directory usage — implementation plans land here after Phase 2 approval, with naming and the plan template - + diff --git a/book/docs/decisions/ADR-010-archive-by-status-flip-not-by-moving-files.md b/book/docs/decisions/ADR-010-archive-by-status-flip-not-by-moving-files.md new file mode 100644 index 0000000..f895036 --- /dev/null +++ b/book/docs/decisions/ADR-010-archive-by-status-flip-not-by-moving-files.md @@ -0,0 +1,26 @@ +--- +description: task and issue entries archive by flipping a frontmatter status and regenerating the index — files never move, the index regroups with open entries first +--- + +# ADR-010: Archive by status flip, not by moving files + +## Status + +Accepted — 2026-11-06. Ships as status parsing, validation, and grouped listing in `code/tools/gen-book-index.mjs`, plus the status convention and templates in `book/notes/README.md`. + +## Context + +Task and issue entries accumulate, and a reader opening the folders cannot tell handled from unhandled. The obvious fix is an archive folder files move into when done — but the book doubles as an Obsidian vault: retrieval runs through `book/README.md`, frontmatter, and relative links, and moving files breaks inbound links. Month folders (`YYYY-MM/`) are physical grouping only; the book's own rule is retrieval through the index, never through directory nesting. + +## Decision + +- Archive is a field, not a location. `notes/task/` entries carry `status: open|done`, `notes/issue/` entries `status: open|resolved`; handling an entry means flipping the field and rerunning `npm run book:index`. +- The index is the archive view: `gen-book-index.mjs` lists open entries first and handled entries after, so unhandled work is visible from `book/README.md` without opening folders. +- The build enforces the vocabulary the same way it enforces `description`: missing or unknown status in task/issue warns and exits 1. + +## Consequences + +- Zero link breakage: files never move after creation +- Open work is one glance away in the index; Obsidian users can also filter by the `status` property directly +- Adopters with existing task/issue entries must add a `status` line to each on upgrade (the CHANGELOG entry says so) +- The vocabulary is fixed at two states per type; a richer lifecycle (wontfix, blocked) means a new ADR, not a silent script edit diff --git a/book/notes/README.md b/book/notes/README.md index 2efa7f8..c124f22 100644 --- a/book/notes/README.md +++ b/book/notes/README.md @@ -8,6 +8,8 @@ All running records of the project. Each subfolder has one purpose, and everythi `summary/`, `learn/`, and `issue/` archive under `YYYY-MM/`. The month is a stable, low-maintenance physical grouping; feature relationships live in filenames, frontmatter, and links in the text — never in deeper directory nesting. +Tasks and issues archive **by status, not by moving files** (ADR-010). Both carry a frontmatter `status` — `open` when created, `done` (task) or `resolved` (issue) when handled. Flipping the field and rerunning the index is the whole archive step: `book/README.md` regroups with open entries first; files never move, so links never break. + | Folder | Use | Written when | |--------|-----|--------------| | `learn/` | Experience and lessons | During coding, and at Phase 6 wrap-up | @@ -19,7 +21,7 @@ All running records of the project. Each subfolder has one purpose, and everythi 1. Read `book/README.md` first; locate documents by feature name, keyword, or summary. 2. Then read the specific type and month. -3. Before coding, search `learn` first; at wrap-up, write the feature's outcome, experience, and open problems to `summary`, `learn`, and `issue` respectively. +3. Before coding, search `learn` first; at wrap-up, write the feature's outcome, experience, and open problems to `summary`, `learn`, and `issue` respectively — and flip the `status` of whatever it closes (`done` / `resolved`). Obsidian can open `book/` directly as a vault; existing links are plain relative Markdown. @@ -63,6 +65,7 @@ Tags drive retrieval — write the words you'd search for later, including sympt ```markdown --- description: +status: open --- # @@ -71,14 +74,19 @@ description: - **Suggested direction**: what a fix would probably touch — recorded only ``` +Flip `status` to `resolved` only when the fix has landed; the index then moves the entry out of Open. + ### task — a checklist that tracks a piece of work ```markdown --- description: +status: open --- # - [ ] - [x] ``` + +Flip `status` to `done` when the last box is checked; the index then moves the entry out of Open. diff --git a/code/tools/gen-book-index.mjs b/code/tools/gen-book-index.mjs index 7698e10..589e8d2 100755 --- a/code/tools/gen-book-index.mjs +++ b/code/tools/gen-book-index.mjs @@ -11,6 +11,10 @@ * one-line, plain-language summary. Missing → warning, exit 1. * 2. Internal links must resolve. Broken relative links → warning, exit 1 — * the book doubles as an Obsidian vault, so a broken link is a build bug. + * 3. Entries under notes/task/ and notes/issue/ carry a frontmatter + * `status` — `open|done` (task) or `open|resolved` (issue). Missing or + * unknown → warning, exit 1. The index lists open entries first, so + * flipping the field and rerunning is the archive step (ADR-010). * Zero dependencies; runs on plain Node (and bun). */ import { readdirSync, readFileSync, writeFileSync, existsSync } from "node:fs"; @@ -44,11 +48,27 @@ const DIR_PURPOSE = { notes: "Running records: learn / summary / task / issue", "notes/learn": "Experience and lessons; read before coding", "notes/summary": "Feature reports, written for humans", - "notes/task": "Task tracking and breakdowns", - "notes/issue": "Potential problems — recorded, never auto-fixed", + "notes/task": "Task tracking and breakdowns (status: open|done)", + "notes/issue": "Potential problems — recorded, never auto-fixed (status: open|resolved)", plans: "Implementation plans: the construction blueprint agents build from", }; +// Sections whose entries carry a frontmatter `status` and are grouped by it in +// the index (open first, handled after) instead of listed per subdirectory — +// the index is the archive view; files never move (ADR-010). +const STATUS_SECTIONS = [ + { root: "notes/task", handled: "done", handledLabel: "Done" }, + { root: "notes/issue", handled: "resolved", handledLabel: "Resolved" }, +]; + +function statusSectionFor(dir) { + return ( + STATUS_SECTIONS.find( + (s) => dir === s.root || dir.startsWith(`${s.root}/`) + ) ?? null + ); +} + function purposeForDir(dir) { if (DIR_PURPOSE[dir]) return DIR_PURPOSE[dir]; const parent = Object.keys(DIR_PURPOSE) @@ -79,6 +99,17 @@ function parseDescription(text) { return null; } +function parseStatus(text) { + if (!text.startsWith("---")) return null; + const lines = text.split("\n"); + for (let i = 1; i < lines.length; i++) { + if (lines[i].trim() === "---") return null; // frontmatter ended, not found + const m = lines[i].match(/^status:\s*(\S+)\s*$/); + if (m) return m[1]; + } + return null; +} + function collectInternalLinks(text) { const out = []; const re = /(?:\]\(<([^>]+)>\)|\]\(([^)\s]+)\))/g; @@ -99,6 +130,7 @@ const files = walkMd(BOOK_ROOT) .sort(); const warnings = []; +const statusWarnings = []; const brokenLinks = []; const byDir = new Map(); @@ -108,12 +140,22 @@ for (const abs of files) { const text = readFileSync(abs, "utf8"); const desc = parseDescription(text); if (!desc) warnings.push(rel); + const section = statusSectionFor(dir); + let status = null; + if (section) { + status = parseStatus(text); + const allowed = ["open", section.handled]; + if (!status) statusWarnings.push(`${rel} (missing status)`); + else if (!allowed.includes(status)) + statusWarnings.push(`${rel} (status '${status}', expected ${allowed.join(" | ")})`); + } for (const target of collectInternalLinks(text)) { const resolved = resolve(dirname(abs), target); if (!existsSync(resolved)) brokenLinks.push(`${rel} → ${target}`); } - if (!byDir.has(dir)) byDir.set(dir, []); - byDir.get(dir).push({ name: rel.split("/").pop(), rel, desc: desc ?? "(missing description)" }); + const key = section ? section.root : dir; + if (!byDir.has(key)) byDir.set(key, []); + byDir.get(key).push({ name: rel.split("/").pop(), rel, desc: desc ?? "(missing description)", status }); } const dirKeys = [...byDir.keys()].sort((a, b) => a.localeCompare(b, "en")); @@ -124,11 +166,12 @@ out += "description: Master index of the book — the map of every document. Reg out += "---\n\n"; out += `# book — ${NAME} master index\n\n`; out += "> Generated by a script — do not edit by hand. After any book change run: `cd code && npm run book:index`.\n"; -out += "> Every new file must carry a frontmatter `description` (one plain-language line about the content, not the genre); the build warns and exits 1 otherwise.\n\n"; +out += "> Every new file must carry a frontmatter `description` (one plain-language line about the content, not the genre); entries under `notes/task/` and `notes/issue/` also need a `status` (`open|done` / `open|resolved`); the build warns and exits 1 otherwise.\n\n"; out += "## How to use this book\n\n"; out += "- **AI agents**: read this file first for the full map, then follow links to what you need. Before writing any book document, read `guidelines/writing-style.md`.\n"; out += "- **Humans**: browse by the directory table below. Rules live in `guidelines/`, blueprints in `plans/`, experience in `notes/learn/`, architecture in `docs/architecture/`, decisions in `docs/decisions/`.\n"; out += "- **By time**: `changelogs/` and `notes/{summary,learn,issue}/` archive under `YYYY-MM/`; the month is a physical grouping only — do not nest deeper by feature.\n"; +out += "- **By status**: entries in `notes/task/` and `notes/issue/` carry a frontmatter `status`; this index lists open entries first — flipping the field and rerunning is the archive step.\n"; out += "- **By feature**: search this index for a feature name, keyword, or frontmatter summary; `notes/learn/` entries are also searchable by their `tags`.\n"; out += "- **Obsidian**: open `book/` directly as a vault. Links are plain relative Markdown; if you move files, rerun the index.\n\n"; out += "## Directory map\n\n"; @@ -141,20 +184,38 @@ out += "\n## All files\n\n"; for (const key of dirKeys) { const label = key === "" ? "root" : key + "/"; out += `### ${label}\n\n`; - for (const f of byDir.get(key)) { - out += `- [${f.name}](${link(f.rel)}) — ${f.desc}\n`; + const section = STATUS_SECTIONS.find((s) => s.root === key); + if (section) { + const open = byDir.get(key).filter((f) => f.status === "open"); + const handled = byDir.get(key).filter((f) => f.status !== "open"); + const group = (title, list) => { + if (list.length === 0) return; + out += `**${title} (${list.length})**\n\n`; + for (const f of list) out += `- [${f.name}](${link(f.rel)}) — ${f.desc}\n`; + out += "\n"; + }; + group("Open", open); + group(section.handledLabel, handled); + } else { + for (const f of byDir.get(key)) { + out += `- [${f.name}](${link(f.rel)}) — ${f.desc}\n`; + } + out += "\n"; } - out += "\n"; } out += `\n`; writeFileSync(OUTPUT, out); -if (warnings.length > 0 || brokenLinks.length > 0) { +if (warnings.length > 0 || statusWarnings.length > 0 || brokenLinks.length > 0) { if (warnings.length > 0) { console.error(`Files missing frontmatter description (${warnings.length}):`); for (const w of warnings) console.error(` - ${w}`); } + if (statusWarnings.length > 0) { + console.error(`task/issue entries with missing or invalid status (${statusWarnings.length}):`); + for (const w of statusWarnings) console.error(` - ${w}`); + } if (brokenLinks.length > 0) { console.error(`Broken internal links (${brokenLinks.length}):`); for (const l of brokenLinks) console.error(` - ${l}`); From d97c08fb18cc33e021f9d18847ffd3473837b1ce Mon Sep 17 00:00:00 2001 From: Focus Date: Fri, 6 Nov 2026 00:19:31 +0800 Subject: [PATCH 4/8] =?UTF-8?q?=F0=9F=93=96=20docs=20(workflow):=20align?= =?UTF-8?q?=20the=20phase-2=20stop=20rule=20and=20the=20L-tier=20ADR=20tri?= =?UTF-8?q?gger?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- book/guidelines/task-tiers.md | 2 +- skills/boscope/SKILL.md | 8 ++++---- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/book/guidelines/task-tiers.md b/book/guidelines/task-tiers.md index 1a047cc..b468f99 100644 --- a/book/guidelines/task-tiers.md +++ b/book/guidelines/task-tiers.md @@ -12,7 +12,7 @@ S is not "an M with gates skipped" — it is a separate channel with no gates; i |------|---------------------------------------------|----------------|------------| | **S** small | single file or surface-only change; touches no contract, permission, or funds; no data migration; regression surface visible at a glance | one-sentence motive (why + how verified) → change → self-test green → single commit | none beyond a changelog line | | **M** medium | a feature or defect inside one functional area; adds or changes API behavior; touches a UI flow; needs new tests | Step 0 brief (half a page is fine) → all six phases | brief + summary, half a page to one page | -| **L** large | crosses functional areas or changes architecture; hits anything on the always-L list below; changes a shared contract; deletes a whole feature area | Step 0 brief, every slot filled in full → all six phases + review checklist + an ADR when impact warrants | full; execution plan into `plans/` | +| **L** large | crosses functional areas or changes architecture; hits anything on the always-L list below; changes a shared contract; deletes a whole feature area | Step 0 brief, every slot filled in full → all six phases + review checklist + an ADR when the change trips the triggers in `../docs/decisions/README.md` (expensive to reverse · a reasonable person could have made differently · an architecture boundary rule) | full; execution plan into `plans/` | ## Hard rules diff --git a/skills/boscope/SKILL.md b/skills/boscope/SKILL.md index 0783cc3..45c91bd 100644 --- a/skills/boscope/SKILL.md +++ b/skills/boscope/SKILL.md @@ -75,15 +75,15 @@ Understand the requirement → find the relevant code → trace the call chain **Design is how it works.** The surfaces the user touches — defaults, empty states, error messages — are the design itself, not decoration on the data flow. A design that needs explaining before it works gets simplified, not documented. -**Stop and wait for approval.** Do not enter Phase 3 until the user explicitly approves. (A kickoff message that clearly orders implementation and sets the technical context counts as approval — record that basis in the plan.) +**Real gaps stop this phase; nothing else does.** With the outputs above complete, go straight to Phase 3 and deliver the design with the implementation — stop for the user only on a real gap (scope conflict, undetermined data shape, unclear external dependency), never just for confirmation. > **Permissions + notifications** are the two slots agents forget most. Even when the answer is "not needed this time", state it explicitly. -**On approval:** write the plan into `book/plans/YYYY-MM-DD-.md` (template in that directory's README). The plan is the construction blueprint — this file, not memory, is what Phase 3 builds from. +**Then the plan:** write it into `book/plans/YYYY-MM-DD-.md` (template in that directory's README). The plan is the construction blueprint — this file, not memory, is what Phase 3 builds from. ### Phase 3: Implementation -Strictly per the approved design. **No changes outside scope, no refactors, no new abstractions.** Match the existing code's style. +Strictly per the design. **No changes outside scope, no refactors, no new abstractions.** Match the existing code's style. ### Phase 4: Testing (test-first) @@ -112,6 +112,6 @@ Write back to the book: plan status, summary, learn entries, new issues, changel - Tier before Step 0, the tier riding in the first commit's motive — S runs the light channel and never enters the phases; M/L skip none - Step 0 before any code, every brief slot filled - No skipping phases; every REQUIRED gate met before the next -- Phase 2 design and Phase 3 scope boundaries advance only with explicit user approval +- Phase 2 stops only on a real gap (scope conflict, undetermined data shape, unclear external dependency); Phase 3 scope boundaries move only with explicit user approval - Phase 5 records without fixing; Phase 6 records without fixing - The writeback target is this project's `book/` — never bypass the project's own document conventions From d5185861a71a3e094898539083cfe84948b5c9d7 Mon Sep 17 00:00:00 2001 From: Focus Date: Fri, 6 Nov 2026 00:20:41 +0800 Subject: [PATCH 5/8] =?UTF-8?q?=F0=9F=93=96=20docs=20(readme):=20show=20th?= =?UTF-8?q?e=20latest=20changelog=20in=20a=20collapsible=20block=20near=20?= =?UTF-8?q?the=20top?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- CHANGELOG.md | 2 ++ README.ja.md | 11 +++++++++++ README.md | 11 +++++++++++ README.zh-CN.md | 11 +++++++++++ 4 files changed, 35 insertions(+) diff --git a/CHANGELOG.md b/CHANGELOG.md index 4d9a734..8f0e723 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -2,6 +2,8 @@ Releases of the BoCode template itself. Adopting projects upgrade by handing [UPGRADE.md](UPGRADE.md) to an agent; each entry lists what changed and what an adopting project must do. History before 2026-11-05 lives in git log and [book/docs/decisions/](book/docs/decisions/) (ADR-001..ADR-004). +When adding an entry, also refresh the collapsed What's-new block near the top of the three READMEs (`README.md`, `README.zh-CN.md`, `README.ja.md`): newest title in the summary line, latest three titles as bullets. + ## 2026-11-06 — tasks and issues archive by status (ADR-010) Handled and unhandled entries were indistinguishable from the outside; the tempting fix — a folder files move into — breaks the book's relative links. Archiving is now a status flip. diff --git a/README.ja.md b/README.ja.md index 46c4988..2ef2186 100644 --- a/README.ja.md +++ b/README.ja.md @@ -16,6 +16,17 @@ BoCode はリポジトリを二つに分けます——ソースを置く `code/` と、ドキュメントの流れとナレッジベースを置く `book/` です。両者は双方向に接続されます。今のソフトウェアが実際に書かれている方法、つまり人間と AI コーディングエージェントの共同開発を前提に設計されています。エージェントは速く、メモリもありますが、その記憶はエージェントだけのもの:人間には読めず、管理もできません。プロジェクトの知識がどこに置かれ、誰が読めるかが、速さが制御とともにあるか、制御のない速さになるかを決めます。 +
+最新情報 · 2026-11-06 — タスクと issue を status でアーカイブ(ADR-010) + +- **2026-11-06** — タスクと issue を status でアーカイブ(ADR-010) +- **2026-11-06** — bowrite の voice ルールをすべての執筆に適用(ADR-009) +- **2026-11-05** — ゲートの前にタスクを S/M/L に格付け(ADR-008) + +履歴全文と移行手順は [CHANGELOG.md](CHANGELOG.md) + +
+ ## 一行で導入 すでにプロジェクトがある? この一行を AI エージェントに貼り付けてください: diff --git a/README.md b/README.md index c806c73..980b304 100644 --- a/README.md +++ b/README.md @@ -16,6 +16,17 @@ BoCode gives a repository two halves — `code/` for the source, `book/` for the documentation stream and knowledge base — wired together in both directions. It is built for the way software is written now: a human and AI coding agents together. Agents are fast and have memory now — but that memory serves the agent alone: unreadable to humans, unmanageable. Where a project's knowledge lives, and who can read it, decides whether speed comes with control or without it. +
+What's new · 2026-11-06 — tasks and issues archive by status (ADR-010) + +- **2026-11-06** — tasks and issues archive by status (ADR-010) +- **2026-11-06** — bowrite's voice rules on every write (ADR-009) +- **2026-11-05** — task tiers before the gates (ADR-008) + +Full history and adopter actions: [CHANGELOG.md](CHANGELOG.md) + +
+ ## Adopt it in one line Already have a project? Paste this to your AI agent: diff --git a/README.zh-CN.md b/README.zh-CN.md index dd9c1fd..11ef132 100644 --- a/README.zh-CN.md +++ b/README.zh-CN.md @@ -16,6 +16,17 @@ BoCode 把仓库分成两半:`code/` 放源代码,`book/` 放文档和知识库,两边互相驱动。它是为现在最常见的开发方式设计的:人和 AI agent 一起写代码。agent 快,也有记忆,可记忆只归它自己:人读不懂、管不了。项目知识放在哪里、给谁读,决定了开发是又快又稳,还是快得让人心里没底。 +
+最近更新 · 2026-11-06 — task/issue 按 status 归档(ADR-010) + +- **2026-11-06** — task/issue 按 status 归档(ADR-010) +- **2026-11-06** — bowrite 的 voice 规则覆盖每一次书写(ADR-009) +- **2026-11-05** — 关卡之前先给任务分级(ADR-008) + +完整历史与采用方操作见 [CHANGELOG.md](CHANGELOG.md) + +
+ ## 一句话接入 已经有项目了?把这句发给你的 AI agent: From 283fa3ddb464bfbab46390f320f8ccb9b3e6dbab Mon Sep 17 00:00:00 2001 From: Focus Date: Fri, 6 Nov 2026 00:20:59 +0800 Subject: [PATCH 6/8] =?UTF-8?q?=F0=9F=93=96=20docs=20(changelog):=20record?= =?UTF-8?q?=20the=20phase-2=20stop-rule=20alignment?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- CHANGELOG.md | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/CHANGELOG.md b/CHANGELOG.md index 8f0e723..c7a4405 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -4,6 +4,14 @@ Releases of the BoCode template itself. Adopting projects upgrade by handing [UP When adding an entry, also refresh the collapsed What's-new block near the top of the three READMEs (`README.md`, `README.zh-CN.md`, `README.ja.md`): newest title in the summary line, latest three titles as bullets. +## 2026-11-06 — phase-2 stop rule aligned, L-tier ADR trigger decidable + +The task-tiers replay (ADR-008) caught two leftovers: boscope still required Phase-2 approval while workflow.md, AGENTS.md, and the newer skill variants stop only on real gaps; and the L row's "an ADR when impact warrants" carried no criterion. + +- Changed: `skills/boscope/SKILL.md` (Phase 2 stops only on a real gap — scope conflict, undetermined data shape, unclear external dependency — and goes straight to Phase 3 otherwise; the plan step no longer hangs on approval; Phase 3 builds "per the design"; the constraints bullet splits the two rules it used to merge); `book/guidelines/task-tiers.md` (the L row's ADR gate defers to the triggers in `book/docs/decisions/README.md`: expensive to reverse · a reasonable person could have made differently · an architecture boundary rule) + +**Adopter action:** copy the two changed files; in translated boscope variants, replace the "stop and wait for approval" block with the real-gaps rule and drop it from any companion README's flow; regenerate the index. + ## 2026-11-06 — tasks and issues archive by status (ADR-010) Handled and unhandled entries were indistinguishable from the outside; the tempting fix — a folder files move into — breaks the book's relative links. Archiving is now a status flip. From ff6225a58e06d5629afdf04011b8d3e523475a09 Mon Sep 17 00:00:00 2001 From: Focus Date: Fri, 6 Nov 2026 00:21:22 +0800 Subject: [PATCH 7/8] =?UTF-8?q?=F0=9F=93=96=20docs=20(readme):=20list=20th?= =?UTF-8?q?e=20phase-2=20alignment=20in=20what's-new?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- README.ja.md | 4 ++-- README.md | 4 ++-- README.zh-CN.md | 4 ++-- 3 files changed, 6 insertions(+), 6 deletions(-) diff --git a/README.ja.md b/README.ja.md index 2ef2186..f2aa128 100644 --- a/README.ja.md +++ b/README.ja.md @@ -17,11 +17,11 @@ BoCode はリポジトリを二つに分けます——ソースを置く `code/` と、ドキュメントの流れとナレッジベースを置く `book/` です。両者は双方向に接続されます。今のソフトウェアが実際に書かれている方法、つまり人間と AI コーディングエージェントの共同開発を前提に設計されています。エージェントは速く、メモリもありますが、その記憶はエージェントだけのもの:人間には読めず、管理もできません。プロジェクトの知識がどこに置かれ、誰が読めるかが、速さが制御とともにあるか、制御のない速さになるかを決めます。
-最新情報 · 2026-11-06 — タスクと issue を status でアーカイブ(ADR-010) +最新情報 · 2026-11-06 — フェーズ 2 停止ルールを統一、L の ADR トリガーを判定可能に +- **2026-11-06** — フェーズ 2 停止ルールを統一、L の ADR トリガーを判定可能に - **2026-11-06** — タスクと issue を status でアーカイブ(ADR-010) - **2026-11-06** — bowrite の voice ルールをすべての執筆に適用(ADR-009) -- **2026-11-05** — ゲートの前にタスクを S/M/L に格付け(ADR-008) 履歴全文と移行手順は [CHANGELOG.md](CHANGELOG.md) diff --git a/README.md b/README.md index 980b304..1f4756d 100644 --- a/README.md +++ b/README.md @@ -17,11 +17,11 @@ BoCode gives a repository two halves — `code/` for the source, `book/` for the documentation stream and knowledge base — wired together in both directions. It is built for the way software is written now: a human and AI coding agents together. Agents are fast and have memory now — but that memory serves the agent alone: unreadable to humans, unmanageable. Where a project's knowledge lives, and who can read it, decides whether speed comes with control or without it.
-What's new · 2026-11-06 — tasks and issues archive by status (ADR-010) +What's new · 2026-11-06 — phase-2 stop rule aligned, L-tier ADR trigger decidable +- **2026-11-06** — phase-2 stop rule aligned, L-tier ADR trigger decidable - **2026-11-06** — tasks and issues archive by status (ADR-010) - **2026-11-06** — bowrite's voice rules on every write (ADR-009) -- **2026-11-05** — task tiers before the gates (ADR-008) Full history and adopter actions: [CHANGELOG.md](CHANGELOG.md) diff --git a/README.zh-CN.md b/README.zh-CN.md index 11ef132..2348bd1 100644 --- a/README.zh-CN.md +++ b/README.zh-CN.md @@ -17,11 +17,11 @@ BoCode 把仓库分成两半:`code/` 放源代码,`book/` 放文档和知识库,两边互相驱动。它是为现在最常见的开发方式设计的:人和 AI agent 一起写代码。agent 快,也有记忆,可记忆只归它自己:人读不懂、管不了。项目知识放在哪里、给谁读,决定了开发是又快又稳,还是快得让人心里没底。
-最近更新 · 2026-11-06 — task/issue 按 status 归档(ADR-010) +最近更新 · 2026-11-06 — Phase-2 停止规则对齐,L 级 ADR 触发判据化 +- **2026-11-06** — Phase-2 停止规则对齐,L 级 ADR 触发判据化 - **2026-11-06** — task/issue 按 status 归档(ADR-010) - **2026-11-06** — bowrite 的 voice 规则覆盖每一次书写(ADR-009) -- **2026-11-05** — 关卡之前先给任务分级(ADR-008) 完整历史与采用方操作见 [CHANGELOG.md](CHANGELOG.md) From 79426a98a0fbf58d04f3c19a23a6a680343b24f7 Mon Sep 17 00:00:00 2001 From: Focus Date: Fri, 6 Nov 2026 00:30:50 +0800 Subject: [PATCH 8/8] =?UTF-8?q?=E2=9A=99=EF=B8=8F=20setup=20(tools):=20git?= =?UTF-8?q?ignore=20the=20agent=20session=20workspace?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .gitignore | 3 +++ 1 file changed, 3 insertions(+) diff --git a/.gitignore b/.gitignore index 6435061..8809fcd 100644 --- a/.gitignore +++ b/.gitignore @@ -8,3 +8,6 @@ node_modules/ # Environment .env .env.* + +# Agent session workspace (ZCode) +.zcode/