Skip to content

README: promote vs-context7 freshness stat + a harness-generated Unicode bar chart to the top#47

Merged
kiki830621 merged 6 commits into
mainfrom
idd/46-readme-promote-vs-context7-freshness-sta
Jul 4, 2026
Merged

README: promote vs-context7 freshness stat + a harness-generated Unicode bar chart to the top#47
kiki830621 merged 6 commits into
mainfrom
idd/46-readme-promote-vs-context7-freshness-sta

Conversation

@kiki830621

Copy link
Copy Markdown
Member

Refs #46

Summary

Promote the vs-context7 latest-version freshness stat from a mid-page wiki section to a Unicode bar chart at the top of README. The block is emitted by compare_context7.py --emit-readme --write from the dated snapshot (never hand-typed), sentinel-marked "do not hand-edit", and guarded by --emit-readme --check + a unit test — so a stale/hand-edited competitive number is a red suite, not a silent asserted claim (iron rule #27/#29). The honesty caveat travels inside the block.

Changes

  • evals/look-up/compare_context7.pyrender_bar_chart + render_readme_block + --emit-readme/--write/--check (reuses tally())
  • README.md — sentinel-marked chart block at the top (machine-produced)
  • evals/look-up/tests/test_compare.py — +3 (structural render, zero-n, emit-block drift guard)
  • test-count sync → 197 (144 Swift + 53 Python)

Checklist

  • Diagnose (Plan tier)
  • Plan approved (EnterPlanMode)
  • Implement (2 commits, Refs #46)
  • Verify (run /idd-verify #46)
  • Verify-gated: post-verify PASS = ready to merge → after merge, run /idd-close (manual gate + closing summary; no auto-close trailer)

🤖 Generated by /idd-implement on PR path. Do NOT add a GitHub close trailer (Closes/Fixes/Resolves) — IDD requires manual /idd-close after merge.

…rated + drift-guarded (#46)

Promote the vs-context7 latest-version freshness stat from a mid-page wiki
section to a Unicode bar chart at the very top of README. The block is emitted
by `compare_context7.py --emit-readme --write` from the dated snapshot (never
hand-typed), sentinel-marked "do not hand-edit", and guarded by
`--emit-readme --check` plus a unit test — so a stale or hand-edited competitive
number is a red suite, not a silent asserted claim (the iron rule, #27/#29).
The honesty caveat (freshness-only; context7 wins coverage; current by
construction; measured, not asserted) is emitted inside the block, inseparable
from the chart. Reuses tally() so the chart and CLI summary can't disagree.
context7's side is a recorded human judgment, so the snapshot is the honest —
and only — data source.
Reconcile after adding 3 test_compare.py tests (bar-chart render + zero-n guard
+ README emit-block drift guard) via scripts/sync-test-counts.sh. Historical
milestone prose (0 → 50 Python) deliberately untouched.
…nd holes (#46)

Address the /idd-verify #46 ensemble findings on the fail-loud guard (the core
deliverable), all confirmed as real gaps in the guarantee:
- exactly-one-block invariant (_sole_block): a second/duplicate sentinel block
  or a moved block no longer slips past --check/--write (was first-match only).
- captured_at validated as a bare ISO date before emit: refuses "captured None"
  AND blocks a crafted --sample from injecting markup / a stray END sentinel.
- --check/--write now require --emit-readme (argparse error), closing the
  mis-invoked-guard false-pass (exit 0 without checking).
- atomic README write (temp + os.replace) so an interrupted --write can't truncate.
- bar() clamps filled to [0,width] (defensive; unreachable in today's tally).
- 5 new tests drive main(['--emit-readme','--check']) directly (in-sync→0,
  drift→1, missing-flag→SystemExit) — the CLI fail-loud path was previously
  only covered by a re-implementation of the regex, not the real entry point.
Reconcile after the guard-hardening tests (test_compare.py 15→20) via
scripts/sync-test-counts.sh. Milestone prose (0 → 50 Python) left frozen.
#46)

- exactly-one *well-formed* block: _sole_block now also requires raw BEGIN/END
  occurrence counts == 1, so an orphaned BEGIN (a stale chart with no matching
  END, which still renders on GitHub) fails --check — the round-1 HIGH's last edge.
- captured_at validated via date.fromisoformat round-trip (not a shape-only
  regex): rejects calendar-impossible dates (2026-99-99) and Unicode digits too.
- --check / --write are now a mutually-exclusive argparse group.
- --write catches the sentinel ValueError for a clean exit-1 message (symmetric
  with --check), instead of a raw traceback; the malformed-block hint now says
  "restore the sentinels by hand" (--write can't recover a missing block).
- _atomic_write preserves the target's file mode (mkstemp defaults to 0600).
- 2 new tests drive main() end-to-end: an orphaned-second-block --check→1 and a
  --write round-trip (+_atomic_write); the usage-guard test now asserts the exit
  CODE is non-zero (round-2 DA: raises(SystemExit) alone passes on sys.exit(0)).
Reconcile after the round-2 residual-closing tests (test_compare.py 20→22) via
scripts/sync-test-counts.sh. Milestone prose (0 → 50 Python) left frozen.
@kiki830621
kiki830621 merged commit 048f64b into main Jul 4, 2026
1 check passed
@kiki830621
kiki830621 deleted the idd/46-readme-promote-vs-context7-freshness-sta branch July 4, 2026 21:46
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant