Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
193 commits
Select commit Hold shift + click to select a range
fb10a16
Forward-only develop + dual-target Dependabot/codegen + workflow clea…
ptr727 May 12, 2026
9059936
Auto-merge-disable safeguard, repo-wide SHA pins, AGENTS.md tighten, …
ptr727 May 12, 2026
d72c5fc
Fix pre-release badges and develop ruleset auto-merge stall (#85)
ptr727 May 13, 2026
0c1b8f0
Update codegen files
ptr727-codegen[bot] May 18, 2026
fab7702
Update codegen files (#87)
ptr727-codegen[bot] May 18, 2026
a85fe6c
Migrate App-token to client-id and drop inert codegen PR base filter …
ptr727 May 25, 2026
1ba1399
Update codegen files
ptr727-codegen[bot] May 25, 2026
0729212
Update codegen files (#94)
ptr727-codegen[bot] May 25, 2026
1d99e74
Update codegen files
ptr727-codegen[bot] Jun 1, 2026
2820829
Update codegen files (#96)
ptr727-codegen[bot] Jun 1, 2026
c086945
Update codegen files
ptr727-codegen[bot] Jun 3, 2026
359bfab
Update codegen files (#104)
ptr727 Jun 4, 2026
7671bea
Adopt two-phase CI/CD with PR smoke builds and opt-in publish (#99)
ptr727 Jun 4, 2026
810cd4b
Update codegen files
ptr727-codegen[bot] Jun 4, 2026
321c9f7
Update codegen files (#105)
ptr727-codegen[bot] Jun 4, 2026
572bed9
Decouple release assembly, back-port CI/CD fixes, refresh codegen (#110)
ptr727 Jun 5, 2026
10c83d1
Update codegen files
ptr727-codegen[bot] Jun 5, 2026
f8ab3a7
Update codegen files (#112)
ptr727-codegen[bot] Jun 5, 2026
e9d8d8a
Standardize ASCII and line endings repo-wide; refresh codegen (#115)
ptr727 Jun 5, 2026
55c2049
Update codegen files
ptr727-codegen[bot] Jun 6, 2026
134a665
Update codegen files (#118)
ptr727-codegen[bot] Jun 6, 2026
26971a5
Update codegen files
ptr727-codegen[bot] Jun 7, 2026
1783d72
Update codegen files (#121)
ptr727-codegen[bot] Jun 7, 2026
0c78066
Update codegen files
ptr727-codegen[bot] Jun 8, 2026
61281a9
Update codegen files (#122)
ptr727-codegen[bot] Jun 8, 2026
8e8a586
Propagate template contract to derived repos and roll up codegen (#125)
ptr727 Jun 8, 2026
0b43a61
Document ruleset full-payload PUT and markdownlint --fix adoption (#127)
ptr727 Jun 8, 2026
cf87030
Document the develop-leads versioning model (#132)
ptr727 Jun 8, 2026
f6b7672
Update codegen files
ptr727-codegen[bot] Jun 9, 2026
26a0550
Update codegen files (#134)
ptr727-codegen[bot] Jun 9, 2026
8f778ca
Update codegen files
ptr727-codegen[bot] Jun 10, 2026
868b9b2
Update codegen files (#135)
ptr727-codegen[bot] Jun 10, 2026
554ab91
Update codegen files
ptr727-codegen[bot] Jun 11, 2026
f453672
Update codegen files (#137)
ptr727-codegen[bot] Jun 11, 2026
4f440fc
Update codegen files
ptr727-codegen[bot] Jun 12, 2026
79a118e
Update codegen files (#139)
ptr727-codegen[bot] Jun 12, 2026
458f167
Update codegen files
ptr727-codegen[bot] Jun 14, 2026
0b1395c
Update codegen files (#141)
ptr727-codegen[bot] Jun 14, 2026
6aa3bb5
Update codegen files
ptr727-codegen[bot] Jun 15, 2026
7219cb1
Update codegen files (#144)
ptr727-codegen[bot] Jun 15, 2026
8dca8d3
Update codegen files
ptr727-codegen[bot] Jun 16, 2026
e2c317e
Update codegen files (#145)
ptr727-codegen[bot] Jun 16, 2026
c4b0d19
Update codegen files
ptr727-codegen[bot] Jun 17, 2026
9d044ce
Update codegen files (#148)
ptr727-codegen[bot] Jun 17, 2026
9bdd146
Update codegen files
ptr727-codegen[bot] Jun 18, 2026
1c10878
Update codegen files (#150)
ptr727-codegen[bot] Jun 18, 2026
6f07979
Update codegen files
ptr727-codegen[bot] Jun 19, 2026
3fdbe36
Update codegen files (#152)
ptr727-codegen[bot] Jun 19, 2026
a5b5819
Update codegen files
ptr727-codegen[bot] Jun 20, 2026
6e21bc1
Update codegen files (#153)
ptr727-codegen[bot] Jun 20, 2026
b18ede0
Update codegen files
ptr727-codegen[bot] Jun 21, 2026
fadfa97
Update codegen files (#165)
ptr727-codegen[bot] Jun 21, 2026
8363822
Update codegen files
ptr727-codegen[bot] Jun 22, 2026
a95efbb
Update codegen files (#177)
ptr727-codegen[bot] Jun 22, 2026
737b6ce
Promote develop to main: CODESTYLE consolidation, Copilot runbook, CI…
ptr727 Jun 22, 2026
023f96f
Guard release publish against non-default-ref dispatch mis-versioning…
ptr727 Jun 23, 2026
5c09edd
Update codegen files
ptr727-codegen[bot] Jun 23, 2026
6f540f5
Update codegen files (#187)
ptr727-codegen[bot] Jun 23, 2026
b49fd84
Release: promote develop to main (#191)
ptr727 Jun 23, 2026
8a701a9
Release: promote develop to main (#195)
ptr727 Jun 23, 2026
21e7c0a
Release: promote develop to main (#200)
ptr727 Jun 23, 2026
50144aa
Release: promote develop to main (#202)
ptr727 Jun 24, 2026
39e2484
Release: promote develop to main (#225)
ptr727 Jul 4, 2026
a0f44a4
Repurpose ProjectTemplate into a governance and workflow-audit catalo…
ptr727 Jul 5, 2026
8b9bd14
Promote develop to main (#252)
ptr727 Jul 7, 2026
fec2a8a
Promote develop to main (#260)
ptr727 Jul 8, 2026
5d3d73b
Promote develop to main: merge-bot every-tier policy + repo-settings/…
ptr727 Jul 9, 2026
a1b14a4
Promote develop to main: agent-comms + supported-platforms + C# test/…
ptr727 Jul 9, 2026
a6da575
Promote develop to main: per-surface lint architecture, mandatory REA…
ptr727 Jul 12, 2026
00f0664
Promote develop to main: --pull=always on local lint tasks + cspell o…
ptr727 Jul 12, 2026
8eb4588
Promote develop to main: publish-plan snippet, release-model docs, wo…
ptr727 Jul 12, 2026
5ec9a87
Promote develop to main: operational workflow model for live-config r…
ptr727 Jul 13, 2026
88c9550
Promote develop to main: repo-wide bot-node-id cold-start fallback (#…
ptr727 Jul 14, 2026
ba58f64
Promote: CODESTYLE cspell-externalization fix (#298)
ptr727 Jul 14, 2026
72bf201
Promote: AGENTS git-governance / author-identity rule (#300)
ptr727 Jul 14, 2026
8f8d65b
Promote: scope CI spell-check to README + HISTORY (#302, #303) (#304)
ptr727 Jul 15, 2026
cf752b7
Promote develop to main: source-only Python template adaptation (#306…
ptr727 Jul 16, 2026
10ff417
Promote develop to main: onboarding governance (STANDUP/self-test) + …
ptr727 Jul 16, 2026
1b88d2b
Promote develop to main: reusable validate-task gates the publisher (…
ptr727 Jul 16, 2026
787a682
Promote develop to main: post-sync fixes + the live fleet-audit runne…
ptr727 Jul 16, 2026
e9f7c96
Promote develop to main: fidelity verification system, agent write-sa…
ptr727 Jul 22, 2026
add00db
Promote develop to main: fidelity tooling, manifest hardening, diverg…
ptr727 Jul 22, 2026
59c8f81
Promote develop to main: configure.sh check mode + history-rewrite si…
ptr727 Jul 22, 2026
029f358
Promote develop to main: per-section fidelity, issue generator, edito…
ptr727 Jul 23, 2026
9421198
Promote develop to main: adoption-feedback batch, hygiene checks, can…
ptr727 Jul 23, 2026
ee77474
Promote develop to main: PhotoCleaner + finmod convergence fleet-law …
ptr727 Jul 23, 2026
b41354b
Promote develop to main: PhotoCleaner registry + #414 release-pipelin…
ptr727 Jul 23, 2026
bd2dcd6
Promote develop to main: comment layout + AGENTS section-fidelity mod…
ptr727 Jul 24, 2026
e83288e
Promote develop to main: genericize verbatim sections + canonical des…
ptr727 Jul 24, 2026
2a178f0
Promote governance doc updates to main (#425, #426, #427) (#428)
ptr727 Jul 25, 2026
4ae5717
Promote audit + release-task fixes and backlog items to main (#430-#4…
ptr727 Jul 25, 2026
6e8039b
Promote the lint-only language type work to main (#437-#440) (#441)
ptr727 Jul 25, 2026
137ab3e
Promote merge-gate, CODESTYLE, and backlog updates to main (#443-#445…
ptr727 Jul 25, 2026
ea2dd1f
Promote the config-repo convergence hub fixes to main (#447) (#448)
ptr727 Jul 25, 2026
059d749
Promote the agent git-bypass guard and Copilot poll-backoff to main (…
ptr727 Jul 26, 2026
8b7397f
Promote the safety-kit README update to main (#452) (#453)
ptr727 Jul 26, 2026
80a3c68
Promote the AGENTS.md router split and the scripts/ gate harness to m…
ptr727 Jul 30, 2026
ef9a816
Promote the tiered charset rule and the comment gate to main (#460)
ptr727 Jul 31, 2026
585f62a
Promote the promotion-loop mechanics to main (#469)
ptr727 Jul 31, 2026
0a498a6
Promote the multi-line string carry and the router-split items to mai…
ptr727 Jul 31, 2026
52bcd7a
Promote the prose sweeps and the suppressed-findings digest to main (…
ptr727 Jul 31, 2026
1d5b076
Promote the onboarding and host-setup fixes to main (#486)
ptr727 Aug 1, 2026
cea1804
Promote the agent-enablement framing and the write-guard owner scope …
ptr727 Aug 1, 2026
6501479
Promote the prose-gate fixes and the configure.sh sweep to main (#502)
ptr727 Aug 1, 2026
048a442
Refresh the PhotoCleaner audit report and driftNotes (#508)
ptr727 Aug 1, 2026
38d79e1
Promote the OPERATIONS.md requirement, the merge-bot declaration, and…
ptr727 Aug 1, 2026
275edbf
Promote the wait failure clause, the five review outcomes, and the pi…
ptr727 Aug 3, 2026
a9cd154
Promote develop to main: the representative-data rule (#533)
ptr727 Aug 3, 2026
3a7cc64
Promote develop to main: fleet bootstrap, gate honesty, and the re-ve…
ptr727 Aug 3, 2026
7194f91
Promote develop to main: the bypass list leaves the fleet config (#548)
ptr727 Aug 3, 2026
3b802b9
Promote develop to main: repair the fleet-wide false ruleset DEFECT (…
ptr727 Aug 3, 2026
1b4a80e
Promote develop to main: the suppressed-findings fix and audit gates …
ptr727 Aug 6, 2026
c37ec73
Promote develop to main: the review-digest repository argument and th…
ptr727 Aug 6, 2026
ba9f9cc
Promote develop to main: hub-hosted tooling, the Copilot refusal read…
ptr727 Aug 6, 2026
d4092dd
Promote develop to main: the prose backlog cleared, and a review loop…
ptr727 Aug 8, 2026
f353630
Bump the actions-deps group with 4 updates
dependabot[bot] Aug 8, 2026
d81e3dd
Bump the actions-deps group with 4 updates (#611)
ptr727-codegen[bot] Aug 8, 2026
9de93c9
Promote develop to main: the standup branch bootstrap and the partial…
ptr727 Aug 8, 2026
b00de37
Promote develop to main: the blocked-merge reading and the open pull …
ptr727 Aug 8, 2026
74e2193
Promote develop to main: the prose gate now blocks on every default r…
ptr727 Aug 8, 2026
2fb1411
Promote the File Table Reading to Main (#626)
ptr727 Aug 8, 2026
c40cd0a
Promote Three Rule and Runbook Corrections to Main (#630)
ptr727 Aug 8, 2026
b4b8f2e
Promote the README Rework, the Tool-Row Repair, and the Line-Ending G…
ptr727 Aug 9, 2026
0a86bca
Promote the Tagline Close, the Ledger Refresh, and the Pre-Commit Doc…
ptr727 Aug 9, 2026
69e638f
Promote the Sync Entrypoint, Deletion Detector, and Host Contract (#655)
ptr727 Aug 10, 2026
d9b5ffa
Promote the Carried Reference to the Hub-Hosted Script (#658)
ptr727 Aug 10, 2026
b624195
Promote the Sweep Correction and the Carried-Text Record (#661)
ptr727 Aug 11, 2026
1927e9a
Promote the Release History Correction (#663)
ptr727 Aug 11, 2026
01a6e9a
Promote the Scan-Scope Fixes, the Host Stamp, and the Bootstrap Tooli…
ptr727 Aug 11, 2026
0e84805
Promote the Fleet Skills, the Windows and Docker Host Setup, and the …
ptr727 Aug 15, 2026
b09078e
Promote the Fleet Resync Reports, the copilot-instructions Fixes, and…
ptr727 Aug 15, 2026
79f4f17
Promote the Workflow Manifest Declarations and the Carried-Wording Fi…
ptr727 Aug 15, 2026
20616e0
Promote develop to main After the Hub-Hosted Merge-Bot and the PhotoC…
ptr727 Aug 15, 2026
82fecef
Promote develop to main With the Hub-Hosted Workflow Tasks and the LF…
ptr727 Aug 16, 2026
9849fba
Bump astral-sh/setup-uv from 8.1.0 to 10.0.0 in the actions-deps group
dependabot[bot] Aug 16, 2026
5b8e39b
Bump astral-sh/setup-uv from 8.1.0 to 10.0.0 in the actions-deps grou…
ptr727-codegen[bot] Aug 16, 2026
0b07a59
Promote develop to main With the Release Task Scope Fix (#774)
ptr727 Aug 16, 2026
5d0fa7f
Promote develop to main With the Pilot Follow-Ups and the Get-Version…
ptr727 Aug 17, 2026
7d50118
Promote Develop to Main With the Token Efficiency Plan (#787)
ptr727 Aug 17, 2026
df79b09
Bump astral-sh/setup-uv from 10.0.0 to 10.0.1 in the actions-deps group
dependabot[bot] Aug 17, 2026
6516416
Bump astral-sh/setup-uv from 10.0.0 to 10.0.1 in the actions-deps gro…
ptr727-codegen[bot] Aug 17, 2026
b5f3c28
Promote Develop to Main (#794)
ptr727 Aug 17, 2026
f97ee8f
Promote Develop to Main (#796)
ptr727 Aug 17, 2026
2d360ef
Bump streetsidesoftware/cspell-action in the actions-deps group
dependabot[bot] Aug 18, 2026
a2a2740
Bump streetsidesoftware/cspell-action from 8.4.0 to 9.0.1 in the acti…
ptr727-codegen[bot] Aug 18, 2026
ce9b9a5
Promote Develop to Main (#811)
ptr727 Aug 18, 2026
b74811b
Promote Develop to Main (#816)
ptr727 Aug 18, 2026
3377f51
Promote Develop to Main (#818)
ptr727 Aug 18, 2026
4596659
Promote Develop to Main (#820)
ptr727 Aug 18, 2026
537b183
Promote .NET Publish Naming Contract (#822)
ptr727 Aug 18, 2026
a17bfb8
Promote the Validation Bootstrap Pin (#828)
ptr727 Aug 19, 2026
e2c4ec4
Promote Carried Documentation Link Validation (#831)
ptr727 Aug 19, 2026
74ef727
Promote Source-Only Release Contract (#835)
ptr727 Aug 19, 2026
2ab4e2a
Promote Develop to Main (#841)
ptr727 Aug 19, 2026
241bfd0
Promote Develop to Main (#846)
ptr727 Aug 19, 2026
eca5b1f
Promote Copilot Skill Link Fix (#854)
ptr727 Aug 19, 2026
dd520cc
Promote develop to main (#857)
ptr727 Aug 19, 2026
389f5b9
Promote Develop to Main (#860)
ptr727 Aug 20, 2026
563ce83
Promote Develop to Main (#864)
ptr727 Aug 20, 2026
105fe34
Bump docker/setup-buildx-action in the actions-deps group
dependabot[bot] Aug 20, 2026
6c00bbd
Bump docker/setup-buildx-action from 4.2.0 to 4.3.0 in the actions-de…
ptr727-codegen[bot] Aug 20, 2026
c62eb09
Promote Develop to Main (#867)
ptr727 Aug 20, 2026
6e79398
Promote Develop to Main (#874)
ptr727 Aug 20, 2026
1bbc004
Handle Copilot Review Effort Levels (#877)
ptr727 Aug 20, 2026
964128a
Promote Docker Lint Authorization to main (#880)
ptr727 Aug 20, 2026
41073d2
Promote Develop to Main (#882)
ptr727 Aug 20, 2026
b05decc
Promote Develop to Main (#884)
ptr727 Aug 21, 2026
0d0e511
Promote Develop to Main (#891)
ptr727 Aug 21, 2026
5e1aef5
Promote Develop to Main (#897)
ptr727 Aug 21, 2026
e0c5562
Promote Develop to Main (#899)
ptr727 Aug 21, 2026
f3bfdb4
Promote Develop to Main (#901)
ptr727 Aug 22, 2026
f066c4f
Promote Develop to Main (#907)
ptr727 Aug 22, 2026
2e0b130
Promote Develop to Main (#910)
ptr727 Aug 22, 2026
d5605f5
Promote Develop to Main (#914)
ptr727 Aug 22, 2026
37aa042
Promote Develop to Main (#921)
ptr727 Aug 22, 2026
7383114
Promote Develop to Main (#936)
ptr727 Aug 23, 2026
30b9322
Promote Develop to Main (#945)
ptr727 Aug 23, 2026
3927fec
Promote Develop to Main (#952)
ptr727 Aug 23, 2026
cd7bae9
Promote Develop to Main (#959)
ptr727 Aug 23, 2026
be4d3bf
Promote Develop to Main (#963)
ptr727 Aug 24, 2026
e193ac6
Promote Develop to Main (#970)
ptr727 Aug 24, 2026
b675aec
Promote Develop to Main (#975)
ptr727 Aug 24, 2026
a49767e
Promote Develop to Main (#978)
ptr727 Aug 25, 2026
fa63163
Promote Develop to Main (#982)
ptr727 Aug 25, 2026
7b21025
Promote Develop to Main (#991)
ptr727 Aug 25, 2026
df489f3
Promote Develop to Main (#996)
ptr727 Aug 25, 2026
eec53ea
Promote Develop to Main (#1002)
ptr727 Aug 25, 2026
495d69e
Promote Develop to Main (#1004)
ptr727 Aug 25, 2026
702bb7e
Promote Develop to Main (#1008)
ptr727 Aug 25, 2026
5ab8d22
Promote develop to main (#1013)
ptr727 Aug 25, 2026
bd627ed
Normalize a Dependabot Pin Bump Out of the Intent Staleness Advisory
ptr727 Aug 25, 2026
6a769e6
Address CodeRabbit and Qodo Review Findings on PR #1014
ptr727 Aug 25, 2026
c0f7afd
Document _last_effective_change's Linear-History Assumption
ptr727 Aug 25, 2026
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
163 changes: 123 additions & 40 deletions spec/audit.py
Original file line number Diff line number Diff line change
Expand Up @@ -1714,42 +1714,80 @@ def classify_verbatim(down_text, canon_text, past_texts):
return "modified"


_HISTORY_CACHE: dict[
str, list[str]
] = {} # rel_path -> past revision contents, cached because one canonical is compared against every audited repo

@functools.cache
def _git_revisions(rel_path):
"""Every commit that touched rel_path in the hub's history, newest first, as (date, sha, text).

def git_file_history(rel_path):
"""Every past revision's content of a hub-tracked file (to tell a stale copy from a modified one), cached per rel_path."""
if rel_path in _HISTORY_CACHE:
return _HISTORY_CACHE[rel_path]
out = []
# Decode as UTF-8 with replacement to match the downstream and canonical reads.
# A divergent decode would fabricate a mismatch.
`text` is None where `git show` failed (rare: a permission or encoding fluke, not absence,
since the commit came from `git log -- rel_path` and so the path existed at that revision).
Comment thread
coderabbitai[bot] marked this conversation as resolved.
Cached because one canonical's history is read once per fidelity/staleness check, then reused
for every audited repo's copy.
"""
r = subprocess.run(
["git", "log", "--format=%H", "--", rel_path],
["git", "log", "--format=%cI %H", "--", rel_path],
cwd=ROOT,
capture_output=True,
encoding="utf-8",
errors="replace",
text=True,
check=False,
Comment thread
coderabbitai[bot] marked this conversation as resolved.
)
if r.returncode == 0:
for sha in r.stdout.split():
s = subprocess.run(
["git", "show", f"{sha}:{rel_path}"],
cwd=ROOT,
capture_output=True,
encoding="utf-8",
errors="replace",
check=False,
)
if s.returncode == 0:
out.append(s.stdout)
_HISTORY_CACHE[rel_path] = out
if r.returncode != 0:
# A real command failure (not a git repo, a corrupt object) must not read as "no
# history": that silently clears the intent-staleness advisory and drops verbatim's
# past-revision list, both misreporting a tool fault as a clean audit.
raise RuntimeError(f"git log failed for {rel_path}: {r.stderr.strip()}")
if not r.stdout.strip():
return []
out = []
for line in r.stdout.splitlines():
date, sha = line.split(" ", 1)
# Decode as UTF-8 with replacement to match the downstream and canonical reads.
# A divergent decode would fabricate a mismatch.
s = subprocess.run(
["git", "show", f"{sha}:{rel_path}"],
cwd=ROOT,
capture_output=True,
encoding="utf-8",
errors="replace",
check=False,
)
out.append((date, sha, s.stdout if s.returncode == 0 else None))
return out


def git_file_history(rel_path):
"""Every past revision's content of a hub-tracked file (to tell a stale copy from a modified one)."""
return [text for _, _, text in _git_revisions(rel_path) if text is not None]


def _last_effective_change(revisions):
"""The (date, sha) of the newest revision in `revisions` (newest-first (date, sha, text)
triples for one file) whose content differs from its predecessor after normalize(), or the
oldest (creation) revision if every later one differs from its predecessor only by normalized
churn (spec/fidelity-model.md "Normalization": EOL, a Dependabot action-pin bump, a pruned
`needs:` list). None if `revisions` is empty.

The creation revision always counts as effective: it has no predecessor, and normalize()
applied to only one side proves nothing. A revision with unreadable text (None) also counts as
effective rather than being silently skipped, since a real difference cannot be ruled out.

`revisions` is assumed newest-first with each entry the immediate predecessor of the one
before it (verified empirically over every intent-fidelity canonical file's full history,
ptr727/ProjectTemplate#1014): this repo's own branching is forward-only (no back-merges from
main into develop) with feature branches squash-merged one at a time, so a canonical file's
per-path `git log` is a single line, not a graph with siblings to mis-order. A canonical file
reached through a genuinely branching history (a direct hotfix to main alongside independent
develop work touching the same path) would need each revision compared against its actual git
parent(s) instead of its list neighbor.
"""
for i, (date, sha, text) in enumerate(revisions):
if i + 1 == len(revisions):
return date, sha
older_text = revisions[i + 1][2]
if text is None or older_text is None or normalize(text) != normalize(older_text):
Comment thread
qodo-code-review[bot] marked this conversation as resolved.
return date, sha
return None


@functools.cache
def git_blob_in_file_history(rel_path, blob_sha):
"""Whether a blob occurred in a path's hub history."""
Expand All @@ -1765,21 +1803,22 @@ def git_blob_in_file_history(rel_path, blob_sha):

@functools.cache
def hub_last_change(rel_path):
"""The hub checkout's last commit touching rel_path, as (iso_date, short_sha), or None if untracked.
"""The hub checkout's most recent EFFECTIVE change to rel_path, as (iso_date, short_sha), or
None if untracked.

"Effective" excludes normalized churn (spec/fidelity-model.md "Normalization": EOL, a
Dependabot action-pin bump, a pruned `needs:` list) the same way the verbatim check already
does, via _last_effective_change over the file's full history. A raw last-commit date treated
every one of those bumps as the copy "trailing", even though the fidelity model already
Comment thread
qodo-code-review[bot] marked this conversation as resolved.
classifies that class as governed per-repo drift rather than a deviation (ptr727/ProjectTemplate#735).

Cached because one canonical's date is compared against every audited repo's copy.
"""
r = subprocess.run(
["git", "log", "-1", "--format=%cI %h", "--", rel_path],
cwd=ROOT,
capture_output=True,
text=True,
check=False,
)
if r.returncode != 0 or not r.stdout.strip():
change = _last_effective_change(_git_revisions(rel_path))
if change is None:
return None
date, sha = r.stdout.strip().split(" ", 1)
return date, sha
date, sha = change
return date, sha[:7]


def intent_canonical_rel(item, path):
Expand Down Expand Up @@ -1810,8 +1849,10 @@ def check_intent_staleness(slug, ground, path, canonical_rel, down_text):
(spec/fidelity-model.md), which is how a copy trailed the hub by many revisions while every
check read clean. No reconciliation record exists anywhere, so the implementable proxy is
when each side last changed: the hub canonical changing after the repo's copy marks the copy
as possibly trailing. Advisory only, DRIFT and never a failure, and honest about its blind
spot: a copy touched after the hub change without actually reconciling reads current.
as possibly trailing. "Changed" excludes normalized churn (hub_last_change), so a Dependabot
action-pin bump or a needs-list prune does not by itself mark every carrier as trailing.
Advisory only, DRIFT and never a failure, and honest about its blind spot: a copy touched
after the hub change without actually reconciling reads current.

A copy content-identical to the canonical cannot trail it, so that case is skipped however
old the copy's last commit is. It is also the promotion candidate spec/fidelity_honesty.py
Expand Down Expand Up @@ -3158,6 +3199,48 @@ def _selftest():
" ok needs-mask: pruned needs (inline, block, scalar) normalizes equal, forked step differs, next key preserved"
)

# _last_effective_change must skip a normalized-only bump, per ptr727/ProjectTemplate#735.
d3, d2, d1 = (
"2024-03-01T00:00:00+00:00",
"2024-02-01T00:00:00+00:00",
"2024-01-01T00:00:00+00:00",
)
lec_cases = [
(
"every bump back to creation is pin-only -> creation wins",
[(d3, "sha3", pin_b), (d2, "sha2", pin_a), (d1, "sha1", pin_a)],
(d1, "sha1"),
),
(
"newest differs for real -> newest wins",
[(d3, "sha3", pin_struct), (d2, "sha2", pin_a), (d1, "sha1", pin_a)],
(d3, "sha3"),
),
(
"newest is a pin-only bump over a real change -> the real change wins",
[(d3, "sha3", pin_b), (d2, "sha2", pin_a), (d1, "sha1", pin_struct)],
(d2, "sha2"),
),
(
"one revision (creation) -> that revision wins, nothing to compare against",
[(d1, "sha1", "only revision\n")],
(d1, "sha1"),
),
(
"unreadable newest text -> treated as effective, never silently skipped",
[(d2, "sha2", None), (d1, "sha1", "whatever\n")],
(d2, "sha2"),
),
("no history -> None", [], None),
]
for label, revisions, want in lec_cases:
got = _last_effective_change(revisions)
if got != want:
Comment thread
qodo-code-review[bot] marked this conversation as resolved.
ok = False
print(
f" {'ok ' if got == want else 'FAIL'} want={want!s:<24} got={got!s:<24} _last_effective_change: {label}"
)

# Region extraction and hashing: a forked github-release block must hash differently from the canonical.
region = split_jobs(rel_ok).get("github-release")
forked_region = split_jobs(
Expand Down
2 changes: 1 addition & 1 deletion spec/fidelity-model.md
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ Carried content is a class with virtual functions. The **fixed** part is the int
Each [`spec/files.json`][files] entry declares one `fidelity`, defaulting to `presence`.

- **presence** - the unit exists (a file, or a Markdown section heading). The audit's baseline check.
- **intent** - carried faithfully but judged by meaning, not bytes. A downstream copy legitimately differs (a governed divergence or a paraphrase), and equivalence is a human call via `intentRef`. The audit asserts presence, plus a last-modified staleness advisory at drift: a hub canonical changing after the copy's own last commit marks the copy as possibly trailing, a hint rather than proof, and content is never judged.
- **intent** - carried faithfully but judged by meaning, not bytes. A downstream copy legitimately differs (a governed divergence or a paraphrase), and equivalence is a human call via `intentRef`. The audit asserts presence, plus a last-modified staleness advisory at drift: a hub canonical changing after the copy's own last commit marks the copy as possibly trailing, a hint rather than proof, and content is never judged. That "changing" walks past a revision whose diff is normalized-only (the same line-ending, action-pin, and job-needs normalization as verbatim below), so a Dependabot pin bump on a workflow file does not by itself mark every carrier as trailing (ptr727/ProjectTemplate#735).
- **verbatim** - byte-identical to the hub's canonical after line-ending, action-pin, and job-needs normalization. The audit content-hashes the downstream copy against canonical. It applies to a whole file, a workflow job region (a job selected by key), or a Markdown section region (a `## heading` block selected by name). The section granularity lets one file be **intent overall while a few of its sections are verbatim**. A universal rule block stays byte-identical fleet-wide even though the rest of the document is a repo-adapted paraphrase, so a stale section or a missing rule is caught while its heading still passes the presence check.
- **interface** - an overridable body that must honor a named contract. The audit checks the contract by name and wiring, never the body.

Expand Down
Loading