README: promote vs-context7 freshness stat + a harness-generated Unicode bar chart to the top#47
Merged
Conversation
…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.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
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 --writefrom 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.py—render_bar_chart+render_readme_block+--emit-readme/--write/--check(reusestally())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)Checklist
Refs #46)/idd-verify #46)/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.