docs(openspec): 放寬 root CLAUDE.md 行數預算 100→130(目標 80→100) - #199
Conversation
agent-doc-context-budget 對 root CLAUDE.md 的硬上限自 100 放寬至 130 行 (目標 80→100)。理由:追蹤檔 CLAUDE.md 本體 77 行未超標,但 GitNexus code-intelligence 工具每次 session 在檔尾自動附加約 42 行區塊,實際載入 約 119 行、超過 100 行精神上限。放寬後上限對齊真實載入成本並留約 10 行 headroom;同時明寫 wc -l 閘門量追蹤檔本體、runtime 附加區塊另計。 - MODIFIED spec agent-doc-context-budget(canonical 已 pre-apply,change delta 同步記錄;未來 convergence archive-only,同 docs-design 模式) - AGENTS.md / CLAUDE.md 預算自述句對齊 130/100(本體內容不變、仍 77 行) - AGENTS.md 預算 250/200 不變;subfolder-agent-boundary-coverage 的 sub-folder 100 上限為另一獨立 budget,本 change 不動 本機 openspec CLI 不可用 → 結構驗證過(wc -l 77≤130、無殘留、diff --check clean、canonical==delta);openspec validate --specs --strict 待 CI 補綠。 Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
|
No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info⚙️ Run configurationConfiguration used: defaults Review profile: CHILL Plan: Pro Run ID: 📒 Files selected for processing (6)
📝 WalkthroughWalkthroughThis PR raises the line budget enforcement limits for ChangesContext Budget Governance Update
Estimated code review effort🎯 2 (Simple) | ⏱️ ~12 minutes Possibly related PRs
Poem
🚥 Pre-merge checks | ✅ 5✅ Passed checks (5 passed)
✏️ Tip: You can configure your own custom pre-merge checks in the settings. ✨ Finishing Touches🧪 Generate unit tests (beta)
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
There was a problem hiding this comment.
Pull request overview
This PR relaxes the root CLAUDE.md line-count budget from 100 → 130 (target 80 → 100) in the agent-doc-context-budget spec. The motivation is that GitNexus code-intelligence appends ~42 lines at session load time, pushing the actual loaded content (~119 lines) beyond the old 100-line spirit limit. The wc -l gate still measures only the tracked file body (currently 77 lines); the spec now explicitly documents that runtime-appended blocks are excluded from the gate.
Changes:
- Updated the canonical spec and its delta in the change folder to reflect the new 130/100 limits, and clarified the
wc -lmeasurement scope. - Updated
CLAUDE.mdandAGENTS.mdself-referencing budget sentences to match the new limits. - Added a complete OpenSpec change (
raise-claude-md-line-budget) with proposal, tasks, and delta spec documenting the rationale.
Reviewed changes
Copilot reviewed 6 out of 6 changed files in this pull request and generated 1 comment.
Show a summary per file
| File | Description |
|---|---|
openspec/specs/agent-doc-context-budget/spec.md |
Canonical spec: CLAUDE.md limit 100→130, target 80→100; clarifies GitNexus blocks excluded from gate |
openspec/changes/raise-claude-md-line-budget/proposal.md |
New change proposal explaining the rationale for the budget increase |
openspec/changes/raise-claude-md-line-budget/tasks.md |
Task checklist tracking spec update, self-ref updates, and validation |
openspec/changes/raise-claude-md-line-budget/specs/agent-doc-context-budget/spec.md |
Delta spec mirroring the canonical spec's modified requirement |
CLAUDE.md |
Budget self-reference updated to ≤ 130 / target ≤ 100 |
AGENTS.md |
Budget self-reference updated to CLAUDE.md ≤ 130 / target ≤ 100 |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
| - `CLAUDE.md` SHALL 不超過 **130 行**(目標 ≤ 100 行)。 | ||
|
|
||
| 行數以 LF 行尾 + `wc -l` 為準。任何 PR 若導致兩檔回胖超過上限,必須在 PR 描述說明原因並附對應 OpenSpec change,否則 review 應要求拆分到 `docs/agents/*.md` sub-file。 | ||
| 行數以 LF 行尾 + `wc -l` 為準(量 repo 追蹤檔本體;GitNexus 等工具於 session 載入時自動附加至檔尾的區塊**另計**,不在本 `wc -l` 閘門範圍內)。`CLAUDE.md` 上限自 100 放寬至 130(目標 80 → 100),係反映 GitNexus code-intelligence 區塊每次 session 自動附加(約 42 行)後的真實載入成本,並保留約 10 行 headroom;目標仍鼓勵作者本體 ≤ 100 行。任何 PR 若導致兩檔回胖超過上限,必須在 PR 描述說明原因並附對應 OpenSpec change,否則 review 應要求拆分到 `docs/agents/*.md` sub-file。 |
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 2f53a31d30
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
| - `CLAUDE.md` SHALL 不超過 **130 行**(目標 ≤ 100 行)。 | ||
|
|
||
| 行數以 LF 行尾 + `wc -l` 為準。任何 PR 若導致兩檔回胖超過上限,必須在 PR 描述說明原因並附對應 OpenSpec change,否則 review 應要求拆分到 `docs/agents/*.md` sub-file。 | ||
| 行數以 LF 行尾 + `wc -l` 為準(量 repo 追蹤檔本體;GitNexus 等工具於 session 載入時自動附加至檔尾的區塊**另計**,不在本 `wc -l` 閘門範圍內)。`CLAUDE.md` 上限自 100 放寬至 130(目標 80 → 100),係反映 GitNexus code-intelligence 區塊每次 session 自動附加(約 42 行)後的真實載入成本,並保留約 10 行 headroom;目標仍鼓勵作者本體 ≤ 100 行。任何 PR 若導致兩檔回胖超過上限,必須在 PR 描述說明原因並附對應 OpenSpec change,否則 review 應要求拆分到 `docs/agents/*.md` sub-file。 |
There was a problem hiding this comment.
Keep the runtime-appended block inside the true-load budget
When a future PR grows tracked CLAUDE.md to the newly allowed 130 lines, the GitNexus block that this paragraph says is appended on every session still adds about 42 more lines, so the actual session-loaded entrypoint becomes ~172 lines rather than the stated 130-line budget with ~10 lines of headroom. Because the requirement’s purpose is to bound the real per-session token cost, excluding the runtime block from the wc -l gate while raising the tracked-file cap lets later changes pass the gate even though they exceed the true-load budget this change is meant to enforce.
Useful? React with 👍 / 👎.
PR Review Agent Summary
Blockers
Warnings
Validation Commands
Checks
Human Review Notes
|
#229) 把 13 個產品碼已 merge 進 main 的 active change 歸檔為不可變快照, 並將其 spec delta 併入 canonical specs。對齊 #197 收斂規約。 歸檔(archive/<merge-date>-<id>,git 偵測為 R100 純改名、零內容漂移): a1-m1-closeout(#213) a2-version-diff-selector(#207) conv-coverage-report(#218/#220) conv-prioritize-retry(#221) conv-watch-toggle(#225) conversion-artifact-id-sanitize(#206) governance-service-deploy(#215) minio-fileserver-source(#204) minio-watch-auto-intake(#210) raise-claude-md-line-budget(#199) sessions-terminate(#226) stop-all-single-pid-cleanup(#217) test-deploy-rebuild-workflow(#198) canonical 併入: - 9 個新 capability(純 ADDED → 新建 spec):a1-m1-closeout、a2-version-diff-selector、 conv-coverage-report、conv-prioritize-retry、conversion-control、conversion-artifact-id-sanitize、 minio-fileserver-source、minio-watch-auto-intake、test-deploy-rebuild-workflow。 - review-session-request-lifecycle:append sessions-terminate 的 ADDED requirement 「Operator 結束 session controlled action」(5 scenario),既有 7 requirement 不動。 - one-click-deploy-hybrid:併入 governance-service-deploy 與 stop-all-single-pid-cleanup 兩 delta,採「合併不取代」保全既有更豐富內容。依 deploy.ps1 現況權威 (4a=governance/4b=conversion/4c=Kit/4d=docker)調和 Phase 4 編號,並修正 canonical 其他兩處陳舊的舊 3 段編號(Mode C 入口 scenario、退出碼 stage 清單補 4d)。 - agent-doc-context-budget:raise-claude-md-line-budget 的 130 行預算已於 #199 併入, 本次為 archive-only。 驗證: - 結構檢查無殘留 ## ADDED/MODIFIED header、每 requirement 皆有 scenario、 43 archive 檔全 R100、git diff --cached --check 無 whitespace。 - 雙 agent 對抗驗證:完整性 PASS(無規範遺失);一致性初判 FAIL 抓到 2 處 Phase 4 編號矛盾,已修正後複驗。 - 本機 openspec CLI 不可用(結構驗證代替);openspec validate --strict 由 CI pr-review-agent 執行。 Claude-Session: https://claude.ai/code/session_01JEyNWhEmb3x8oinY3B2v9V Co-authored-by: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
摘要
放寬 root
CLAUDE.md的行數預算硬上限:100 → 130 行(目標 80 → 100)。AGENTS.md(250 / 200)不變。為什麼
CLAUDE.md本體 77 行,wc -l閘門本來就沒超標。CLAUDE.md檔尾自動附加「# GitNexus — Code Intelligence」區塊(約 42 行),實際載入約 119 行 → 超過 100 行精神上限(spec 在意的是「長度直接乘上每次 session token 成本」的真實載入量)。wc -l閘門量追蹤檔本體、GitNexus runtime 附加區塊另計。變更
agent-doc-context-budget(canonical 直接 pre-apply + change folder delta 同步記錄;未來 convergence archive-only,同 docs-design 模式)。AGENTS.md/CLAUDE.md預算自述句對齊 130 / 100(本體內容不變、仍 77 行)。raise-claude-md-line-budget(proposal / tasks / delta)說明放寬理由。驗證
wc -l CLAUDE.md= 77 ≤ 130、AGENTS.md= 212 ≤ 250、無殘留舊上限、git diff --checkclean、canonical == delta。could not determine executable to run)→openspec validate --specs --strict待 CI pr-review-agent 補綠。範圍註記
subfolder-agent-boundary-coverage的 sub-folderAGENTS.md/ sub-repoCLAUDE.md100 行上限是另一獨立 budget,本 PR 不動(如需一併放寬可另開 change)。🤖 Generated with Claude Code
Summary by CodeRabbit