feat(process): #303 decisions.md consolidation size-floor (read-cost, non-blocking) [decisions-edit]
Build ErsatzTV Image / Docs update reminder (pull_request) Successful in 7s
Build ErsatzTV Image / decisions.md append-only (pull_request) Successful in 8s
Build ErsatzTV Image / EF migration integrity (SQLite + MySql) (pull_request) Failing after 9s
Build ErsatzTV Image / API docs in sync (OpenAPI + endpoint index) (pull_request) Successful in 15s
Build ErsatzTV Image / Build & push image (amd64) (pull_request) Has been cancelled
Build ErsatzTV Image / Build & test (.NET) (pull_request) Has been cancelled
Build ErsatzTV Image / Docs update reminder (pull_request) Successful in 7s
Build ErsatzTV Image / decisions.md append-only (pull_request) Successful in 8s
Build ErsatzTV Image / EF migration integrity (SQLite + MySql) (pull_request) Failing after 9s
Build ErsatzTV Image / API docs in sync (OpenAPI + endpoint index) (pull_request) Successful in 15s
Build ErsatzTV Image / Build & push image (amd64) (pull_request) Has been cancelled
Build ErsatzTV Image / Build & test (.NET) (pull_request) Has been cancelled
Timothy's refinement: the between-releases consolidation floor triggers on the file's READ COST — its line count, i.e. the context an agent burns reading the log — not entry count. The decisions-guard CI job now emits a non-blocking ::warning:: once decisions.md exceeds 1800 lines (the point past which it no longer fits one default 2000-line agent Read). Documented in the decisions.md header, the H9 entry, and ci-cd.md (job description + release-checklist note). Touches committed H9 lines, hence [decisions-edit]. Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
This commit is contained in:
@@ -380,6 +380,17 @@ jobs:
|
||||
base_ref="${{ github.base_ref }}"
|
||||
git fetch --no-tags --depth=200 origin "$base_ref" || true
|
||||
./.claude/hooks/decisions-guard.sh range "origin/${base_ref}" HEAD
|
||||
- name: Consolidation-floor reminder (non-blocking)
|
||||
run: |
|
||||
# Consolidation is primarily a release step; this is the between-releases floor. The metric is
|
||||
# the file's LINE COUNT — the context an agent actually burns reading the log — not entry count.
|
||||
# Floor 1800 keeps the whole log inside one default 2000-line Read (headroom for the reader's
|
||||
# own overhead). Nudge (never fail) past it so append-only can't grow past what agents can read.
|
||||
n=$(wc -l < docs/decisions.md | tr -d ' ')
|
||||
echo "docs/decisions.md is ${n} lines (consolidation floor: 1800; one Read caps at 2000)."
|
||||
if [ "${n:-0}" -gt 1800 ]; then
|
||||
echo "::warning::docs/decisions.md is ${n} lines (>1800) — larger than agents can comfortably read in one pass. Do a consolidation pass (prune/merge superseded entries with [decisions-edit]); don't wait for the next release. See the decisions.md header."
|
||||
fi
|
||||
|
||||
# BLOCKING (unlike docs-reminder): the mechanizable half of the "docs-update in the
|
||||
# same PR" rule for the API contract (ersatztv#303 H4/H5). If a PR touches the API
|
||||
|
||||
+4
-2
@@ -24,7 +24,7 @@ Upstream's final release was **`v26.3.0`** (archived). Our line continues from t
|
||||
(ersatztv#303 H9), so a release boundary is where superseded entries get pruned/merged and the Index
|
||||
refreshed. Fold and drop any entry marked `> **Superseded …**`, then commit with `[decisions-edit]` in
|
||||
the message (the append-only guard blocks history edits otherwise). Mark-and-keep during the arc,
|
||||
consolidate here.
|
||||
consolidate here — or sooner if the `decisions-guard` job's 1800-line consolidation-floor warning fires.
|
||||
|
||||
**Cutting a release:** push a `vYY.N.P` tag on `main` → CI builds `:prod` + `:<version>` + `:<sha>`. Prod's `media-servers` compose **follows the floating `:prod` tag** (Timothy's decision, 2026-07-11 — reverted from the version-pin approach), so **Komodo's Global Auto Update** (`poll_for_updates` is on for all stacks) detects the new `:prod` digest and redeploys the media-servers stack — no CI push to server-management, no manual pin bump. ⚠️ **Open caveat:** confirm Global Auto Update runs the #553 host-side **pre-deploy backup** hook; if it doesn't, a release would deploy without a backup — fall back to a manual `execute DeployStack media-servers` (which *does* run pre-deploy). See `homelab-docs/Docker/ErsatzTV.md` + the `komodo` skill.
|
||||
|
||||
@@ -121,7 +121,9 @@ blocking `api-docs` job, and `docs/decisions.md` by the blocking `decisions-guar
|
||||
Enforces the `docs/decisions.md` append-only convention (ersatztv#303 H9): fails a PR whose
|
||||
merge-base diff **deletes or modifies** any existing line of that file, unless a commit in the range
|
||||
carries the `[decisions-edit]` token (for a factual fix or a documented supersession — see the
|
||||
`decisions.md` header). Pure insertions (a normal new entry: TOC line + appended block) pass. It runs
|
||||
`decisions.md` header). Pure insertions (a normal new entry: TOC line + appended block) pass. The job
|
||||
also emits a **non-blocking** consolidation nudge once the file exceeds **1800 lines** (the read-cost
|
||||
floor — one default agent Read caps at 2000 lines), so append-only can't outgrow what agents read. It runs
|
||||
the same `.claude/hooks/decisions-guard.sh` the Husky `commit-msg` hook uses, so the *detection logic*
|
||||
is shared and can't drift. Granularity differs, deliberately: Husky checks **each commit** (`staged`
|
||||
mode, that commit's own message must carry the token); CI checks the **PR-wide** net diff (`range` mode,
|
||||
|
||||
+12
-7
@@ -14,10 +14,13 @@ message, for the two legitimate reasons to touch history:
|
||||
`> **Superseded YYYY-MM by <new entry title>.**` banner to the old entry and tag its Index line
|
||||
`(superseded)`. Keep the old entry — *why we changed our mind* is the point; never silently rewrite it.
|
||||
|
||||
**Consolidation** (prune/merge superseded entries, refresh the Index) is a step in the release
|
||||
checklist (`docs/ci-cd.md` → Versioning & releases), done at each release/milestone with
|
||||
`[decisions-edit]` — not ad hoc mid-arc. This keeps append-only from accreting stale, contradictory
|
||||
entries between releases.
|
||||
**Consolidation** (prune/merge superseded entries, refresh the Index) is primarily a step in the
|
||||
release checklist (`docs/ci-cd.md` → Versioning & releases), done at each release/milestone with
|
||||
`[decisions-edit]` — not ad hoc mid-arc. A **size floor** backstops it between releases: the
|
||||
`decisions-guard` CI job warns (non-blocking) once this file exceeds **1800 lines** — the point where
|
||||
it no longer fits one default 2000-line agent Read — so append-only can't grow past what an agent can
|
||||
read in a pass. The metric is the file's read cost (line count), not the entry count. Together these
|
||||
keep append-only from accreting stale, contradictory, or unreadably-large history.
|
||||
|
||||
---
|
||||
|
||||
@@ -1354,9 +1357,11 @@ prefix would false-match). The block is lifted only by the literal **`[decisions
|
||||
commit message, reserved for two cases: fixing a factual error, and superseding a reversed decision
|
||||
(add the new entry, prepend a `> **Superseded …**` banner to the old one, tag its Index line
|
||||
`(superseded)` — keep the old rationale, never silently rewrite). **Consolidation** of superseded
|
||||
entries is a release-checklist step (`docs/ci-cd.md` → Versioning & releases), so append-only doesn't
|
||||
accrete contradictory history between releases (Timothy's call, 2026-07-12: mark-and-keep on reversal,
|
||||
consolidate at each milestone).
|
||||
entries is a release-checklist step (`docs/ci-cd.md` → Versioning & releases), backstopped by a
|
||||
non-blocking 1800-line **size floor** in the `decisions-guard` job (the read-cost point past which the
|
||||
log no longer fits one default agent Read), so append-only doesn't accrete contradictory *or
|
||||
unreadably-large* history between releases (Timothy's call, 2026-07-12: mark-and-keep on reversal,
|
||||
consolidate at each milestone, size-floor backstop).
|
||||
|
||||
Companion guard **H3**: the Husky `pre-commit` hook refuses a staged **root-level `*.png`** (a
|
||||
review/debug screenshot dropped at the repo root) — belt-and-suspenders with the `.gitignore` rule, so
|
||||
|
||||
Reference in New Issue
Block a user