Repository navigation
Realize add-citation-remainder-report R1: the report CLI and its tests - #1100
Conversation
…md 2.1) The whole of `scripts/report-citation-remainder.py`, realizing the ratified delta's five requirements over the shipped resolver, which it imports UNCHANGED and consumes as a library: * THE POPULATION — `git ls-files -s` tracked ENTRIES, the three default exclusions each with its stated reason, the report's own output path that no refinement may re-admit, and `--include`/`--exclude` under the three promoted refinement semantics (segment-boundary matching, re-admit-not-replace, removal-applied-last-and-wins). FOUR skip terms, not three: an entry skipped because its path leaves the repository root once resolved is a tracked FILE that reaches no decoder and has its own term, printed even at zero. * THE TOKEN GRAMMAR — the promoted extraction pattern, the trailing separator stripped unconditionally because the grammar admits `/` in no identifier, and resolution tried FIRST before any trailing character the change-id grammar DOES admit is stripped. One record per TOKEN; `raw` per OCCURRENCE. * THE FIVE SIGNALS AND THE WINDOW — the citing line plus the three lines above it, the closed repository-name vocabulary, case-insensitive matching, and one matcher function per signal in one delimited section beside the class predicates. `possibly-cross-repo` is a FLAG and never a class. * THE CLASSES — the closed four, with `truncated`'s three measured probes, its ALL-occurrence rule and its union with the trailing-hyphen arm; `punctuation-stripped`'s three-part firing condition; `fixture-path`'s closed four locations under the same ALL rule; and the precedence, normalization over location and `truncated` over `punctuation-stripped`. * THE OUTPUT — two parts in a fixed order, counts then the itemized remainder, identity-nested by default and never grouped by class in either mode; the `--json` shape D2 enumerates; and the two-case exit contract, 0 whatever it finds and non-zero only where the report COULD NOT RUN. No path under the changes root is spelled in this file: every example is written with an angle-bracket placeholder, so the report mints no token of its own and the remainder it reports does not move by its own act. Refs #1053. Lane: openxfactory-1 Co-Authored-By: Claude Fable 5.1 <[email protected]>
MEASURED AGAINST THE HAND CLASSIFICATION, NOT REASONED. The bare-qualifier signal read the last whitespace-delimited run of the text before the token and required that text to END in whitespace, so the spelling this corpus actually writes a qualified citation in — the qualifier, a space, then the token inside backticks — fired nothing: the run immediately before the token was a lone backtick and the qualifier was the run before that. Two of the fourteen cross-repository tokens the evidence's hand read found at `b1df95ee` are exactly that shape, both qualified `codexFactory` immediately before a backticked token, and both went unflagged. With the decoration stripped from the text between the word and the token before the run is read, the flag now catches 13 of the 14 with 2 false positives among the other 43 — which is `design.md` D3(c)'s own measured precision for this rule, reproduced by the shipped code rather than quoted from the design. The one it misses is the one the design already names as reachable by no adjacency rule at all. A GLUED PATH PREFIX NEEDS NO SPECIAL CASE: `/` is not a decoration character, so a path-joined prefix survives the strip whole, fails the vocabulary as the path it is, and is judged by the path-joined signal, which is the signal written for it. Refs #1053. Lane: openxfactory-1 Co-Authored-By: Claude Fable 5.1 <[email protected]>
`tests/citation_remainder/test_report_citation_remainder.py` (NEW): one test per `#### Scenario:` block, its docstring naming the scenario verbatim, in five sections that follow the delta's five requirements. Fixtures are built in `tmp_path` with real git — the population recipe is `git ls-files`, so a committed fixture subdirectory would list THIS repository's files rather than the fixture's, a nested `.git` cannot be committed at all, and `tests/` is one of the population's own three exclusions, so a scratch tree is the only shape that can answer this subject. No `conftest.py` is added beside them: `pytest.ini` anchors the rootdir so the suite-wide hermeticity guard reaches this directory, and a directory `conftest.py` would hijack the ambient `conftest` module name. THREE DEFECTS THE TESTS FOUND IN THE SCRIPT, each fixed here: * THE HUMAN REPORT WROTE TO THE STREAM THIS MODULE WAS IMPORTED WITH. `out` was defaulted `sys.stdout` in the signature, which binds at import; every caller that redirects the stream — the suite's own readers, and a caller capturing a reading in process — got an empty report and no error. Resolved at call time now. * THE SPLIT-STRING-LITERAL PROBE REQUIRED THE TOKEN TO BE THE LAST CHARACTER ON ITS LINE, so it fired on no implicit concatenation at all: the shape it is written for closes its literal at the end of the line it splits, and the closing quote stands after the token. A closing quote is part of ending the line, and a line left open is admitted as before. * EVERY NORMALIZATION IS NOW PRINTED IN ITS OWN ROW of the human report, not only as the difference between an occurrence's raw spelling and the token. A reader who cannot see that the tool changed the token cannot check the tool, and the scenario asks for the normalization to be RECORDED rather than inferable. 96 tests, all green. Refs #1053. Lane: openxfactory-1 Co-Authored-By: Claude Fable 5.1 <[email protected]>
THE TICK RULE'S OWN FIRST CLAUSE: *"a `[x]` below is either a diff in THIS pull request or a measurement recorded verbatim"*. § 2.1's diff lands in this pull request, so the box is ticked here and the record beside it carries the measurement rather than a claim: the two files and their line counts, 63 of 63 scenarios each named by the test that proves it, the reproduction at `b1df95ee` to the token, the three probes' precision against the hand classification, and the Δ = 0 mint check at this branch's merge base and head. §§ 2.2, 2.3 and 2.4 STAY OPEN and are not ticked against an intention: the nightly wiring is a later slice, the committed reading is the slice after that, and the green evidence is a fact about a merge that has not happened. THE PROPOSAL PULL REQUEST'S OWN SCOPE SENTENCE IS LEFT EXACTLY AS RATIFIED. *"NONE OF § 2 IS IN THIS PULL REQUEST"* was true of the pull request that filed the packet and is a record of it; the note added beneath it is an ADDENDUM saying realization has since opened in the later pull request that same heading names, and it moves no decision. Refs #1053. Lane: openxfactory-1 Co-Authored-By: Claude Fable 5.1 <[email protected]>
Lane: openxfactory-1 Co-Authored-By: Claude Fable 5.1 <[email protected]>
There was a problem hiding this comment.
Sorry @brettheap, your pull request is larger than the review limit of 150,000 diff characters
`--history` is opt-in on a MEASURED cost, and the probe was running over every
identity in the corpus rather than over the identities the reading carries: on
this tree that is some five hundred `git log --all --diff-filter=A` invocations
to answer a question about entries the output does not list, where the
measurement D2 quotes ran 38. The default listing is the remainder, `--all`
makes it every token, and the probe now follows the listing in both — which is
the shape D2 states ("each identity record ... gets a `history` field") at the
cost D2 measured.
Refs #1053.
Lane: openxfactory-1
Co-Authored-By: Claude Fable 5.1 <[email protected]>
… applies The five-term identity closes over EVERY token with no raw path; the figure the earlier readings of this population publish holds the resolver's fifth answer OUT, on this delta's own choice (2). The two differ by exactly the count of NOT-A-PACKET-REFERENCE tokens with no raw path — four in this tree — and a report printing only the first invites a reader comparing it against an earlier point in the series to read a four-token drift that is a difference of definition and not of corpus. Refs #1053. Lane: openxfactory-1 Co-Authored-By: Claude Fable 5.1 <[email protected]>
The tick rule's own standard: a `[x]` carries a measurement, and a measurement that drifted by fourteen lines while the branch was still being written is not one. Re-counted at the head this record sits on. Refs #1053. Lane: openxfactory-1 Co-Authored-By: Claude Fable 5.1 <[email protected]>
There was a problem hiding this comment.
🟡 Changes recommended
Unresolved moderate correctness findings remain in the reporting CLI, plus an inconsistent acceptance record.
Get a fresh assessment by requesting another Copilot review.
Pull request overview
Adds a standalone citation-remainder reporting CLI, comprehensive tests, and the §2.1 realization record without nightly integration.
Changes:
- Implements human/JSON reporting, filtering, classification, and history probing.
- Adds 96 tests covering specification scenarios and live-corpus invariants.
- Records realization evidence in
tasks.md.
File summaries
| File | Review summary |
|---|---|
tests/citation_remainder/test_report_citation_remainder.py |
Adds CLI and behavior coverage; no final comments. |
scripts/report-citation-remainder.py |
8 moderate findings: quote-aware apostrophe parsing; ambiguous-token listing; raw-token split probing; parenthetical whitespace grammar; Git failure propagation; NOT_A_PACKET_REFERENCE resolution handling; adjacent opsx: matching; read-error handling. 1 nit: rename the --all output heading to ALL TOKENS. |
openspec/changes/add-citation-remainder-report/tasks.md |
Nit (3 votes): acceptance evidence reports 602 tokens/154 raw-path-absent versus the stated 600/157 run; update or pin the record consistently. |
Review details
Suppressed comments (8)
scripts/report-citation-remainder.py:790
_inside_string_literaltreats every unescaped apostrophe as a quote delimiter, including apostrophes in prose. For example, a file containingit's openspec/changes/add-split/propfollowed by"osal.md"makes this probe return true and falsely classes the unresolved prose citation astruncated, even though it is not inside a string literal. The probe needs quote-aware parsing (or at least to ignore apostrophes embedded in words) to preserve the predicate's meaning.
if character == quote:
count += 1
index += 1
if count % 2 == 1:
return True
scripts/report-citation-remainder.py:1303
- The default listing drops
AMBIGUOUStokens whose raw path exists. An identity claimed by both an active and archived packet is stillAMBIGUOUSeven whenopenspec/changes/<id>/proposal.mdexists;reading.remaindertherefore excludes it and the default report only counts the outcome. The requirement saysAMBIGUOUSmust be itemized, while--allis only supposed to add resolved and not-a-packet-reference entries. Include ambiguous records in the default listing without changing the raw-path-absent remainder counts.
rather than lists."""
scripts/report-citation-remainder.py:1037
- This passes the normalized token into the split-literal probe, so a raw match ending in
.or/is shortened before the two source lines are rejoined. For example,.../prop.followed by"osal.md"is rejoined as.../proposal.mdinstead of the actual.../prop.osal.md, causing the specified resolving split-path probe to miss and leave the entry misclassified. Rejoin the raw spelling while keeping the normalized token for resolver/deduplication.
rejoined = probe_split_string_literal(lines, lineno, end, token, resolves)
scripts/report-citation-remainder.py:722
- The folded parenthetical grammar permits at most one space before
(and then requires the repository-name member itself; whitespace inside the parentheses is not part of that form. Calling.strip()makes inputs such as( codexFactory )fire the cross-repository signal even though they should be rejected, producing a false flag. Do not trim the captured inner text before applying the decoration rules.
inner = match.group("inner").strip()
scripts/report-citation-remainder.py:1080
Resolution.oktreats bothRESOLVEDandNOT_A_PACKET_REFERENCEas successful, but this helper only returns true forRESOLVED. A tracked non-packet path such asopenspec/changes/README.md.can therefore be normalized by stripping its final dot, turning an otherwise out-of-remainder path into a dangling token. Use the resolver'sokproperty here so the resolve-first safeguard also covers the resolver's fifth, path-resolved outcome.
return resolution_of(token).status == RESOLVED
scripts/report-citation-remainder.py:707
- This matcher searches the entire prefix before the token, but the grammar requires the
opsx:<owner>/prefix to be immediately adjacent to the citation. A line such asopsx:owner/ unrelated text openspec/changes/...will therefore flag the later, unrelated token. Anchor the match to the end ofline[:start](or add$to the expression).
return CUSTODY_SCHEME_RE.search(line[:start]) is not None
scripts/report-citation-remainder.py:360
- The population contract distinguishes a file that is not valid UTF-8 from an unreadable tree, but this catches
OSErrorasskipped_undecodableand still exits successfully. Permission errors, I/O failures, or a file disappearing during the read are therefore reported as a valid reading with missing data instead of taking the required could-not-run path; onlyUnicodeDecodeErrorshould be counted as undecodable, while read errors should raiseCouldNotRun.
try:
text = target.read_bytes().decode("utf-8")
except (UnicodeDecodeError, OSError):
population.skipped_undecodable.append(entry.path)
continue
scripts/report-citation-remainder.py:1470
- When
--allis used,listed_recordsincludes resolved andNOT_A_PACKET_REFERENCErecords, but this section is still headedREMAINDER, ITEMIZED. The output label then contradicts the option's documented behavior and can cause readers to treat the extra rows as remainder findings; use anALL TOKENSheading for that mode in both grouping branches.
write("\nCLASSES (counted in TOKENS)\n")
for name in CLASS_VOCABULARY:
write(f" {name:<24} {counts['classes'][name]}\n")
- Files reviewed: 3/3 changed files
- Comments generated: 2
- Review effort level: Lite
💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.
`REPO_ROOT` is caller-supplied text and every git this report runs is one call, so the normalization belongs AT THE SINK where it cannot be forgotten rather than only at the caller: an absolute path cannot begin with `-` and therefore cannot be read by git as an option however the caller spelled it. The refusal beside it is unreachable for a resolved path and is kept as the assertion it is — a root that somehow reached git as an option is a run this report could not take, which is the one non-zero exit it has. Found by SonarCloud on this pull request (`pythonsecurity:S8705`, command argument injection, new_security_rating 3 against a threshold of 1), which is green on this repository's merged pull requests and is therefore a defect of this branch rather than a standing condition. The reading is unmoved: the reproduction at `b1df95ee` still reads 2,973 / 2,969 / 571 / 151 / 78 with the same four classes, and the root is absolute from the reading's first line down, so every path it joins and every containment test the resolver applies answers about the same tree whatever directory the report was run from. Refs #1053. Lane: openxfactory-1 Co-Authored-By: Claude Fable 5.1 <[email protected]>
There was a problem hiding this comment.
🔵 Needs a closer look
Unresolved findings affect error handling, report correctness, and realization evidence.
Review details
Suppressed comments (10)
Previously missed (2) — in code that hasn't changed since the last review.
scripts/report-citation-remainder.py:360
- An I/O failure is being treated as an undecodable text file, so a permission error, disappearing file, or other read failure is counted in
skipped_undecodableand the command still exits 0. The contract reserves non-zero status for a report that could not read the tree; catch onlyUnicodeDecodeErrorhere and propagateOSErrorasCouldNotRuninstead of publishing an incomplete reading.
scripts/report-citation-remainder.py:782 - This quote-counting heuristic does not actually determine whether the line ends inside a string literal: an apostrophe in ordinary prose (for example,
owner's) increments the single-quote count. If the next line starts a quote and the concatenated path happens to resolve, that prose citation can be incorrectly classified astruncated; the probe needs quote-aware parsing or a narrower context check rather than counting quote characters globally.
openspec/changes/add-citation-remainder-report/tasks.md:433
- This realization record's Δ=0 figures do not match the acceptance check stated in the PR description: the description reports 600 distinct tokens and 157 raw-path-absent tokens at both base and head, while this note records 602 and 154. Because these numbers are the packet's mechanical self-counting gate, the record is currently not reproducible; please rerun the check and update the record (or correct the PR description) so both sources name the same reading.
block reads identically at this branch's merge base and at its head — 602
distinct tokens, 154 raw-path-absent, 81 inclusive remainder on both
sides. Δ = 0.
openspec/changes/add-citation-remainder-report/tasks.md:406
- This realization record repeats the same unsupported 63-scenario claim: the checked-in spec currently has 43 scenarios, not 63, while Patch B's spec changes are absent from this three-file diff. As written, the § 2.1 tick records coverage for requirements this branch does not carry; include the folded spec or correct the realization record to the actual contract.
the scenario verbatim: 63 of 63 across the five requirements, counted
mechanically against `specs/packet-citation-report/spec.md` rather than
scripts/report-citation-remainder.py:1149
- When
--historyis enabled, a failedgit logis converted to an empty result becausecodeis ignored. The output then falsely reportsever_tracked: falseinstead of taking the required non-zero 'could not run' path, which can silently turn a repository/history failure into a misleading reading. Propagate a non-zero status asCouldNotRunhere.
end in `/*` or it matches nothing on any input. `--reverse` so the FIRST
line is the OLDEST add-event, `--abbrev=8` so both shas are eight
characters everywhere.
`records` IS WHAT THE READING WILL LIST AND NEVER EVERY TOKEN IN THE
scripts/report-citation-remainder.py:352
packet_reference._containedreturnsNoneboth when a path escapes the root and when resolution fails (for example, a symlink loop or unreadable segment), but everyNoneis counted here asskipped_link_leaving_root. Such an entry inflates the out-of-root term and hides a tree-read failure; distinguish those cases before assigning this skip bucket.
about its TARGET, so an implementation that asks only that question reports
text that is not this corpus's as this corpus's citations. The containment
test is the RESOLVER'S OWN — resolve the path, then require it to stay
under the root — applied to a tracked entry for the same reason it is
scripts/report-citation-remainder.py:439
- The resolve-first safeguard only treats
RESOLVEDas success, butpacket_reference.Resolution.okexplicitly includesNOT_A_PACKET_REFERENCEbecause that outcome successfully hands a real path back to the caller. A real non-packet file such asopenspec/changes/README.md.would therefore be rewritten to.../README.mdbefore deduplication even though its extracted path was already handled. Keep the packet-resolution predicate needed by the split-literal probe, but use a separateok/caller-path predicate for trailing-full-stop normalization.
rather than about the record. A trailing character the grammar admits and
this specification names no normalization for is LEFT WHERE IT STANDS: `-`,
`_`, a letter and a digit are all admitted and none is stripped here, the
hyphen's own suspicion being a CLASS the class predicates below decide and
never a strip.
scripts/report-citation-remainder.py:1061
git diff --quiet HEADreturns 1 for ordinary differences, but values greater than 1 indicate that Git could not perform the comparison. Treating every non-zero value asMODIFIEDmakes a failed diff look like a valid reading and still exits 0, contrary to the contract that non-zero means the report could not run. Handle 0/1 separately and raiseCouldNotRunfor other statuses.
"""The whole reading, from the tracked-entry listing to the classified
remainder."""
scripts/report-citation-remainder.py:1477
- With
--all,listed_records()includes resolved andNOT_A_PACKET_REFERENCErecords, but this hard-coded heading still labels the section as only the remainder. The human output therefore misstates what it is itemizing; make the heading sayALL TOKENSwhenshow_allis true (and apply the same correction to the identity-grouped heading below).
f"{counts['remainder_inclusive_tokens']} inclusive = "
tests/citation_remainder/test_report_citation_remainder.py:9
- The branch being reviewed has only 43
#### Scenario:headings inspecs/packet-citation-report/spec.md, and that spec is not among this PR's three changed files. Therefore the claim that these tests cover “63 of 63” scenarios verbatim is false here: 20 tests implement Patch B behavior that is not in the shipped contract. Fold the spec into the branch/base before making this coverage claim, or narrow the tests and record to the 43 scenarios actually present.
checking coverage reads one place. The delta carries 63 `#### Scenario:` blocks
across 5 `### Requirement:` blocks, and each one's test names it verbatim in its
first line.
- Files reviewed: 3/3 changed files
- Comments generated: 0 new
- Review effort level: Lite
1,612 lines after the absolute-root fix. The tick rule's standard is a measurement, and a measurement is re-taken when the thing it measures moves. Refs #1053. Lane: openxfactory-1 Co-Authored-By: Claude Fable 5.1 <[email protected]>
There was a problem hiding this comment.
🔵 Needs a closer look
Several correctness and reproducibility issues remain, along with inconsistent realization records.
Review details
Suppressed comments (14)
Previously missed (2) — in code that hasn't changed since the last review.
scripts/report-citation-remainder.py:663
searchscans the entire prefix but never checks that the match ends atstart, so an earlier external forge URL on the same line makes a later unrelated citation fireforge-url. That violates the signal's "immediately preceded" grammar and can inflate the flagged counts; require the URL match to end at the token and add a separated-text regression case.
This issue also appears on line 721 of the same file.
scripts/report-citation-remainder.py:1500
--allmakeslisted_recordsinclude resolved and NOT-A-PACKET-REFERENCE records, but both human headings here still sayREMAINDER. The output therefore labels non-remainder entries as remainder items; make the heading conditional onshow_allin both grouping branches.
openspec/changes/add-citation-remainder-report/tasks.md:433
- This landed realization record disagrees with the PR's stated merge-base/head acceptance reading: the description reports 600 distinct tokens and 157 raw-path-absent tokens at both points, while these lines record 602 and 154. Please update the record to the measured values used by the acceptance claim; otherwise the packet contains two incompatible Δ=0 baselines.
block reads identically at this branch's merge base and at its head — 602
distinct tokens, 154 raw-path-absent, 81 inclusive remainder on both
sides. Δ = 0.
openspec/changes/add-citation-remainder-report/tasks.md:402
- The realization record says the new script is 1,594 lines, but the changed file ends at line 1,612. This makes the landed evidence record inaccurate (and the same stale count is repeated in the PR description); update it from the checked-out file after the final change set is fixed.
`scripts/report-citation-remainder.py` (NEW, 1,612 lines) and
openspec/changes/add-citation-remainder-report/tasks.md:406
- This realization record is not reproducible from the checked-in packet:
openspec/changes/add-citation-remainder-report/specs/packet-citation-report/spec.mdcurrently has 43#### Scenario:blocks, while this record claims 63 of 63 and the test module makes the same claim. Until Patch B's 20 scenario blocks are actually present on this branch, the tick and its coverage statement overstate what this realization is checked against.
lines, 96 tests, all green). ONE TEST PER SCENARIO, its docstring naming
the scenario verbatim: 63 of 63 across the five requirements, counted
mechanically against `specs/packet-citation-report/spec.md` rather than
scripts/report-citation-remainder.py:721
- This has the same non-adjacency bug as the forge matcher:
searchcan findopsx:owner/earlier in the line even when unrelated text appears before the citation. The result then flags a token that is not written in the custody-locator scheme required by the grammar; require the match to end atstart.
return CUSTODY_SCHEME_RE.search(line[:start]) is not None
scripts/report-citation-remainder.py:1079
git diff --quietreturns 1 for a dirty tree, but other non-zero values indicate that the command failed. Treating every non-zero asMODIFIEDcan publish a reading after a failed diff instead of taking the required "could not run" path; distinguish status 1 from command errors and raiseCouldNotRunfor the latter.
dirty, _, _ = git_status(root, "diff", "--quiet", "HEAD")
tree_unmodified = dirty == 0
scripts/report-citation-remainder.py:1165
- When
git logfails, this converts the failure into an empty result and reportsever_tracked: false, which is indistinguishable from a successful probe finding no history. Under--historythat is a false historical claim; route this command throughgit()or raiseCouldNotRunwhenever its status is not zero.
code, out, _ = git_status(
root, "log", "--all", "--diff-filter=A", "--reverse",
"--abbrev=8", "--format=%h", "--",
f"{CHANGES_ROOT}/{identity}",
f"{CHANGES_ROOT}/archive/*-{identity}/*")
scripts/report-citation-remainder.py:374
- Catching
OSErrorhere treats permission failures, I/O errors, and disappearing files as ordinary undecodable files, so the report exits 0 and publishes a partial reading even though it could not read the tree. OnlyUnicodeDecodeErrorshould enter the skipped-undecodable bucket; propagate anOSErrorasCouldNotRunso the required non-zero failure is preserved.
except (UnicodeDecodeError, OSError):
population.skipped_undecodable.append(entry.path)
continue
scripts/report-citation-remainder.py:200
- These Git subprocesses inherit ambient
GIT_DIR,GIT_WORK_TREE,GIT_INDEX_FILE, alternate object-directory, and replacement-object settings, so a caller can ask for one root whilels-files,diff, orlogreads another repository state. Exact Git readers in this repository sanitize those variables and disable replacement objects (for examplescripts/validate-carve-manifest.py:844-865); this report should use the same sanitized environment to keep its reading tied toroot.
result = subprocess.run(["git", "-C", where, *args],
capture_output=True, text=True)
scripts/report-citation-remainder.py:793
_inside_string_literalcounts quote characters independently by type, so a balanced"inside a single-quoted string (or a balanced'inside a double-quoted string) can make this returnTrueeven though the token is outside any literal. If the next line begins a quote and the rejoined path resolves, ordinary prose can then be misclassified astruncated; track one active quote delimiter instead.
def _inside_string_literal(text: str) -> bool:
"""Whether `text` ends INSIDE a string literal — an odd number of unescaped
quotes of either kind."""
for quote in ("'", '"'):
count = 0
scripts/report-citation-remainder.py:739
- The
.strip()here accepts whitespace inside the parenthetical, so( codexFactory )is treated as a repository name even though the grammar requires the inner text itself to be one vocabulary member under the decoration rules. That creates falsepossibly-cross-repoflags for parentheticals with separated prose; pass the raw inner text to the existing decoration-aware predicates instead.
inner = match.group("inner").strip()
if not inner or _names_this_repository(inner):
return False
return _is_vocabulary_name(inner)
scripts/report-citation-remainder.py:1125
- For a placeholder-after-token probe (and for the trailing-hyphen fallback),
truncation_evidenceremainsNone, so this branch emits an emptyclass_evidenceand the human output has noevidence:line even though the entry was classifiedtruncated. The requirement says mechanically assigned classes must name their evidence; preserve the</hyphen predicate or the occurrence location when constructing this evidence.
record.class_evidence = tuple(
sorted({o.truncation_evidence for o in record.occurrences
if o.truncation_evidence}))
tests/citation_remainder/test_report_citation_remainder.py:9
- The module-level coverage claim is false for the current tree: the referenced packet spec contains 43 scenarios, not 63, so this statement cannot be mechanically verified against the file it names. Land the Patch B spec before asserting 63/63, or update the claim to match the spec actually shipped with this realization.
EVERY SCENARIO THE DELTA STATES IS REALIZED BY A TEST BELOW WHOSE DOCSTRING
NAMES IT, and the five requirements are kept apart in five sections so a reader
checking coverage reads one place. The delta carries 63 `#### Scenario:` blocks
across 5 `### Requirement:` blocks, and each one's test names it verbatim in its
first line.
- Files reviewed: 3/3 changed files
- Comments generated: 0 new
- Review effort level: Lite
There was a problem hiding this comment.
🔵 Needs a closer look
Multiple moderate implementation issues and stale realization evidence remain unresolved.
Review details
Suppressed comments (11)
Previously missed (2) — in code that hasn't changed since the last review.
scripts/report-citation-remainder.py:793
- This parity check treats an apostrophe in ordinary prose as an opening string delimiter. For example, a line such as
It's openspec/changes/add-nosplit/propfollowed by"osal.md"is considered a split literal; if the rejoined path resolves, a normal dangling citation is incorrectly classified astruncated. The probe needs quote-state parsing that distinguishes literal delimiters from prose apostrophes/comments.
openspec/changes/add-citation-remainder-report/tasks.md:406 - The realization record says 63 of 63 scenarios, but the current
specs/packet-citation-report/spec.mdcontains 69#### Scenario:blocks and this test file contains 69 matching scenario docstrings. Please update this committed coverage claim—and the PR description—to the mechanically measured 69/69 value so the realization record is not stale.
openspec/changes/add-citation-remainder-report/tasks.md:432
- The realization record's Δ=0 figures do not match the acceptance figures stated for this branch in the PR description: the base/head probe is reported as 600 distinct tokens and 157 raw-path-absent, not 602 and 154. Please update this record (or identify the separate run) so the task evidence is reproducible rather than publishing stale counts.
block reads identically at this branch's merge base and at its head — 602
distinct tokens, 154 raw-path-absent, 81 inclusive remainder on both
scripts/report-citation-remainder.py:288
git ls-files -semits one row per index stage for an unmerged path. Because this parser appends every row, a conflicted working tree (which this report explicitly supports as a dirty tree) counts and reads the same tracked path multiple times, inflating the population arithmetic and duplicating occurrences. Deduplicate by path while retaining one mode, matching thegit ls-filespath population.
for line in git(root, "ls-files", "-s", "-z").split("\0"):
if not line:
continue
meta, _, path = line.partition("\t")
if not path:
scripts/report-citation-remainder.py:736
inner.strip()makes whitespace inside the parentheses part of the accepted signal grammar. A spelling such as( codexFactory )therefore fires, although the fixed rule allows at most one space before(and then requires the contents themselves to be a vocabulary member; this creates false cross-repository flags. Validate the captured inner text without stripping its whitespace.
inner = match.group("inner").strip()
scripts/report-citation-remainder.py:1167
- A failed
git logis silently converted intoever_tracked: false, so--historycan reporthistory: never trackedwhen the probe actually errored (for example, because the repository's history is unreadable). An empty successful log should mean never tracked, but a nonzero status should propagate asCouldNotRuninstead of fabricating history.
code, out, _ = git_status(
root, "log", "--all", "--diff-filter=A", "--reverse",
"--abbrev=8", "--format=%h", "--",
f"{CHANGES_ROOT}/{identity}",
f"{CHANGES_ROOT}/archive/*-{identity}/*")
lines = [line.strip() for line in out.splitlines() if line.strip()] \
if code == 0 else []
scripts/report-citation-remainder.py:1079
git diff --quietreturns 1 for expected differences, but codes greater than 1 indicate a Git error. Treating every nonzero result asMODIFIEDlets a failed diff produce a normal exit-0 reading with an invented tree state, contrary to the two-case exit contract. RaiseCouldNotRunfor error codes other than 0 and 1.
dirty, _, _ = git_status(root, "diff", "--quiet", "HEAD")
tree_unmodified = dirty == 0
scripts/report-citation-remainder.py:663
signal_forge_urlsearches any URL in the prefix but does not require the match to end atstart. A URL such ashttps://github.com/opensoft/codexFactory/blob/main/followed by prose and then an in-tree citation will therefore flag that citation, even though the grammar requires the URL to be immediately before the token. Anchor the URL match to the token boundary.
match = FORGE_URL_RE.search(line[:start])
if match is None:
return False
return match.group("repo").lower() in REPOSITORY_VOCABULARY
scripts/report-citation-remainder.py:721
signal_custody_locatorhas the same non-adjacency problem: it finds an earlieropsx:<owner>/anywhere on the line and can flag a later unrelated citation. The custody prefix must end immediately before the token, as required by the signal grammar.
return CUSTODY_SCHEME_RE.search(line[:start]) is not None
scripts/report-citation-remainder.py:1125
- When
truncatedis selected by the<probe or by the trailing-hyphen fallback,truncation_evidenceisNone, so this comprehension leavesclass_evidenceempty and the human output omits any evidence line. The specification requires every mechanically assigned class to name its path or normalization evidence; preserve a probe/predicate and source-location value for these cases and cover it in the tests.
record.class_evidence = tuple(
sorted({o.truncation_evidence for o in record.occurrences
if o.truncation_evidence}))
scripts/report-citation-remainder.py:374
- This treats every
OSErrorfromread_bytes()as an undecodable file, so permission failures, I/O errors, or a file disappearing mid-scan are counted asskipped_undecodableand the report still exits 0 with incomplete counts. Those errors mean the tree could not be read; onlyUnicodeDecodeErrorshould enter the skipped bucket, while other read failures should raiseCouldNotRun.
text = target.read_bytes().decode("utf-8")
except (UnicodeDecodeError, OSError):
population.skipped_undecodable.append(entry.path)
continue
- Files reviewed: 3/3 changed files
- Comments generated: 0 new
- Review effort level: Lite
`probe_history` turned a failing `git log` into an empty result list and then published it as `probed: true, ever_tracked: false` — the sentence *this id never stood here*, asserted on a history the report never read. An empty walk and a walk that did not happen are two different facts wanting two different repairs, and this module already states which exit the second takes: "Every git this report runs is a READ. A git that fails is a tree this report cannot read, which is the one non-zero exit it has." So the probe goes through `git` rather than `git_status`, carrying git's own stderr into `CouldNotRun`. `git_status` keeps its one caller, `diff --quiet HEAD`, whose non-zero IS an answer. Two tests: one patches the report's own subprocess sink so exactly the history walk fails and every other git still answers, and asserts the run exits non-zero, that `"ever_tracked": false` is never printed, and that git's message reaches the caller; one asserts the narrowing costs nothing, a walk that RAN and found no add event still reading `ever_tracked: false`. Copilot PRRT_kwDOTAvnrs6jdTNb on PR #1100. Refs #1053. Lane: openxfactory-1 Co-Authored-By: Claude Fable 5.1 <[email protected]>
Patch B's bench round two (PR #1097, `7b21491f`) fixes what each of the three skip terms OWNS rather than what each is named for, so that no tracked entry falls between two of them: the out-of-root-link term owns exactly the tracked LINKS whose resolved path stands outside the root, and the non-file term owns every other tracked entry that is not a readable regular file once resolved. That made a link's RESOLVED PATH a fact about the path and not about what stands at it, which `Path.resolve()` cannot answer: it is a filesystem call, and this term must take a DANGLING link that leaves the root while leaving a dangling link that does not. So `resolved_entry_path` walks the chain itself — every step read in turn, each link replaced by its own target text joined onto the directory it stands in, `..` and `.` normalised away — and returns None only where the report cannot walk the chain at all, which the spec assigns to the non-file term and the old `_contained` assigned to the out-of-root one. Four entry classes move as a result, each of them previously in the wrong term or in none: a link dangling INSIDE the root (was out-of-root, now non-file), a chain that loops or cannot be read (was out-of-root, now non-file), a link resolving to a DIRECTORY inside the root (unchanged, now stated), and a dangling link resolving OUTSIDE the root (was non-file, now out-of-root). `entry_disposition` decides all three terms in one place so the extents cannot drift apart, and the arithmetic closes over every one of them. Five tests, one per scenario the bench round added, plus the rename the round made to the scenario that was `A tracked link stands inside the root`. Refs #1053. Lane: openxfactory-1 Co-Authored-By: Claude Fable 5.1 <[email protected]>
Patch B's bench round one (PR #1097, `0862177e`) replaced probe (iii)'s description — "the token ends its source line INSIDE A STRING LITERAL" — with a closed lexical rule, because *inside a string literal* is no predicate over a corpus written in several languages, each with its own delimiters and escape syntaxes, and a probe two realizations match differently is a class total two readings cannot be compared by. So `_inside_string_literal`, which counted unescaped quotes of either kind and answered yes to a great deal this probe was never measured against, is gone. In its place: the occurrence is followed on its own line by ONE quote character, `"` or `'`, not repeated, which is that line's last non-whitespace character and closes a literal the same character opened earlier on the same line; the next line's first non-whitespace character is that same quote, again not repeated; and the token plus the continuation literal's content, up to its own closing quote, resolves. A triple quote, a backtick, a prefixed or raw literal, a backslash in either literal and a continuation opened by the OTHER quote character are refused, even where the rejoin would resolve. The rule is pinned to the shape the measurement caught, `scripts/doc_health/pin_class.py:1248-1249`, and the shipped probe fires on it in this repository's own corpus, rejoining `…2026-08-27-add-hermes-customer-subject-` onto `runtime-contract/evidence/provider-verification.yaml`. Two tests: one builds the shape in a file that is NOT Python, so the verdict is reached from the quote characters alone; one parametrizes the seven refusals over a fixture whose rejoined path WOULD resolve, so what is asserted is the refusal and not a rejoin that happened to fail. All 69 of Patch B's scenarios now carry a test that names them. Refs #1053. Lane: openxfactory-1 Co-Authored-By: Claude Fable 5.1 <[email protected]>
SonarCloud's security finding on this branch, `pythonsecurity:S8705` (command argument injection at the one `subprocess.run` every git goes through), was fixed at `eaeff2b1` and reads CLOSED. These are the maintainability and reliability findings standing beside it, each a real defect in code this branch adds rather than a rule to be argued with, and none is suppressed. `python:S8786`, super-linear backtracking: `PATH_RUN_RE` was a `[...]*$` pattern SEARCHED over a line prefix, which retries at every start position. The same answer read backwards from the end is one pass, so `trailing_path_run` replaces it — same result, no backtracking. `python:S1172`, six unused parameters: the five signal matchers and `probe_longer_path` took a uniform `(line, start, end)` and read only part of it, and `build_population` took a `root` it never touched. Nothing dispatches over these signatures — `signals_at` names each matcher — so each now takes what it reads and nothing beside. `python:S3776`, cognitive complexity in four functions: `build_population` (18), `take_reading` (17), `json_reading` (17) and `print_human` (27). Split along seams the code already had rather than by shuffling branches: `admits`/`output_paths_named_by` carry the refinement verdict, `record_for`/`class_evidence_for`/`head_and_tree_state` carry one token's record and the head pair, `_with_history` carries the one key that is absent rather than null, and `print_human` becomes the four printers its own output contract already names — header, population, PART 1 counts, PART 2 itemized. `python:S6353` and `python:S1940`, both in text the probe rewrite touched: the custody-locator boundary class is now `(?a:\W)`, held to ASCII so it is the same boundary and not a wider Unicode one, and the negated membership test went with `_inside_string_literal`. `python:S9073`, ten composite assertions in the suite: each split, so a red test names which half failed. No behavior moves: 111 tests pass before and after, and the human and JSON runs over this repository are unchanged. Refs #1053. Lane: openxfactory-1 Co-Authored-By: Claude Fable 5.1 <[email protected]>
Prose only, no behaviour, no test moves. A reflow in the walk's docstring had left one 138-character line where nothing else in the file passes 86; a sentence under it still said "not a link that leaves the root" where the term it describes has stopped being about links; and `locator_path` had one blank line after it where every other top-level definition in the file has two. Refs #1053. Lane: openxfactory-1 Co-Authored-By: Claude Fable 5.1 <[email protected]>
|
R1 round 3 at PATCH B HAS LANDED AND IS MERGED IN ( Coverage is 72 of 72, GAPS NONE, counted mechanically against the spec as it stands in this tree. Round 2 closed 69 of 69 against a #1097 tip; three scenarios were added after that tip and one was RENAMED with no behaviour behind it, and the mechanical count caught all four where a hand count would have passed every one:
FIVE REVIEW THREADS TAKEN, all replied to and all resolved, three of them real defects reproduced before being fixed:
Δ = 0, taken twice by two instruments at head The Not done here, and named: the nightly wiring is slice R2 ( The whole local suite is GREEN at this head: Lane: openxfactory-1 |
There was a problem hiding this comment.
🟡 Changes recommended
Unresolved moderate findings and coverage/documentation inconsistencies remain before approval.
Get a fresh assessment by requesting another Copilot review.
Review details
Suppressed comments (8)
openspec/changes/add-citation-remainder-report/tasks.md:473
- This realization record says only 69 of 72 scenarios are covered and that Patch B has landed on
main, while the PR description still claims 69 of 69 and says Patch B has not landed. The current spec/test module and this record are inconsistent with the stated coverage and revision; please reconcile the PR description (including its measurement claims) with this branch before treating the acceptance evidence as reproducible.
ONE TEST PER SCENARIO, its docstring naming the scenario verbatim: 69 of
72 across the five requirements, counted mechanically against
`specs/packet-citation-report/spec.md` rather than by hand — 43 scenarios
the ratified delta carried plus the 29 Patch B adds, which have LANDED
(PR #1097, `main` at `c32749c3`), so the count is taken against the spec
scripts/report-citation-remainder.py:207
- This list still leaves Git's pathspec environment controls inherited from the caller (
GIT_LITERAL_PATHSPECS,GIT_NOGLOB_PATHSPECS,GIT_GLOB_PATHSPECS, andGIT_ICASE_PATHSPECS). In particular,--historyrelies on the wildcard pathspecarchive/*-<identity>/*; with literal/no-glob settings it can return an empty log and publishever_tracked: falsefor an identity that was tracked. Scrub these variables as well and add the hostile-pathspec case to the environment regression test.
SCRUBBED_GIT_ENVIRONMENT = (
"GIT_ALTERNATE_OBJECT_DIRECTORIES",
"GIT_COMMON_DIR",
"GIT_CONFIG_COUNT",
"GIT_CONFIG_PARAMETERS",
"GIT_DIR",
"GIT_INDEX_FILE",
"GIT_OBJECT_DIRECTORY",
"GIT_REPLACE_REF_BASE",
"GIT_WORK_TREE",
)
scripts/report-citation-remainder.py:1992
- When
--allis used,listed_recordsincludes RESOLVED and NOT-A-PACKET-REFERENCE records, but both human headings below still sayREMAINDER. This makes the human output mislabel entries that the JSON correctly identifies asall-tokens; make the heading sayALL TOKENSwhenshow_allis true (for both grouping modes).
if by_token:
scripts/report-citation-remainder.py:518
- Because this uses
git ls-files -s, an unmerged index produces one row per stage for the same path. Appending every row here makes a dirty/conflicted worktree count and read the same working-tree file multiple times, duplicating its occurrences even though this report explicitly supports modified trees; deduplicate paths or define a deliberate stage-handling policy before building the population.
continue
meta, _, path = line.partition("\t")
if not path:
continue
rows.append(TrackedEntry(path=path, mode=meta.split(" ", 1)[0]))
scripts/report-citation-remainder.py:281
git ls-files -s -zcan legally return a tracked pathname containing non-UTF-8 bytes. Withtext=Trueand the default strict decoder,subprocess.runraisesUnicodeDecodeErrorbefore this sink returns, butgit_statusonly translatesTimeoutExpiredandOSError; the CLI then emits a traceback instead of the required controlled “report did not run” result. Decode Git's text streams with filesystem-compatible surrogate escaping (or otherwise catch this decode failure) so arbitrary tracked names remain readable.
capture_output=True, text=True,
scripts/report-citation-remainder.py:1107
- The grammar allows at most one space before the parenthesis and a vocabulary member inside it, but
.strip()removes arbitrary leading/trailing whitespace from the parenthetical content. Thusopenspec/changes/add-x/proposal.md ( codexFactory )is flagged even though the spaces are extra content inside the parentheses and should make this signal refuse; keep the captured inner text intact before applying the decoration matcher.
return False
scripts/report-citation-remainder.py:1467
class_evidence_foronly emitstruncation_evidence, but probe (ii) leaves that field unset and the separate trailing-hyphen arm intruncated_predicatehas no probe evidence at all. Those entries are therefore reported withclass: truncatedand an emptyclass_evidence/no human evidence, even though the requirement says every mechanical class verdict must name evidence a reader can check; populate evidence for the placeholder and trailing-hyphen arms and cover both outputs.
return fixture_path_evidence(record)
if record.classification == CLASS_TRUNCATED:
return tuple(sorted({o.truncation_evidence for o in record.occurrences
scripts/report-citation-remainder.py:1580
PacketIndex._build()traversesopenspec/changeswithiterdir()and can raiseOSErrorwhen that tree or a packet directory is unreadable. This call is outside theCouldNotRunconversion, whilemain()catches onlyCouldNotRun, so a Git worktree with an unreadable packet tree produces a traceback rather than the required non-zero “THE REPORT DID NOT RUN” result. Translate resolver/index read failures intoCouldNotRunbefore returning the reading.
index = packet_reference.PacketIndex(root)
resolutions: dict[str, object] = {}
def resolution_of(token: str):
if token not in resolutions:
resolutions[token] = packet_reference.resolve(root, token,
- Files reviewed: 2/3 changed files
- Comments generated: 2
- Review effort level: Lite
TWO REVIEW FINDINGS. The first is a defect of this branch's own last round; the second is a rule that was real but undeclared. `PRRT_kwDOTAvnrs6jtxUJ` — the § 2.1 record read "69 of 72". A botched substitution in the commit that re-took the record replaced the second numeral of "69 of 69" and left the first, so a record whose whole subject is a mechanical coverage count reported an INCOMPLETE realization beside a ticked box. The count is and was 72 of 72; the record now says so. `PRRT_kwDOTAvnrs6jtxUj` — the 64-hop cutoff. Kept, and DECLARED, which is the finding's own second option, because the first is not available: A BOUND IS NOT REMOVABLE AND CYCLE DETECTION DOES NOT REPLACE IT. A chain can fail to terminate without ever repeating a state. `l -> l/x` pushes its own name back onto the walk every hop, so `pending` grows by one each time and the `(current, pending)` state is new at every step — measured over 201 hops: 201 distinct states, `pending` 202 long. A detector keyed on the walk's state would never fire and the walk would never end. THE BOUND IS LOOSER THAN THE PLATFORM, which is the direction that matters. Measured: the OS refuses to open a chain of 41 links or more with `ELOOP` (`MAXSYMLINKS`, errno 40) while this walk resolves to 64. There is no chain whose bytes an ordinary reader of this repository could reach and this walk gives up on. AND THE NON-FILE TERM IS THE HONEST ONE FOR AN ENTRY PAST IT, not a fallback. An entry whose chain the report cannot itself walk has NO resolved path, and an entry with no resolved path cannot be SAID to leave the root; putting it in the out-of-root term would assert a containment fact nothing measured, which is the one thing this report may never do. It is never read either way, so the choice admits no text from beyond the root. Three tests: the bound read from both sides (a chain AT it resolves and is read, one PAST it takes the non-file term, contributes no token and leaves the arithmetic closed); the platform's own limit MEASURED rather than hard-coded and asserted to stand below this bound — it fails with the bound at 30, naming the platform's 37; and `l -> l/x` terminating where a state detector would not. Refs #1053. Lane: openxfactory-1 Co-Authored-By: Claude Fable 5.1 <[email protected]>
There was a problem hiding this comment.
🔵 Needs a closer look
Unresolved moderate findings remain in the implementation and realization record.
Review details
Suppressed comments (8)
Previously missed (2) — in code that hasn't changed since the last review.
scripts/report-citation-remainder.py:627
- The out-of-root predicate is defined over every tracked entry's resolved path, including entries reached through a parent link. Returning
TERM_NON_FILEbefore resolving a mode-160000 gitlink misclassifies a gitlink under a parent symlink that points outside the root; it should take the out-of-root term just like the regular-file case. Resolve and apply containment first, then use the index mode to classify an in-root gitlink.
scripts/report-citation-remainder.py:1794 - The default itemized output is
reading.remainder, butis_remainderadditionally requiresraw_path_presentto be false. That means a DANGLING or AMBIGUOUS token whose raw path exists (for example, an ambiguous identity with an active packet path present) is counted in the outcome rows but omitted from the required default itemization. Keep the raw-path predicate for the remainder arithmetic, but list every DANGLING/AMBIGUOUS record independently.
openspec/changes/add-citation-remainder-report/tasks.md:470
- This realization record says only 69 of the 72 scenarios are covered, while the same paragraph says Patch B added 29 to the 43 already present and the new test module documents 72 of 72. The stale numerator makes the checked-off realization evidence look incomplete; update it to the mechanically verified coverage for this tree.
ONE TEST PER SCENARIO, its docstring naming the scenario verbatim: 72 of
72 across the five requirements, counted mechanically against
scripts/report-citation-remainder.py:483
- The 64-hop cutoff makes valid acyclic symlink chains longer than 64 hops return
None, so the entry is misclassified asnon_fileinstead of being read or classified by its eventual resolved path. The documented failure cases only include cycles and unreadable link targets; replace the hard cutoff with cycle detection (or otherwise preserve arbitrarily deep acyclic chains) before treating the path as unresolved.
current = root
# `pending` IS A STACK AND NOT A QUEUE: it is built REVERSED and popped from
scripts/report-citation-remainder.py:1186
- The lexical probe claims to reject every prefixed or raw literal, but this guard only checks whether the character immediately before the opening quote is alphabetic. A continuation such as
u8"openspec/changes/..."has8there and will pass probe (iii), incorrectly classifying the token astruncatedeven though the spec explicitly excludes prefixed literals. Detect the complete prefix (including numeric/underscore suffixes) and add a regression for this shape.
#: The two characters probe (iii) reads a literal by. A BACKTICK IS NOT ONE OF
scripts/report-citation-remainder.py:1993
- With
--all,listed_recordsreturns resolved and NOT-A-PACKET-REFERENCE records as well as the remainder, but both human headings still sayREMAINDER. This labels resolved tokens as unresolved and makes the advertised--alloutput misleading; use anALL TOKENSheading whenshow_allis true and keepREMAINDERfor the default.
f"{counts['remainder_inclusive_tokens']} inclusive = "
scripts/report-citation-remainder.py:1530
git diff --quiet HEADignores untracked files, but this realization deliberately follows tracked symlinks whose resolved target is any readable file inside the root. A tracked link can therefore point at an untracked in-root file;read_population_textwill read that file and the counts will change when it changes, while this check still reportstree_unmodified_at_head=True. The clean-state declaration must account for those read targets or reject them; the current rationale that untracked files are never read is no longer true after the symlink population rules.
#: `git diff --quiet HEAD`'S OWN TWO ANSWERS, AND NOTHING ELSE IT CAN EXIT WITH
#: IS ONE OF THEM. `0` is "no tracked file differs from the head" and `1` is "at
#: least one does". EVERY OTHER STATUS IS GIT REPORTING THAT IT COULD NOT TAKE
#: THE COMPARISON AT ALL, which is a different fact and belongs to the one
#: non-zero exit this capability has. Measured rather than reasoned: with a head
scripts/report-citation-remainder.py:518
git ls-files -semits one row per index stage for an unmerged path, unlike the specifiedgit ls-filespath population. On an allowed dirty/merge-conflict tree, one tracked file can therefore become threeTrackedEntryobjects here, causing repeated reads and duplicate occurrences while inflating the in-scope/file arithmetic. Deduplicate index-stage rows by path (while retaining the mode information needed for gitlinks) or enumerate unique tracked paths separately.
return None
if target.startswith("/"):
current = anchor
# Pushed onto the TOP of the stack, reversed so the target's FIRST
# component is popped first — `[…, suffix] + [last, …, first]`.
pending.extend(part for part in reversed(target.split("/")) if part)
return current
- Files reviewed: 2/3 changed files
- Comments generated: 0 new
- Review effort level: Lite
There was a problem hiding this comment.
🔵 Needs a closer look
Unresolved moderate findings remain in the CLI and test coverage documentation.
Review details
Suppressed comments (9)
Previously missed (1) — in code that hasn't changed since the last review.
scripts/report-citation-remainder.py:1477
- The placeholder probe contributes to
truncatedbut never records evidence:evidenceremainsNoneunless the longer-path or split-literal probe also fires. A standalone<case therefore emitsclass: truncatedwithclass_evidence: []and omits evidence from the human output, despite the requirement that each mechanical class name its evidence. Preserve the<marker when this probe fires; the occurrence location is already carried separately.
scripts/report-citation-remainder.py:1478
- This passes the already-normalized
tokeninto the split-literal probe. A source line ending in a separator, such asopenspec/changes/add-split/followed by"proposal.md", has that/removed before this call, so the probe tests.../add-splitproposal.mdand misses the valid rejoined path; the prefix can then be reported as resolved instead oftruncated. Rejoin from the raw occurrence spelling and add the separator-split regression case.
rejoined = probe_split_string_literal(lines, lineno, end, token, resolves)
scripts/report-citation-remainder.py:541
git ls-files -semits one row per index stage for an unmerged path, not one row per tracked path. In a conflicted worktree this creates duplicateTrackedEntryobjects, so the report counts and reads the same file multiple times and duplicates its occurrence evidence while still exiting successfully. Enumerate unique tracked paths (with a separate mode lookup) or explicitly handle an unmerged index before building the population.
for line in git(root, "ls-files", "-s", "-z").split("\0"):
if not line:
continue
meta, _, path = line.partition("\t")
if not path:
scripts/report-citation-remainder.py:1600
PacketIndexis lazy, and its_build()can raiseOSErrorwhile enumerating an existing but unreadableopenspec/changesdirectory. This call and the later lazy resolutions are outside anyCouldNotRunconversion, so an unreadable tree can escapemainas a traceback rather than the required non-zeroTHE REPORT DID NOT RUNpath. Convert index/resolution read failures toCouldNotRun(and add a permission/concurrent-removal regression test).
index = packet_reference.PacketIndex(root)
scripts/report-citation-remainder.py:283
- The sink decodes
git ls-files -s -zwith strict text mode. Git's-zform preserves arbitrary pathname bytes, so a valid repository containing a non-UTF-8 filename raisesUnicodeDecodeErrorfromsubprocess.run;maincatches onlyCouldNotRun, producing a traceback instead of a reading or the requiredDID NOT RUNresult. Use surrogate-escape decoding (or otherwise handle byte output) at this sink.
capture_output=True, text=True,
timeout=GIT_TIMEOUT_SECONDS,
env=sanitized_git_environment())
scripts/report-citation-remainder.py:1133
- The parenthetical matcher strips whitespace from inside the parentheses before checking the vocabulary. That makes spellings such as
(codexFactory )flag, although the grammar permits at most one space before(and requires the parentheses to contain only the vocabulary member; inner whitespace is additional content and must not signal. Remove the inner.strip()and add this negative spelling to the regression cases.
inner = match.group("inner").strip()
scripts/report-citation-remainder.py:2018
listed_recordsreturns every record whenshow_allis true, including RESOLVED and NOT_A_PACKET_REFERENCE, but both branches here still printREMAINDER, ITEMIZED.... A human--allrun therefore labels non-remainder outcomes as remainder, contrary to the option's documented behavior; make the heading say all tokens whenshow_allis set in both grouping modes.
write("REMAINDER, ITEMIZED BY TOKEN\n")
scripts/report-citation-remainder.py:814
- This
endswithguard is broader than its stated purpose and suppresses full-stop normalization for valid packet paths whose remainder ends withopenspec/changes. For example,openspec/changes/add-present/openspec/changes.is not the changes root, but this branch leaves the dot attached and can report a file-half dangling result instead of resolving the actual path. Compare the candidate with the root sentinel by equality rather than suffix matching.
if candidate.endswith(CHANGES_ROOT) or candidate.endswith(CHANGES_ROOT + "/"):
scripts/report-citation-remainder.py:1401
- An
AMBIGUOUSresult is omitted from the default itemization whenever the normalized raw path exists becauseis_remainderrequiresraw_path_presentto be false. Two packets can claim one identity while the active path exists, so this produces an ambiguous outcome count without an itemized record, contrary to the requirement thatAMBIGUOUSis itemized;--allis not a substitute because it also lists resolved and non-reference outcomes. Make ambiguity independent of raw-path presence and add a regression for an active-plus-archived duplicate identity.
return (not self.raw_path_present
and self.status in (DANGLING, AMBIGUOUS))
- Files reviewed: 2/3 changed files
- Comments generated: 0 new
- Review effort level: Lite
There was a problem hiding this comment.
🟡 Changes recommended
Unresolved moderate CLI findings remain before approval.
Get a fresh assessment by requesting another Copilot review.
Review details
Suppressed comments (7)
openspec/changes/add-citation-remainder-report/tasks.md:469
- The PR description reports 120 test functions, but this changed test file currently contains 123
def test_declarations. Since the coverage narrative uses these figures as realization evidence, refresh or remove the moving function-count claim so the description matches this head.
ONE TEST PER SCENARIO, its docstring naming the scenario verbatim: 72 of
scripts/report-citation-remainder.py:1656
- Under
--all,recordsincludesNOT_A_PACKET_REFERENCEtokens, and the resolver still populatesidentitywith the parsed second path segment (for example,openspec/changes/README.md). This condition therefore probes non-packet paths and can publishhistory: tracked ...for a record whose status says it is not a packet reference. Skip that status before probing while retaining history for actual packet outcomes.
identity = record.identity
if identity is None or identity in probed:
continue
scripts/report-citation-remainder.py:1096
word_immediately_beforeis given only the prefix before the match, so a vocabulary suffix glued directly to the extracted path is treated as a separate qualifier. For example,codexFactoryopenspec/changes/add-x/proposal.mdmakespreviousequalcodexFactoryeven though the whole whitespace-delimited run is not that word, producing a false cross-repository signal. Require whitespace or admitted decoration between the qualifier and the token, and cover the glued form negatively.
previous = word_immediately_before(line[:start])
if previous and _is_vocabulary_name(previous) \
and not _names_this_repository(previous):
return True
scripts/report-citation-remainder.py:2018
- When
show_allis true,listed_recordsdeliberately includesRESOLVEDandNOT_A_PACKET_REFERENCErecords, but this human heading still calls the sectionREMAINDER. The resulting output labels non-remainder records as remainder, unlike the CLI help and JSON'slisted: all-tokens; make the heading reflect the selected listing mode.
write("REMAINDER, ITEMIZED BY TOKEN\n")
scripts/report-citation-remainder.py:1136
- The
.strip()here makes whitespace inside the parentheses disappear, so text such as( codexFactory )or(codexFactory )is flagged. The locator contract says the parentheses must contain a vocabulary member under the stated decoration set, which does not include whitespace; leave the captured inner text unchanged so these malformed parentheticals remain unflagged.
inner = match.group("inner").strip()
if not inner or _names_this_repository(inner):
return False
return _is_vocabulary_name(inner)
scripts/report-citation-remainder.py:1264
tokenhas already passednormalise_tokenbefore this probe, so a raw match ending in.or/has had that character removed before it is joined with the continuation. For example, a source split of.../prop.plusosal.mdis tested as.../proposal.md, a different path from the spelling actually written (.../prop.osal.md), and can be falsely classified as a resolving truncation. Form the rejoined path from the raw match (threadrawthrough this helper) while retaining the normalized token for the record's resolver outcome.
rejoined = token + content
return rejoined if resolves(rejoined) else None
scripts/report-citation-remainder.py:543
git ls-files -semits multiple rows for one path when the index contains unresolved merge stages, but this loop creates oneTrackedEntryper row and later reads each path once per stage. Because dirty trees are explicitly supported, a merge-conflicted checkout can therefore inflatetracked_entries_in_scope/files_readand duplicate citation occurrences for a single work-tree file. Enumerate each tracked path once and define how its effective mode is selected for unmerged entries.
for line in git(root, "ls-files", "-s", "-z").split("\0"):
if not line:
continue
meta, _, path = line.partition("\t")
if not path:
continue
rows.append(TrackedEntry(path=path, mode=meta.split(" ", 1)[0]))
- Files reviewed: 2/3 changed files
- Comments generated: 2
- Review effort level: Lite
…e names the spec in this tree Lane: openxfactory-1 Co-Authored-By: Claude Fable 5.1 <[email protected]>
|
There was a problem hiding this comment.
🟡 Changes recommended
Unresolved moderate correctness issues remain in the reporting CLI.
Get a fresh assessment by requesting another Copilot review.
Review details
Suppressed comments (1)
openspec/changes/add-citation-remainder-report/tasks.md:470
- The PR description's opening status still says the pytest suite is RED on three inherited
sequenced_aftertests, while its later section says #1099 fixed all three and the validation table reports zero failures. Refresh the lead status before landing so the realization record and landing condition are not contradictory.
**LANDED, 2026-09-18, realization slice R1.**
`scripts/report-citation-remainder.py` and
`tests/citation_remainder/test_report_citation_remainder.py`, both NEW.
ONE TEST PER SCENARIO, its docstring naming the scenario verbatim: 72 of
72 across the five requirements, counted mechanically against
- Files reviewed: 1/3 changed files
- Comments generated: 1
- Review effort level: Lite
|
R1 round at
Body: the Status line refreshed; the phrase "or close #1053" in the scope paragraph was itself a GitHub closing keyword (the PR showed All six required checks GREEN at Lane: openxfactory-1 |
|
FREEZE — lane openxfactory-1, session 393ade52-a921-4dd9-9dc5-224ebc056651, 2026-09-18T15:21Z: head Lane: openxfactory-1 |
|
Lane: openxfactory-1 (openXfactory-1) LANDING — lane openxfactory-1, session 393ade52-a921-4dd9-9dc5-224ebc056651@Eagle, 2026-09-18T15:22:08Z, PR #1100 into opensoft/openxFactory main Guard at 2026-09-18T15:22:11Z on head |



Lane: openxfactory-1
Status: Head
9997f763(789cbc8fmergedmaindc242f3a, the repaired main, then one round: tree-read failures normalized to the no-reading exit, coverage note names the spec in this tree). 72/72 scenarios covered. 0 open review threads (20 taken across six rounds, all answered and resolved — the two tables below cover the last two rounds; the full round-by-round record isbrett-wiphandoffs/xFactory/attachments/openxfactory-1-2026-09-13/1053/bench-realization-rounds.md, commit44f1cbac). All six required checks GREEN at this head; main's newest decided pytest-suite (dc242f3a) GREEN. Lands under Rule 6 on Brett Heap's word "land it when green" (comment 5728210143).Claim: #1053 (comment)
What this realizes
tasks.md§ 2.1 ofadd-citation-remainder-report, ratified 2026-09-17 byBrett Heap —
.openspec.yamlapproved_by:, PR #1069 comment5714138459,
verbatim "ratify #1069", 2026-09-17T12:12:06Z, the word BARE and taking
D1–D7 at the RECOMMENDED option each.
proposal.mddeclarescode_surface: openxFactory, non-empty, so the archive gate holds this packetbehind merged-plus-green realization evidence and not behind this pull request.
Three files, and no fourth:
scripts/report-citation-remainder.pytests/citation_remainder/test_report_citation_remainder.pyopenspec/changes/add-citation-remainder-report/tasks.mdLine counts are deliberately not restated in this body or in
tasks.md.They moved on every review round of this pull request — one Copilot thread named
1,620 and 1,908 as the true figures at a head where they were already 1,866 and
2,089 — and the merge commit's own diffstat is where a reader gets them right.
The counts that stay are properties of the delta rather than of a review round.
Patch B has LANDED, and the tests now read the spec rather than a draft
Merged
mainc32749c3(this branch's merge commit97dfc78b;mainhassince advanced to
4ee21c40, which is this branch's merge base). Patch B'srules are in the spec the tests read — they are no longer implemented from a
branch's drafted text on the word "fold B as drafted", they are the ratified
delta in this tree. The merge carried one conflict, in
tasks.md§ 2.1, wheremainhad added Patch B's population-case narrative under the same paragraphthis branch had added its realization record to; both blocks are kept, in
that order.
#1099 landed in the same merge, so the three inherited
sequenced_afterarchive-date failures this branch reported for two rounds come in FIXED. There
is no inherited red left to name.
Coverage: 72 of 72 scenarios, counted mechanically, GAPS: NONE
The count is taken against the spec as it stands in this tree — no longer
against a branch tip — by searching for every
#### Scenario:title in a testfunction's docstring, so a scenario a later round REWORDS reads as a gap rather
than passing silently.
120 test functions, 130 tests collected (parametrized cases): 72 scenario
tests plus 48 that pin behavior the delta fixes without giving it a scenario of
its own.
That mechanical count has now caught three separate movements, and a hand
count would have passed every one of them:
Three of Patch B's rules moved CODE and not only tests
The out-of-root skip term is a predicate over the WHOLE TRACKED PATH. Patch
B's last round widened it in the requirement: it owns "the tracked ENTRIES whose
resolved path stands outside the repository root — not only an entry that is
itself a link, but any tracked entry reached through one, a PARENT directory
component included".
entry_dispositionhad gated the term onis_link, on areasoning the code stated: git refuses to track a path beyond a symbolic link.
True of the moment a path is added and not of the tree afterwards — a directory
can BECOME a link after the files under it were tracked, and the index still
carries them at mode 100644. The gate is gone, the resolved path decides, and
SYMLINK_MODEwent with it as its only reader.The custody locator's PATH is now read. Patch B pins signal (4)'s grammar
exactly. The owner half was already exact — the class admits neither
:nor/and the pattern must run out at the token's own start — but the path half was
not being read at all, so
opsx:opensoft/<token>fired whatever shape the tokenhad. The empty-segment arm is what does the work: a repeated slash inside the
path and a trailing slash at the end of it each leave one. The locator is judged
on the spelling AS WRITTEN and never on the normalized token, which is the only
reading under which a trailing slash can be refused at all.
The scenario rename brought no behaviour with it, and its test follows it in
three ways: the new title, a tracked regular file under a parent link so the
term is exercised through a parent as well as through an entry's own link, and
membership read BOTH ways round — entry by entry, because a count can be right
while the wrong entry stands in it.
Review threads taken this round — 7, all answered and all resolved
PRRT_kwDOTAvnrs6js_9Dgit diff --quiet HEADreturns 1 for a dirty tree and other statuses for fatals; every non-zero was read as MODIFIED24db78ff— real. Reproduced over a real repository: head ref moved to a sha no object stands at,diff --quiet HEADexits 128fatal: bad object HEAD, and the old code published('000…001', MODIFIED)at exit 0. Now 0 clean / 1 modified / anything elseCouldNotRunwith git's stderr. The barerev-parse HEADbeside it moved to--verify --quietfor the same conflation one line up. Three tests, one per outcome, plus the command-level reproductionPRRT_kwDOTAvnrs6jtYen--is-inside-work-treeaccepts a subdirectory while the rest of the function treatsrootas the work-tree rootfe28ac19— real, and worse than stated.report docsgave 79 distinct tokens with 78 of 79 in the remainder, at exit 0, against 601 and 81 at the root: citations that resolve perfectly well reported DANGLING. Resolved to the work-tree top on the estate's own idiom (sequenced_after.pyandscope_globs.py, both_git_toplevel) rather than refused, because the operand defaults to cwd and the two-case contract reserves non-zero for a report that could not run. The reading now STATES the root it readPRRT_kwDOTAvnrs6jtgeK643cfe70— real.timeout=30at the one sink all four of this report's gits go through,TimeoutExpired→CouldNotRun; the estate's own number (hermes_runtime_validation/content.py:103-114, andfix/1098-realgit-subprocess-timeoutsdoing the same elsewhere). Measured headroom: the heaviest git here is 0.46s andls-filesover 5,510 entries is 0.007s. Two tests, one asserting the bound reachessubprocess.runand one reading the script for the sink still being the only onePRRT_kwDOTAvnrs6jtYeIpendingis a stack POPPED FROM ITS END, soextendpushes onto its TOP and the target is walked first. The reviewer's own example and the hardest shape the walk meets both give the right answer:one/two → ../../alt/deepresolvesone/two/three/file.mdto<base>/alt/deep/three/file.mdand reads the target's own bytes. The requested test is added anyway, asserting the EXACT path rather than a term, and the stack's orientation is now spelled out at both sitesPRRT_kwDOTAvnrs6jtge149c135a2— the docstring was right and the RECORD was stale. Both read 72 now, and the record's other two stale figures went with itPRRT_kwDOTAvnrs6jtxUJ44414cf1— a real defect, and the reading given was right. A botched substitution matched only the second72in the line, stranding69 ofon the line above; coverage itself was already 72 of 72 sincee170372d. Record now reads 72 of 72 (reply)PRRT_kwDOTAvnrs6jtxUjNone, counted as non_file rather than loop or unreadable44414cf1— the bound is not removable and cycle detection can't replace it (a self-appending chain never repeats a state; 201 hops before a manual cap). Measured looser than the platform it reads through: the OS refuses at 41 hops, this walk at 65 — no chain a reader could open is one this walk gives up on. Three new tests (reply)Review threads taken at
9997f763(after789cbc8fmerged the repaired main) — 3, all answered and all resolvedPRRT_kwDOTAvnrs6jx2sDtake_readingreads the tree throughPacketIndex/Pathtoo, so an unreadableopenspec/changes(OSError) or undecodable git output (UnicodeError) printed a traceback instead of the non-zero no-reading exit9997f763— real. The command-level handler readsexcept (CouldNotRun, OSError, UnicodeError)at the one rejoin point; identical stderr + exit 2. The per-file read loop is deliberately untouched (an undecodable file stays COUNTED under the undecodable skip term). Tests:test_an_unreadable_changes_directory_is_a_run_that_could_not_be_taken,test_a_packet_index_that_cannot_be_built_is_a_run_that_could_not_be_taken.PRRT_kwDOTAvnrs6jx2sv9997f763— stale prose. Patch B (#1097,c32749c3) is in this tree since789cbc8f; the note now says the count is taken against the spec as it stands in this tree, 72 scenarios at the merge ofmaindc242f3a.PRRT_kwDOTAvnrs6jydzfdc242f3awhere the realization record namesc32749c3for Patch Bc32749c3LANDED Patch B (the realization record's revision);dc242f3ais themainthis tree merged, which contains it (git merge-base --is-ancestortrue) with the spec byte-identical between the two — 72#### Scenario:blocks at either sha. Reproducible from both.Δ = 0 — the acceptance check this packet uniquely owes
scripts/is inside the file population, so a citation-shaped string written inthe report would be a token the next run counts. Taken twice, by two
instruments, at head
e170372dagainst merge base4ee21c40, both treesclean:
Identical, line for line, on both instruments. Δ = 0. Asserted mechanically
as well:
test_the_report_mints_no_citation_token_of_its_ownruns the shippedextraction pattern over the shipped script and asserts it matches nothing. And
re-checked at the FINAL head
49c135a2, after the record commit that quotesthese figures into a file the population reads, and again at
18c4222c:605 / 82 / 43 / 55 / 28 / 3001, unmoved at both.
Earlier rounds of this branch recorded 602/154, then 600/157, then 604/158 —
every one Δ = 0 and none wrong. The corpus moves under every merge into
main,which is why both the record and this body name the head and merge base their
figures were taken at.
The reproduction gate at
b1df95eeRun against a worktree at
b1df95ee80633339907c9e661164a783885a5d30:TWO FIGURES MOVE BY ONE APIECE, BOTH FOR THE SAME FIX, STATED RATHER THAN
SMOOTHED. The extra token is
openspec/changes/archive/..atscripts/validate-ideation-cross-reference.py:31, which the hand instrumentfolds onto
openspec/changes/archiveby stripping a dot off a..segment.The CLI refuses to fold it, because rewriting a path that walks UP into a
citation OF what it walks up from is inventing the citation (Copilot
PRRT_kwDOTAvnrs6jsy7w, fixed at0a6fdcdc). The remainder is unmoved at 78either way, the token being NOT-A-PACKET-REFERENCE and so outside it.
WHICH READING THIS IS, STATED, because the evidence publishes three and they
are not comparable. The CLI produces the NORMALIZED
issue-nativereading, which is what this delta's three fixed choices produce: normalization
BEFORE deduplication,
NOT_A_PACKET_REFERENCEheld OUTSIDE the remainder, andANY one qualified occurrence setting the flag. The 586 / 162 / 81 figures
beside it in the evidence are that file's own recipe reading, and
586 / 162 / 86 is its
literalreading; choice (1) forecloses both.design.mdD0(iv) andtasks.md§ 1.1 publish the recipe reading as thepacket's headline, so a reviewer who has read D0 should expect the CLI to print
a smaller number at the same commit, and both are right.
The mechanical probes reproduce the hand classification's measured
precision, which is a stronger check than the totals:
truncatedon exactlythe 4 tokens the hand read classed tokenization artifacts;
fixture-pathon19 = D4's 17 of 18 synthetic-fixture entries plus its 2 nested file-half
fixtures;
possibly-cross-repoon 13 of the evidence's 14 hand-foundcross-repository tokens with 2 false positives among the other 43, which is
D3(c)'s own measured figure, the one miss being the token D3(c) already names
as reachable by no adjacency rule at all;
punctuation-stripped0.ONE PACKET FIGURE IS NOT REPRODUCED, AND IT IS A DIFFERENCE OF INSTRUMENT
RATHER THAN A DEFECT. Patch B's rule (g) design record names "Expected at
b1df95ee: 78 inclusive → 57 filtered, 21 flagged ENTRIES"; the CLI gives78 → 43 filtered, 35 flagged entries. The 21/57 pair is the HAND
instrument's narrow same-line adjacency rule, which the evidence itself records
as MISSING 14 further cross-repository tokens
(
measurement-b1df95ee.md:375). D3(c) ships the WIDER rule the evidencerecommends on its measured precision (
:461), and 21 + 13 + 2 ≈ 35 is exactlywhat that rule should give. Rule (g)'s normative content — the arithmetic row
prints REMAINDER ENTRIES carrying the flag, never the corpus-wide figure — is
implemented, and both numbers print, separately labelled.
The head reading
Taken by the shipped CLI at
18c4222c, clean tree. Not committed into thetree: it is quoted here and nowhere in it, which is why the population's own
output-path fence is structural today.
The argument surface, exactly as D2 fixes it
REPO_ROOTdefaults to the working directory and is resolved to its work-treetop, so a run named at or taken from a subdirectory reads the repository that
subdirectory stands in, and the reading states which root that was.
--jsonisa BOOLEAN output-format flag taking no path: it writes to STDOUT and a caller
redirects. There is no
--fail-onand no--fix, andtest_there_is_no_fail_on_flagenumerates every option string the parserreturns and asserts the set is exactly
{-h, --help, --json, --all, --tokens, --history, --include, --exclude}. Exit is the two-case contract: 0 whatever itfinds, non-zero only where the report COULD NOT RUN.
WHAT THIS PULL REQUEST DELIBERATELY DOES NOT DO
It does not wire the nightly —
.github/workflows/doc-health-reusable.ymlis untouched; that is
tasks.md§ 2.2 and slice R2. It does not commit areading — § 2.3's evidence is slice R3. It does not archive anything,
promote any requirement, or shut #1053 (this pull request carries no closing keyword, by design) — § 3 is a later pull request on a
later word, and #1053 closes only in the archive pull request. § 2.4 stays
unticked too: a merged-plus-green pair is not a thing this pull request can tick
about itself.
D7's scope fences. The merge makes them exact: this branch's merge base IS
origin/main, so the diff below is precisely this branch's own contribution andnothing of
main's.Validators, at
18c4222cpython3 -m pytest tests/citation_remainder -qpython3 -m pytest tests/citation_remainder tests/proposal-support tests/sequenced_after tests/doc-health -qpython3 scripts/validate-sequenced-after.py .OPENSPEC_TELEMETRY=0 openspec validate add-citation-remainder-report --strictChange 'add-citation-remainder-report' is valid, exit 0OPENSPEC_TELEMETRY=0 openspec validate --all --strict109 passed, 2 failed— the two pre-existing (add-chain-attestation,add-composed-view-authoring); no thirdpython3 scripts/validate-code-surface.py .every active declaration's head is admittedpython3 scripts/report-citation-remainder.py .python3 scripts/report-citation-remainder.py . --json | python3 -m json.toolpython3 -m py_compileon both new filesDesign choices the delta leaves open, each recorded rather than assumed
git diff --quiet HEAD,not by
git status --porcelain, whose untracked??lines would mark thetree modified over files this report never reads — and only its documented
statuses
0and1are read as answers.defaults to cwd, so refusing would fail the ordinary run taken from anywhere
but the top, and the two-case contract reserves non-zero for a report that
could not run.
the single script, one function each, rather than in a second module: the
packet names one script file three times and a module split is a scope move
that takes a ruling.
own, not by
Path.resolve(): the term's extent is a fact about the path,and
resolve()answers about what stands at one. Every component is read —the entry's own and every parent's — and
..is applied to what has beenresolved so far rather than cancelled against unread text.
token, which is the only reading under which the grammar's trailing-slash
refusal can fire at all — the normalization strips it before deduplication.
The consequence is stated: a directory citation written in a custody locator
fires no signal.
opsx:and the token, soopsx:a/b/<token>is an owner containing/and fires nothing — which iswhat the malformed-locator scenario's own bullet asks for, and what the base
sentence's "immediately preceded by … one owner segment and
/" requires.punctuation-strippedfires on the FULL-STOP strip and not on theseparator strip. The trailing path separator is the one character the
grammar admits in no identifier, so an entry is not labelled for a strip that
could suppress no valid citation.
and the token. Measured: two of the fourteen hand-found cross-repository
tokens at
b1df95eeare spelledcodexFactory `<token>`.DANGLINGorAMBIGUOUS, which is the recipe's own population.class: nullunder--allrather than a fifth label, which is Patch B's own sentence.outside the arithmetic row, which prints REMAINDER ENTRIES carrying the flag.
--jsonobject carries D2's enumerated fields and a few beside them,now including a top-level
root: D2 enumerates what the object carries, notwhat it may not.
--historyprobes the identities a reading LISTS, not every identity inthe corpus.
applies, so a reader does not read a difference of definition as a drift in
the corpus.
with 60x measured headroom over the heaviest git this report runs.
Refs #1053.
🤖 Generated with Claude Code