Repository navigation
test(#4107): golden fixture for the git-history and spec-alignment equations - #4118
Merged
Merged
Conversation
…uations The crucible golden scans with git history ablated (#2985) and without spec alignment (opt-in, #3111), so Authorship Centralization, Ownership Entropy, Raw Churn Frequency, Instability / Volatility / Specification Exposure and the Architect were constant there and nothing regression-tested them. - tests/history_golden.py builds a small repo with a SCRIPTED history (4 authors, fixed UTC epoch dates, branch main, no merges, isolated git config), scans it with history on and --spec-alignment, and snapshots those 7 fields per file into tests/history_golden_baseline.json (re-bless: --bless). - Engine hook: chronometer's history window ("--since=1.year") was measured against today's date, so a pinned history drifted with the calendar. GITGALAXY_HISTORY_NOW=<epoch> pins "today" (--since=@<now - 365d>); unset, every real scan is byte-identical to before. - One commit is dated > 1 year before the pinned now; the test asserts it is excluded (engine/core.py counts 6 of its 7 commits), proving the pin. Deterministic: identical across repeated runs and under a different TZ. About 2 s; runs in the default suite (skips without git). Co-Authored-By: Claude Opus 5.5 (1M context) <[email protected]>
Contributor
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.
Closes #4107.
Problem
The crucible golden scans with git history ablated (
GITGALAXY_DISABLE_GIT_HISTORY=1, deliberately, #2985/#2976) and without spec alignment (opt-in, #3111). Seven fields were therefore constant on every crucible file, and their equations were never regression-tested:What this adds
A scripted-history fixture (
tests/history_golden.py):main, no merges, and an isolated git config (GIT_CONFIG_NOSYSTEM,GIT_CONFIG_GLOBAL,HOME).--spec-alignment(one[SPEC-1]tag across three functions), then snapshots those 7 fields per file intotests/history_golden_baseline.json.tests/test_history_golden.pydiffs the scan against the snapshot. It takes about 2 s, runs in the default suite, and skips without git.python tests/history_golden.py --bless.One engine hook, opt-in.
git log --since=1.year) is measured against today's date, so the same pinned history would drift as the calendar moves. That was the only wall-clock dependency found: nothing reads the user's git identity, the timezone or absolute paths.GITGALAXY_HISTORY_NOW=<epoch>pins "today" (--since=@<now − 365 days>). When it's unset, every scan is unchanged.Proof that the pin is honoured. One commit is dated more than a year before the pinned "now". The test asserts it's excluded:
engine/core.pycounts 6 of its 7 commits.Verification
TZ=America/Los_Angeles.Follow-ups (not here)
git log -1at HEAD / root commit), so a subdirectory scan's stability ratio depends on the whole repo. That's documented in the investigation, not changed.repo_min.🤖 Generated with Claude Code