You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
T072: opendox.lines, openDox's own line rule and HEAD read (plan 038, realize-doc-health-direction-arc) - #95
Realizes: step 2.1 of the OpenSpec change realize-doc-health-direction-arc ("Re-author the generic slice"; its design.md § 3). This is a realization landing of that change (design.md § 8), so it carries that change's Arc: line and no Arc: neutral-product-standalone-operability line. It realizes no #1144 box.
Falsifier (tasks.md 2.1): the module's own tests, including the round trip over CR, LF, CRLF, no final newline, mixed endings, form feed and U+2028, AND explicit boundary assertions that ONLY CR, LF and CRLF split rows; openDox-code's whole suite as its required validate job runs it, green.
src/opendox/lines.py (new), standard library only (os, re, subprocess).
split_keepends(text) -> [(body, ending)] and join_rows(rows), with the behaviour of openxFactory's scripts/doc_health/lines.py:111 and :132:
only CR, LF and CRLF end a row, and CRLF is ONE ending;
join_rows(split_keepends(t)) == t for every t;
empty text is no rows, and the last row's ending is empty only when the text does not end in a line ending.
head_sha(repo), the one read openXdox-code's generator.py:128 takes from RealGit, mirroring RealGit.head_sha exactly (scripts/doc_health/corpus.py:417, :424-431, :739-741 at openxFactory 9171d14a):
the argv is ["git", "-C", str(repo), "rev-parse", "HEAD"], and the call is capture_output=True, text=True, timeout=30;
a timeout or an OSError gives None, a non-zero exit gives None, and an empty answer gives None;
any other error propagates;
a blank answer reads as "", as RealGit's out.strip() if out else None reads it. No git prints a blank answer for rev-parse HEAD; it is pinned so T074's retarget changes nothing.
A re-authoring, not a relocation: nothing leaves openxFactory, openxFactory is unchanged, and the module imports nothing from it. A lone openDox-code checkout runs it.
The CRLF text's first row ends in ONE ending, never a CR row and then an LF row. LF then CR is two endings.
Every other separator str.splitlines() breaks on is named, and each leaves a<sep>b ONE row: VT \v, FF \f, FS \x1c, GS \x1d, RS \x1e, NEL \x85, U+2028 and U+2029.
The named list is checked against what str.splitlines() really breaks on, measured over every code point. One text holding every code point but CR and LF is one row.
The round trip over a corpus of row shapes, and join_rows on its own. A test also shows that the round trip alone cannot tell this rule from str.splitlines(keepends=True) (design.md § 3).
The real-line rule as a property. All 19,531 texts of up to six characters over {a, CR, LF, FF, U+2028} read as an independent character-by-character reading of the rule reads them. Each round-trips and has the rows' shape.
head_sha on real temporary repositories, and every way it degrades.
It reads HEAD: a second commit moves it, and a detached HEAD is read.
It answers None for a non-repository, an unborn HEAD (git prints HEAD and exits 128), a path that is not there, no git on PATH, a timeout, a git that cannot start, a non-zero exit, and an empty answer.
Its command and its bound are RealGit's, and any other error propagates.
Parity with serve._head_of (6023517122): the two agree on a repository, an unborn HEAD and a non-repository. This is the drift guard while two copies exist.
Import weight: in a fresh interpreter, with openXdox and openxFactory's packages blocked, import opendox.lines loads the standard library and no other module of openDox, and its public names are the three.
The falsifier, run (red first)
Red, with src/ identical to main (the module moved out of the tree), and this branch's test file:
$ python -m pytest -q tests/test_lines.py
E ImportError: cannot import name 'lines' from 'opendox' (…/src/opendox/__init__.py)
ERROR tests/test_lines.py
1 error in 0.46s
Green, at the final head 2ab7c4ad, .[runtime,test] under the constraints file, Python 3.12.3, CI=true:
The round trip alone does not fail a splitlines rule; the boundaries do (design.md § 3). This was measured with mutant M06 below applied, where the split is str.splitlines(keepends=True):
$ python -m pytest -q tests/test_lines.py -k "round_trip_returns or join_rows_writes"
77 passed, 46 deselected in 0.43s
$ python -m pytest -q tests/test_lines.py -k "no_other_separator or no_code_point or every_short_text"
10 failed, 113 deselected in 4.72s
Mutants: 33, all killed
Each mutant replaces one exact string in src/opendox/lines.py (the needle occurs once), runs tests/test_lines.py with -x, records the first failing node, and restores the file byte for byte (sha256 e11c714c… before and after). The run below is against the final head's test file, 2ab7c4ad; it is line for line the same as the run at e4920717.
M01 the CRLF branch is dropped: KILLED by test_each_real_line_ending_splits_a_row[CRLF]
M02 CR is tried ahead of CRLF: KILLED by test_each_real_line_ending_splits_a_row[CRLF]
M03 a lone CR is no ending: KILLED by test_each_real_line_ending_splits_a_row[CR]
M04 a lone LF is no ending: KILLED by test_each_real_line_ending_splits_a_row[LF]
M05 splitlines' separators end a row too: KILLED by test_no_other_separator_splits_a_row[VT]
M06 the split is str.splitlines(keepends=True): KILLED by test_no_other_separator_splits_a_row[VT]
M07 the last row, with no ending, is dropped: KILLED by test_each_real_line_ending_splits_a_row[CR]
M08 the last row invents an LF: KILLED by test_each_real_line_ending_splits_a_row[CR]
M09 the next row starts one past the ending's start: KILLED by test_each_real_line_ending_splits_a_row[CRLF]
M10 the loop runs one past the end: KILLED by test_crlf_is_one_ending_never_a_cr_row_then_an_lf_row
M11 a body carries its ending: KILLED by test_each_real_line_ending_splits_a_row[CR]
M12 every ending is written as LF: KILLED by test_each_real_line_ending_splits_a_row[CR]
M13 the search skips an ending at the row's first character: KILLED by test_crlf_is_one_ending_never_a_cr_row_then_an_lf_row
M14 join_rows drops the endings: KILLED by test_the_round_trip_returns_the_text[a\n]
M15 join_rows writes the ending before the body: KILLED by test_the_round_trip_returns_the_text[a\n]
M16 join_rows puts an LF between rows: KILLED by test_the_round_trip_returns_the_text[\n\n]
M17 the branch tips are read, not HEAD: KILLED by test_the_head_moves_with_a_new_commit_and_a_detached_head_is_read
M18 no -C: the cwd's repository is read: KILLED by test_the_head_of_a_real_repository_is_read
M19 the read is unbounded: KILLED by test_the_read_is_realgits_command_and_bound
M20 the bound is 5 seconds, not RealGit's 30: KILLED by test_the_read_is_realgits_command_and_bound
M21 the output is not captured: KILLED by test_the_head_of_a_real_repository_is_read
M22 the output is bytes, not text: KILLED by test_the_head_of_a_real_repository_is_read
M23 a timeout escapes: KILLED by test_a_git_that_does_not_answer_in_time_is_no_head
M24 an error starting git escapes: KILLED by test_no_git_on_the_path_is_no_head
M25 every error is swallowed: KILLED by test_any_other_error_propagates_as_realgits_does
M26 the exit code is ignored: KILLED by test_an_unborn_head_is_no_head
M27 the answer is not stripped: KILLED by test_the_head_of_a_real_repository_is_read
M28 a blank answer is None (serve._CheckoutHead's reading): KILLED by test_a_blank_answer_is_read_as_realgit_reads_it
M29 an empty answer is the empty string: KILLED by test_an_empty_answer_is_no_head
M30 a non-zero exit raises (check=True): KILLED by test_a_directory_that_is_not_a_repository_has_no_head
M31 the module imports another module of openDox: KILLED by test_the_module_loads_the_standard_library_and_nothing_else_of_opendox
M32 the module imports a third-party package: KILLED by test_the_module_loads_the_standard_library_and_nothing_else_of_opendox
M33 head_sha leaves the public names: KILLED by test_the_module_loads_the_standard_library_and_nothing_else_of_opendox
mutants: 33, survivors: 0
The whole suite, as CI runs it
CI's validate job at the final head 2ab7c4ad (run 37552064211, job 112569631082). It ran on the merge ref f0380f7, which is 2ab7c4ad merged into maind616da3e, so T104 was included:
At d1268f58 (run 37546933980, job 112553070043), CI read the same triple. This change adds 123 cases and no skip, so EXPECT_SKIPPED stays 11, and the floors are not moved. The local replicas of the job were stopped at the holder's word, because CI's triple answers the gate.
2ab7c4ad: SonarCloud's four findings folded (below). src/opendox/lines.py is unchanged. The diff against main is still the two files.
SonarCloud: 0 open new issues at the final head
At d1268f58 SonarCloud reported four new MAJOR code smells, all in tests/test_lines.py, and 2ab7c4ad fixes them:
python:S9073, twice: two composite assertions joined with and are split into separate assertions.
python:S8993, twice: the parity test no longer looks fixtures up with request.getfixturevalue(). Two plain functions build the repository and the unborn HEAD, and the fixtures and the parity cases both call them.
At 2ab7c4ad all four read CLOSED, and the quality gate is OK: every new-code rating is 1, duplication is 0.0, hotspots reviewed is 100.0, and there are 0 hotspots.
Medium: use os.fspath(repo) rather than str(repo) (lines.py:89). The annotation admits any os.PathLike[str], and str() of an os.DirEntry is not its path.
Proposed class: accepted limit, with a one-line fix available if the holder prefers it.
str(repo) is RealGit._run's own spelling, which the holder's ruling 6023517122 says to mirror.
For the inputs RealGit and serve._head_of take (str and pathlib.Path), both spellings give the same argv. T074's retarget passes Path(repo), and no caller in the estate passes another path-like.
The fix would change the argv only for other path-likes. It would also make a non-path argument raise TypeError where RealGit would run git on its str().
Low: the docstring does not state the "" return for a blank answer (lines.py:87).
Proposed class: accepted limit (documentation).
The behaviour is deliberate, pinned by test_a_blank_answer_is_read_as_realgit_reads_it, and stated in that test's docstring and in "What it adds" above.
No git prints a blank answer for rev-parse HEAD.
The module's name
src/opendox/lines.py, the brief's default, so T074's retarget of openXdox-code's completeness.py, round_trip.py and generator.py is a one-word import change. Measured free at 84f8ed83 and again at 09b8d44a:
no file, module or import named lines or opendox.lines in openDox-code;
nothing in src/opendox/__init__.py;
no open PR and no remote branch adds one;
no module index or naming convention argues against it.
Two existing private helpers stay as they are (6023517122)
serve._CheckoutHead.head_sha (src/opendox/serve.py:964-983, plan 034 T012) makes the same read. serve.py is single-writer (T014 → T015 → T016 → T052 → T057) and is not edited here. The parity test above holds the two together. Folding _CheckoutHead onto lines.head_sha is an unscheduled, optional follow-on for a later owner of serve.py, and neither T072 nor the arc owes it.
doxbench_defaults._REAL_LINE_END (src/opendox/doxbench_defaults.py:67) splits on CR, LF and CRLF for one Status: read, without endings. It is untouched. Moving it onto split_keepends is unscheduled and optional, owed by no one.
tests/fixtures/web_boundary_census.yaml covers only web/. No census, guard or boundary file is edited.
Files changed
src/opendox/lines.py (new).
tests/test_lines.py (new).
What is NOT done here
T074, in openXdox-code: retargeting completeness.py, round_trip.py and generator.py's generic half onto this module, and the seams.
The pin, tasks.md 2.2 (ARC-6). If this lands before plan 038's T061, it rides T062's root pin and T063's opendox @ pin, which are #1144's landings under #1144's trailer. Otherwise the arc brings its own. T061 never waits for it.
A test comparing this module with openxFactory's lines.py. It would need openxFactory, so it belongs in the composed run, not in openDox-code's own suite (design.md § 3).
… realize-doc-health-direction-arc)
A new standard-library module carrying split_keepends and join_rows, with
the real-line rule openxFactory's doc_health/lines.py implements (only CR,
LF and CRLF end a row; CRLF is one ending), and head_sha(repo), RealGit's
one read the openXdox generator takes (git -C <repo> rev-parse HEAD,
bounded at 30 seconds, None where git cannot answer). A re-authoring: it
imports nothing from openxFactory, and openxFactory is unchanged.
tests/test_lines.py holds the boundaries (every separator str.splitlines()
breaks on besides CR and LF, named and measured over every code point),
the round trip over a corpus of row shapes, the rule as a property over
every short text, head_sha on real temporary repositories and every way it
degrades, its parity with serve._head_of (holder ruling, openxFactory#656
comment 6023517122), and the module's import weight.
Lane: openxfactory-4
Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
This PR re-authors openDox’s generic line-handling and HEAD-reading primitives into a standalone opendox.lines module, preserving the established semantics without importing openxFactory, and adds extensive tests validating boundaries, Git failure modes, parity, import isolation, and mutation coverage.
Sequence diagram for bounded HEAD resolution
sequenceDiagram
participant Caller
participant Lines as opendox.lines
participant Git as git
Caller->>Lines: head_sha(repo)
Lines->>Git: subprocess.run([git, -C, repo, rev-parse, HEAD], capture_output=True, text=True, timeout=30)
alt successful non-empty output
Git-->>Lines: returncode 0 and stdout
Lines-->>Caller: stdout.strip()
else timeout, OSError, non-zero exit, or empty output
Git-->>Lines: failure or empty stdout
Lines-->>Caller: None
end
Loading
Flow diagram for the real line-ending rule
flowchart LR
Text[Input text] --> Split[split_keepends]
Split --> Match{CRLF, CR, or LF?}
Match -->|yes| Row[Append body and exact ending]
Match -->|no| Next[Continue scanning]
Row --> Next
Next --> Done[Rows with only real line endings]
Done --> Join[join_rows]
Join --> Output[Original text]
Loading
File-Level Changes
Change
Details
Files
Adds a standalone, standard-library-only generic line parser and Git HEAD reader for future openDox consumers.
Implements CR, LF, and CRLF-only row splitting with lossless join support.
Implements git -C <repo> rev-parse HEAD with the established timeout, output, and error semantics.
Keeps the module self-contained and exposes only the three intended public names.
src/opendox/lines.py
Adds comprehensive behavioral, compatibility, and isolation tests for the new module.
Covers line-ending boundaries, exotic separator rejection, round trips, and an exhaustive short-text property space.
Tests real repositories, detached and unborn HEADs, command failures, timeout behavior, and error propagation.
Guards parity with serve._head_of, import weight, standalone operation, and mutation resistance.
tests/test_lines.py
Tips and commands
Interacting with Sourcery
Trigger a new review: Comment @sourcery-ai review on the pull request.
Continue discussions: Reply directly to Sourcery's review comments.
Generate a GitHub issue from a review comment: Ask Sourcery to create an
issue from a review comment by replying to it. You can also reply to a
review comment with @sourcery-ai issue to create an issue from it.
Generate a pull request title: Write @sourcery-ai anywhere in the pull
request title to generate a title at any time. You can also comment @sourcery-ai title on the pull request to (re-)generate the title at any time.
Generate a pull request summary: Write @sourcery-ai summary anywhere in
the pull request body to generate a PR summary at any time exactly where you
want it. You can also comment @sourcery-ai summary on the pull request to
(re-)generate the summary at any time.
Generate reviewer's guide: Comment @sourcery-ai guide on the pull
request to (re-)generate the reviewer's guide at any time.
Resolve all Sourcery comments: Comment @sourcery-ai resolve on the
pull request to resolve all Sourcery comments. Useful if you've already
addressed all the comments and don't want to see them anymore.
Dismiss all Sourcery reviews: Comment @sourcery-ai dismiss on the pull
request to dismiss all existing Sourcery reviews. Especially useful if you
want to start fresh with a new review - don't forget to comment @sourcery-ai review to trigger a new review!
SonarCloud reported four new MAJOR code smells on openDox-code#95 at
d1268f5, all in the test file:
- python:S9073 (twice): two composite assertions joined with "and" are
split into separate assertions, so a failure names the half that broke.
- python:S8993 (twice): the parity test no longer looks fixtures up by name
with request.getfixturevalue(). The repository and the unborn HEAD are
built by two plain functions that the fixtures and the parity cases both
call.
No change to src/opendox/lines.py. The 123 cases pass, and the 33 mutants
are all killed by the same named tests as before.
Lane: openxfactory-4
Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
The reason will be displayed to describe this comment to others. Learn more.
Copilot review overview
🔵 Needs a closer look
The public PathLike contract is not implemented correctly, and the documented HEAD return contract is incomplete.
Review effort: Balanced Findings: None
Previously missed (2)
In code that hasn't changed since last review
Use os.fspath to support all advertised path-like inputs
src/opendox/lines.py:89
The annotation accepts any os.PathLike[str], but str(repo) does not honor the __fspath__ contract. For example, a valid os.DirEntry becomes "<DirEntry 'repo'>", so this function invokes Git on a nonexistent representation and returns None. Use os.fspath(repo) so all advertised path-like inputs resolve correctly; str and pathlib.Path keep the same argv.
Document empty-string return for whitespace-only Git output
src/opendox/lines.py:87
This docstring promises only a commit or None, but the intentionally pinned RealGit behavior returns "" when a successful command emits whitespace-only stdout. Document that third result explicitly so callers do not treat the stated return contract as exhaustive.
brettheap
changed the title
DRAFT: T072: opendox.lines, openDox's own line rule and HEAD read (plan 038, realize-doc-health-direction-arc)
T072: opendox.lines, openDox's own line rule and HEAD read (plan 038, realize-doc-health-direction-arc)
Oct 7, 2026
Holder, automatic READY on Brett's word "land lane 3's PRs when green" (2026-10-06). At the head: CLEAN, rollup SUCCESS, nothing pending, 0 unresolved threads, and Copilot at 2ab7c4ad reads "🔵 Needs a closer look". The per-repo lander checks closing keywords and lands it.
Holder, at READY: T072, opendox.lines, openDox's own line rule and HEAD read (realize-doc-health-direction-arc, ratified as T071 6023375303; ARC-6, opportunistic).
Gates at the head:
validate passes, with triple 5658/5647/11/0/0 on the head merged with maind616da3e;
acceptance and SonarCloud pass, with 0 new issues (the four test-file smells closed);
0 threads.
The falsifier: 123 tests, red first (an ImportError with main's src). Under the splitlines mutant the boundary tests fail. Mutants are 33 of 33 killed.
Copilot at 2ab7c4ad, "Needs a closer look", Findings: None. Two items in the review body are ACCEPTED LIMITS under 5988818366:
str(repo) rather than os.fspath(repo) (lines.py:89). It mirrors RealGit.head_sha's own spelling, as holder ruling 6023517122 required. The argv is identical for str and pathlib.Path, which are the only types any caller passes; T074 passes Path.
The docstring omits the "" return for a blank answer (lines.py:87). The behaviour is deliberate and pinned by a named test.
Scope: the two files only, no serve.py (6023517122). The diff against main is src/opendox/lines.py and tests/test_lines.py.
…al lander; feature 007's guard admits the landing's fast-forward (plan 038) (#90)
Lane: openxfactory-4 (openXfactory-4-openDox_extraction)
Arc: neutral-product-standalone-operability
## T012 + T013 (plan 038, P4-D1): the landing seam, governance, confirmation and the neutral lander; feature 007's guard
One PR, as T012's "Lands with: T013" requires.
**Lane 3's review R2-DELTA gave GO at `4527432`** (openxFactory#656 `6068087981`; PR comment `6068087062`). The holder lands it.
- T008 has landed: codeXfactory/codeXfactory#515, merge `f1b019fe` (feature 007's FR-004a and C12).
- T010 (#89, `34c2064`), T025 (#91, `84f8ed8`), T011 (#92, `09b8d44`), T014 (#93, `a7a1c4d`) and T072 (#95, `9922088`) have landed, and this branch has merged all five (never a rebase).
- The two `session_pr` re-exports sit beside T011's names, after its submission-port block.
- Lane 3's R2-DELTA raised one new MINOR (`landing.py:836`), an accepted limit (openxFactory#656 `6069024568` item 1), stated below.
- Copilot's seventh review and Codex's review at `4527432` raised 4 findings. All four are accepted limits by holder ruling openxFactory#656 `6067853207` and are stated below; Copilot's "Changes recommended" at `4527432` stands for them.
- Copilot's sixth review (9 threads) and lane 3's review R2 (`6035652847`) are answered in `ff6f1cb`. R2's findings 1 to 5 are fixed and finding 6 is an accepted limit (holder ruling openxFactory#656 `6035797819`); the point-by-point answer is `6067643141`.
### T012: the landing seam
- **Realizes**: 12.6a (part: the seam, the query, the capability, the lander) and 12.6 (part).
- **Falsifier**:
- F12.2's thirteen `tests/test_landing_guardrails.py` nodes, including the static issuer check;
- named nodes beside them for R2Q7 (a)'s two refusals: `test_a_repository_with_no_main_is_unknown_and_refused_naming_it` and `test_no_declaration_refuses_naming_the_file_and_its_content` (lane 3's R2Q7 FIX);
- ADV-08's named node: `test_a_dirty_served_checkout_on_main_is_refused_before_merging`;
- the push URL's: `test_the_remote_check_reads_the_push_url_not_the_fetch_url` (a remote whose `pushurl` names a repository ahead of local `main` is refused; one with two push URLs is refused), and `test_the_push_url_never_reaches_git_argv`;
- lane 3's review R2: `branch.HEAD.mergeOptions` in F12.2's configuration walk, `test_a_driver_named_like_one_of_git_s_own_states_cannot_resolve_a_conflict`, `test_an_ignored_file_the_landing_would_overwrite_is_refused`, `test_only_the_lander_issues_the_served_fast_forward` and `test_a_git_without_attr_source_is_refused_by_name`.
- **Ruled**: R2Q1, R2Q3, R2Q4, R2Q5, R2Q6 and R2Q7 (openxFactory#656 `6003486656`; the plan was ruled at `6013547504`).
- **Decisions**: CF-1, N-1, N-11, N-16, OQ-12-17 and OQ-038-1.
### T013: feature 007's guard, by R2Q6 (a)'s four exceptions
- **Realizes**: 12.6a (part).
- **Falsifier**: `tests/test_session_git.py` whole, quoted below.
- **Ruled**: R2Q6. **Text**: feature 007's FR-004a and SC-002, as T008 landed them (codeXfactory/codeXfactory#515, `f1b019fe`).
### The falsifiers, run at `4527432` with `gh` hidden from PATH (the full local suite in CI form there, with its Postgres and a live sandbox: 5795 passed, 11 skipped, in 39:51)
F12.2's command, verbatim (the thirteen nodes by name):
```text
$ python -m pytest -q "tests/test_landing_guardrails.py::test_land_requires_an_explicit_human_act" … "tests/test_landing_guardrails.py::test_only_the_interactive_layers_call_an_issuer"
............. [100%]
13 passed in 8.20s
```
T012's five named nodes:
```text
$ python -m pytest -q "tests/test_landing_guardrails.py::test_a_repository_with_no_main_is_unknown_and_refused_naming_it" "tests/test_landing_guardrails.py::test_no_declaration_refuses_naming_the_file_and_its_content" "tests/test_landing_guardrails.py::test_a_dirty_served_checkout_on_main_is_refused_before_merging" "tests/test_landing_guardrails.py::test_the_remote_check_reads_the_push_url_not_the_fetch_url" "tests/test_landing_guardrails.py::test_the_push_url_never_reaches_git_argv"
..... [100%]
5 passed in 3.05s
```
`tests/test_session_git.py` whole (105 cases), and the new file whole (113 cases), at `4527432`:
```text
$ python -m pytest -q tests/test_landing_guardrails.py tests/test_session_git.py
218 passed in 80.84s (0:01:20)
```
**Red first.** The same two test files, run against `origin/main`'s code (`a7a1c4d`):
- `tests/test_landing_guardrails.py` does not collect (`ImportError: cannot import name 'landing' from 'opendox'`), so F12.2's command fails, as #1144 says it does today.
- `tests/test_session_git.py` reads `21 failed, 80 passed`. The failures are the moved pin, the admitted fast-forward and its refusals, the eight pinned-settings cases, the ambient-environment case, the NUL-field read, the lookalike `main`, the escaped refusal, and the exact `branch_sha`.
- `("merge", "other-branch")` at `:523` passes on both sides, as T013 requires.
**Mutants: 106 of 106 killed** (on `ff6f1cb`'s code, which `4527432` carries unchanged). There is one mutant per guard, each run against the tests that must catch it, and each was killed by a test failure: pytest exit 1, never an error or a missing node. They cover:
- **the capability** (C1–C12): branch binding, head binding, single use, a non-token, a non-TTY stdin, any answer at the terminal, direct construction, a third issuer, an issuer reached from a product module, any nonce, a non-ASCII nonce reaching `encode()`, and a discarded token's record kept;
- **the governance** (G1–G16): among them, the host never asked, a host without an instrument not outranking, a host that fails to load read as absent, the declaration read from the working tree, standalone without the local install, HEAD's branch read instead of `main`, a duplicate key, a linked declaration, the default profile taken as a host, a lander bound whatever governs, the instrument route skipping the confirmation, and the head not read again before the submission;
- **the lander** (L1–L22): rerere, no `--no-ff`, a dirty `main` checkout, no `ls-remote` check, N-16 reversed, one remote of several, a checkout on another branch fast-forwarded, `main` held elsewhere, a push, no remedy, a conflict reported as a failure, `.gitattributes` reaching the merge, no driver check, the strategy left to configuration, `main` moved by its ref alone, `merge.default` unpinned or pinned to a name a driver can hold, `merge.directoryRenames` unpinned, a named `text` driver taken as git's own, quoted conflict paths, `main` not compared with the merge's tip, and a `main` that did not land reported as landed;
- **the remote check and the messages** (R1–R5, S1, B1–B3, W1–W3): the redaction missing the fragment and spaced forms, the check reading the fetch URL, several push URLs not refused, the push URL riding in the argv, `get-url` without `--push`, a path shown as it is, the prompt, the dirty-checkout refusal and the fast-forward refusal showing raw names, the top's prefix check dropped, and the push URL and the holder's path read stripped;
- **the hooks** (H1–H4): the merge, the landing worktree's checkout, the `switch`, and the fast-forwards running hooks;
- **the byte reads** (N1–N3, X1): NUL-delimited fields read in text mode, the runner ignoring `binary`, text mode decoding strictly, and the served `HEAD` read stripped;
- **the audit** (A1);
- **the guard** (T1–T9, V1): any merge on a clean `main`, a dirty checkout, another branch, below the root, `merge` on the name list, a short id, the fast-forward's settings not pinned or not delivered, the pins back in the argv, the runner passing the ambient environment, and `branch_sha` suffix-matching;
- **Copilot's sixth review** (P1–P12), each of these guards removed:
- the transport pre-check, and `GIT_ALLOW_PROTOCOL`;
- scrubbing the URL's values by value, and keeping only git's own stderr lines;
- the probe's time bound, batch-mode ssh, and the prompt switched off;
- the escaped branch name in the conflict remedy and the already-landed refusal;
- the binding's acceptance of a name a strip would change;
- the bytes reader going through the funnel's pins;
- the inside-a-work-tree check;
- **lane 3's review R2** (Q1–Q9), each of these broken:
- `branch.HEAD.mergeOptions` left unpinned;
- a driver named `set`, `unset` or `unspecified` able to answer (one mutant each);
- an ignored file overwritten, and the file-where-a-directory-goes case not seen;
- an older git escaping as a raw `GitError`, and the floor not named at the merge;
- another module naming the served fast-forward.
### What this changes
**`src/opendox/landing.py` (new).**
- `LandingPort` has one operation, `land(branch, *, confirmation) -> Landed`.
- `Landed` carries `merge_commit` and `previous_main`. Its `served_checkout` is `fast-forwarded` or `left`, and `pushed` is always False.
- `MergeConflict` carries the paths, read NUL-delimited as bytes and so exactly as spelled, and the remedy: bring `main` into the branch and resolve there. Its message shows a path or a branch name that holds a control or format character escaped (`repr`), so neither can write to the terminal or reorder the message. Every refusal that names the branch does the same.
- `LandingRefused` carries a `code` for T016's routes.
- `repository_governance(checkout_root)` answers `standalone`, `governed` or `unknown`, failing closed, in this order:
1. the checkout must be a working tree's top, with a branch `main` (R2Q7 (a)). The top is asked of git: the checkout must be inside a work tree, with an empty prefix. It is never compared as a path, so a directory name ending in a space or a newline reads;
2. the install mode must resolve;
3. a registered host profile decides, whatever any file says (R2Q4 (a));
4. otherwise `.opendox/governance.yaml` decides, read from the blob at `main`'s tip (N-1). `standalone` needs `OPENDOX_INSTALL_MODE=local` or `--local` (FR-007; ADV-38).
- With no declaration, the refusal names the exact file and its content.
- `bound_lander` binds the neutral lander under `standalone` only.
- `request_landing` routes a landing:
- under `governed` with an instrument, it submits the confirmed branch through the instrument, and nothing merges. The branch's head is read again immediately before `submit`, and a branch that moved is refused;
- otherwise it refuses by name: `governed-without-an-instrument`, or why the governance is `unknown`.
- **The neutral lander**, in order:
1. refuses `main` (R2Q5 (a));
2. re-reads the governance at the moment of landing;
3. spends the confirmation;
4. reads `main` at the remote's PUSH URL first (`git remote get-url --push --all <remote>`; the fetch URL where no `pushurl` is set):
- a remote with several push URLs is refused (`several-push-urls`). The URLs are read as bytes and no record is dropped, so a URL holding a newline reads as two and is refused, never trimmed;
- a push URL whose transport is a program git would run is refused before anything runs (`remote-transport`). That covers `<name>::`, and a `<scheme>://` that git does not carry;
- the URL is probed with `git ls-remote <transient remote> refs/heads/main`, where the transient remote is `remote.opendox-probe-<hex>.url` passed in the command's environment (`GIT_CONFIG_COUNT=1`). So the URL, and any credential in it, never reaches git's argv;
- the probe admits only git's own transports (`GIT_ALLOW_PROTOCOL`), so a second `insteadOf` rewrite runs no helper;
- the probe never waits on a human: no prompt, no askpass, and ssh in batch mode, which also outranks a repository's own `core.sshCommand`. It is bounded by `PROBE_TIMEOUT` (60 s);
- a remote with no `main` passes (N-16);
- every message is redacted:
- every value the URL carries is removed BY VALUE (`submission_push._scrubbed`);
- then the runtime's `redact_credentials` and 12.1a's patterns run, the fragment form (`#token=`) and a value after whitespace included;
- a failed probe keeps only git's `fatal:` and `error:` lines, so curl's trace headers never reach a message;
5. refuses a dirty served checkout on `main` before merging (ADV-08), and refuses where another working tree holds `main`;
6. makes the `--no-ff` merge in its own detached worktree under `<repo>-worktrees/landing/`, with git's own strategy and drivers only:
- `.gitattributes` and the global attributes file are out of the merge;
- a driver this machine's attributes still select is refused, a named `text` or `binary` included;
- `merge.default` is pinned to a fresh driver name, and `merge.directoryRenames` to `conflict`;
- `branch.HEAD.mergeOptions` is pinned empty. The merge runs on a detached HEAD, where `-X theirs` answered a conflict and `-s ours` dropped the branch (lane 3's review R2);
- drivers named `set`, `unset` and `unspecified` are pinned to fail. `check-attr` cannot tell those string values from git's own states;
- a git without `--attr-source` (older than 2.42) is refused by name (`merge-failed`), never with a raw error;
- rerere is off;
- no hook runs (`core.hooksPath=/dev/null`) in the landing worktree's checkout, the merge, its `switch`, or either fast-forward. A hooks path inside the tree is the branch author's to write, and a hook that pushed would contradict `pushed=False`;
7. then moves `main`:
- where the served checkout holds `main` and is still clean, by `git merge --ff-only <merge commit>` there. First it refuses (`ignored-files-in-the-way`, naming the files and the remedy) when the checkout holds an IGNORED file where the landing writes. That covers the path itself, a file under it, and a file where it needs a directory. A fast-forward overwrites an ignored file with no word;
- where it holds another branch, the landing worktree takes `main`, checks that it is still the merge's tip, and fast-forwards it there (`left`). git refuses `main` to the landing worktree while another working tree holds it, and refuses `main` to every other working tree while the landing worktree does. So `main` never moves by its ref alone.
- It pushes nothing (R2Q6 (a)), and every git command goes through `session_git.SessionGit`.
**`src/opendox/landing_confirm.py` (new).**
- The confirmation capability: opaque, bound to the branch and its head, and single-use.
- It has exactly two issuers:
- `confirm_at_terminal`, the `/dev/tty` prompt. It refuses a stdin that is not a terminal, refuses when there is no controlling terminal, and mints only on the typed branch name (N-11);
- `LandingNonces`, the server's per-branch nonce (OQ-12-13). A nonce that is not an ASCII string is a mismatch, never an exception.
- A token's record is dropped when the token itself is gone (`weakref.finalize`), so a long-running server keeps no record per confirmation. A spent token still held is still refused as spent.
- A token's binding refuses only an empty branch name. git decides what a branch name is, and a legal one may end in a no-break space.
- `INTERACTIVE_LAYERS` names the only modules that may call them: T015's and T016's `cli_branch_actions.py` and `serve_branch_actions.py`.
**`src/opendox/session_pr.py`.** It re-exports `LandingPort` and `repository_governance` (FR-007; ADV-23), beside T011's submission-port names. `PullRequestPort` keeps its three operations.
**`src/opendox/session_git.py` (T013).**
- The name-only allowlist at `:99` is restated, unchanged, and `merge` stays off it.
- An ARGUMENT check admits exactly the three arguments `merge --ff-only <commit>`, with `<commit>` a full object id and never a ref name (FR-004a exception 1). It admits them only at the served ROOT, and only while the served checkout holds `main` and `git status --porcelain` (untracked files included) is empty.
- The guard reads that state from git immediately before the move. `:93`'s stated rule names the exception (exception 2).
- `fast_forward_served(commit)` issues the move, then checks that the served checkout holds `main` at the commit. Otherwise it refuses, and never reports a move it did not make.
- The funnel pins `pull.twohead=ort` and an empty `branch.main.mergeOptions` in that one command's ENVIRONMENT (git's command-scope `GIT_CONFIG_COUNT`), never in its argv. Measured on git 2.43: `-s ours` made a new merge commit, and `--squash` changed the index and moved nothing.
- `SubprocessGitRunner` runs git with `local_git_adapter.sanitized_git_environment()`. So `GIT_DIR`, `GIT_WORK_TREE` and their relatives never redirect a command the guard approved.
- The fast-forward's environment pins `core.hooksPath` to no directory too, so no `post-merge` hook runs.
- `shown()` escapes, for a message, text that holds a control or format character (a bidi override included). The fast-forward refusal, `land`'s refusals and the confirmation prompt all use it.
- `branch_sha` reads the exact ref (`show-ref --verify`), and `checked_out_at` reads a working tree's path as spelled, a trailing space included.
- `git_nul(cwd, *args)` reads a NUL-delimited output as BYTES and decodes each field UTF-8 with `surrogateescape`, with no newline translation, so a carriage return or a non-UTF-8 name reaches a guard as git wrote it (Copilot 4195681954; openxFactory#656 `6026275158`). It runs through the funnel, so the fast-forward's pins apply to it too. Text mode decodes with `surrogateescape` too, so no git output raises.
- The served checkout's `HEAD` ref is read exactly: the legal branch `main\u00a0` is never taken for `main`.
- `ls_remote_url(cwd, url, ref)` probes one ref at a URL through a transient remote in the command's environment, for the landing's remote check. It runs with `PROBE_ENVIRONMENT` (non-interactive, git's own transports only) and `PROBE_TIMEOUT`. The runner takes an `env` overlay and a `timeout`, and a timeout answers exit 124.
**`tests/test_session_git.py` (T013).**
- `:523`'s `("merge", "other-branch")` still refuses, unchanged.
- `:563-564`'s pin moves to the admitted form. `merge` stays absent from the name list, the admitted argv is `("merge", "--ff-only")` plus a full id, and the pure guard admits it on a clean `main` and nothing else.
- New cases:
- the admitted fast-forward;
- every pinned setting, through all three entry points (the bytes reader included);
- refusals: a dirty checkout (tracked and untracked), another branch, a subdirectory, every other merge spelling (the `-c`-pinned spelling included), and a short id;
- a fast-forward that lands elsewhere;
- the ambient-environment case.
**`tests/test_landing_guardrails.py` (new).**
- F12.2's thirteen nodes, by their ratified names.
- T012's three named nodes.
- The lander's mechanics, the merge's drivers and settings, the governance reading's edges, and the audit's two nodes.
- The regressions for Copilot's sixth review and lane 3's review R2.
- The host-side nodes run against a registered TEST host profile that declares an instrument (R2Q3 (a)).
### The repository-creation audit (named, as T012 asks)
Every place openDox's product code creates a repository:
| site | before | now |
|---|---|---|
| `src/opendox/conformance_corpus.py:322` (`transpose`, the populated state) | `git init -q`: `init.defaultBranch` decided | `--initial-branch=main` |
| `src/opendox/conformance_corpus.py:431` (`transpose`, the empty state) | `git init -q`: `init.defaultBranch` decided | `--initial-branch=main` |
| `src/opendox/authoring.py:508` | `--initial-branch=main` already | unchanged |
| `src/opendox/runtime/repository_act.py:982-983` (`init --bare`) | `--initial-branch={branch}`, `DEFAULT_BRANCH = "main"` | unchanged, so T011's file is not touched |
Two tests hold it:
- `test_every_repository_opendox_creates_names_its_initial_branch`, a static sweep of every `git init` in the package;
- `test_the_conformance_corpus_is_born_on_main_whatever_git_defaults_to`, run under an ambient `init.defaultBranch = trunk`.
Two places are outside the product and left as they are:
- `acceptance/at_r1_http.py:1774`'s `git init -q` is AT-R1's own fixture, not product code, and AT-R1 asserts nothing about the branch;
- `.github/workflows/release.yml` already uses `-b main`.
### Readings this PR takes, for the holder to rule on (inferred, not ruled)
1. **A registered host profile WITHOUT an instrument also outranks a declaration.** The repository is then `governed`, governed-without-an-instrument, and refused.
- 12.6a's precedence runs "the host, then main's declaration".
- T019 asserts "with the real host registered: no lander bound; the host outranks a declaration", and no production host declares an instrument in release 2.
- So host presence decides, the fail-closed reading. The other reading would bind a lander under a host on the strength of a file.
2. **The instrument's facet is named `SUBMISSION_INSTRUMENT`.** It is a factory `(checkout_root: Path) -> SubmissionPort`. The plan names the instrument ("its contributed `SubmissionPort`, declared in its host profile", R2Q4 (a)) but not the facet. `request_landing` calls the instrument's `submit(branch)`, the operation of T011's `SubmissionPort`, now in `session_pr`.
3. **No `main` is `unknown` even under a host.** A flag/setting disagreement on the install mode is `unknown` in every mode. Both are checked before the host.
4. **"Clean" is git's own sense, untracked files included.**
- With several remotes and none named `origin`, each remote's `main` is checked.
- An `ls-remote` that fails is refused: it cannot be verified, so it fails closed.
5. **A confirmation is spent by the first presentation that finds it**, even if the landing then refuses. Under `governed` with an instrument, the routed submission still requires and spends one.
6. **FR-004a's "exactly those three arguments" is read as the argv the guard admits.** CONFIRMED by the holder (openxFactory#656 `6026275158`).
- The two settings that could turn that fast-forward into a merge (`pull.twohead`, `branch.main.mergeOptions`) are pinned in the command's environment, not its arguments. The command git runs is still `git merge --ff-only <commit>`.
- Unpinned, a repository's own configuration can make that command create a merge commit, or stage a squash and move nothing.
7. **`--attr-source` needs git 2.42, above the plan's stated floor of 2.31.** On an older git, `land` is refused by name (`merge-failed`, naming 2.42), as data-model.md § Landed says, and nothing is merged. Raised by lane 3's review R2; inferred, not ruled.
### Stated limits (Copilot's reviews and lane 3's R2; for the holder)
- **Neither fast-forward can hold `main` across the check and the move.** The holder WIDENED this limit to both paths (openxFactory#656 `6067853207` item 3, for Codex P1 `4223462529`).
- The reads (the guard's, and `land`'s check of `main`'s tip) and `git merge --ff-only <commit>` are separate git processes. git has no lock that a separate process can hold across them, and holding the served `index.lock` would also stop the fast-forward.
- On the served path, a switch of the served checkout by its own user in that window fast-forwards the branch it switched to. The post-check refuses rather than report a landing (`test_a_served_checkout_switched_during_the_fast_forward_is_never_reported`).
- On BOTH paths, another local git process that rewinds `main` to an ancestor of the merge commit in that window is undone, and the landing reports success.
- On the `left` path, git refuses `main` to every other working tree while the landing worktree holds it.
- A ref update made outside any working tree is not refused.
- `merge --ff-only <commit>`, the one move feature 007 admits, has no compare-and-swap form. `update-ref refs/heads/main <merged> <main>` on the `left` path is not adopted: it would reverse the "`main` never moves by its ref alone" design (Copilot's second review; mutant L15).
- It is a race between the operator's own local processes, not a payload.
- **A checkout path ending in a newline or a carriage return cannot land** (Copilot `4223441552`, the same defect as Codex P2 `4223462534`). ACCEPTED as a limit by the holder (openxFactory#656 `6067853207` item 1).
- `checked_out_at` reads `%(worktreepath)` line by line, so the path comes back altered, and `land` refuses as `main-checked-out-elsewhere`.
- It fails closed, and the served-`HEAD` guard still refuses any move of the wrong branch.
- The governance reading does take such a path (`test_a_checkout_whose_path_ends_in_a_newline_is_read`).
- **One refusal can print a branch name unescaped** (Copilot `4223441643`). ACCEPTED as a limit by the holder (openxFactory#656 `6067853207` item 2).
- `fast_forward_served`'s post-check refusal names the branch the served checkout holds, as it is.
- It is reachable only after a concurrent switch to a branch whose name holds a bidi or format character, and it can only reorder how the message displays.
- **Clean, smudge and process filters run during the landing's checkouts** (Copilot 4199664554). ACCEPTED as a limit by the holder (openxFactory#656 `6026622117` item 1).
- A filter's command comes from git's configuration, not from the repository's content. Disabling filters would write a different working tree: LFS pointers in place of their content.
- A filter runs during `land` as it runs during the owner's own `git checkout`. The landing's merge still takes attributes out, so no filter decides a conflict.
- **The static issuer check reads source, so a deliberately dynamic reach can pass it** (lane 3's review R2, finding 6). ACCEPTED as a limit by the holder (openxFactory#656 `6035797819`).
- `getattr` or `importlib` written to evade the check is a deliberate structural edit of reviewed openDox code. It is the class of `6028383410` and `6028539440`, which 12.6a's in-process limit for deliberate code covers.
- Implicit string concatenation is caught.
- **A git older than 2.31 with a remote attached is refused as `remote-unreadable`, not by the named 2.42 floor** (lane 3's review R2-DELTA, `landing.py:836`). ACCEPTED as a limit by the holder (openxFactory#656 `6069024568` item 1).
- Such a git ignores `GIT_CONFIG_COUNT`, so the transient-remote probe fails before the merge's floor refusal is reached, and that refusal tells the user to fix or remove the remote.
- It fails closed: nothing is merged and `main` is where it was. Without a remote, the same git gets `merge-failed` naming 2.42. Only the message's precision is affected.
- **The instrument receives a branch name.**
- `SubmissionPort.submit(branch)` is T011's signature (12.1).
- The head is read again immediately before `submit`, but an adapter that reads the branch later can still see a newer head.
- Carrying the confirmed object id needs that interface to change, which is T011's or a later task's.
### What is NOT done here
- **T016:**
- `landing_factory` and `_landing_port`;
- the `land` verb, its routes and `actions.land`;
- the confirm control;
- the surface nodes in this test file;
- a live session ending by the merge observation (`branch_session.py`).
- **Later tasks:** T017 (the CI floors: this PR raises SELECTED and PASSED, and skips nothing) and T018 (the README).
### Files changed
- `src/opendox/landing.py` (new)
- `src/opendox/landing_confirm.py` (new)
- `src/opendox/session_pr.py` (the re-exports only)
- `src/opendox/session_git.py` (T013)
- `src/opendox/conformance_corpus.py` (the audit's two sites)
- `tests/test_landing_guardrails.py` (new)
- `tests/test_session_git.py` (T013)
🤖 Generated with [Claude Code](https://claude.com/claude-code)
Arc: neutral-product-standalone-operability
Lane: openxfactory-4 (openXfactory-4-openDox_extraction)
Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Lane: openxfactory-4 (openXfactory-4-openDox_extraction)
Arc: realize-doc-health-direction-arc
T072:
opendox.lines, openDox's own line rule and HEAD read (plan 038)Refs opensoft/openXfactory#656 (stays OPEN).
realize-doc-health-direction-arc("Re-author the generic slice"; itsdesign.md§ 3). This is a realization landing of that change (design.md§ 8), so it carries that change'sArc:line and noArc: neutral-product-standalone-operabilityline. It realizes no #1144 box.tasks.md2.1): the module's own tests, including the round trip over CR, LF, CRLF, no final newline, mixed endings, form feed and U+2028, AND explicit boundary assertions that ONLY CR, LF and CRLF split rows; openDox-code's whole suite as its requiredvalidatejob runs it, green.6003918488). Decisions: ARC-6 (6013547504). Ratified: T071, Brett Heap's word "Ratify it (Recommended)" (6023375303). Holder rulings on this task's two scope questions:6023517122(head_sha(a), the line split (a), Files).What it adds
src/opendox/lines.py(new), standard library only (os,re,subprocess).split_keepends(text) -> [(body, ending)]andjoin_rows(rows), with the behaviour of openxFactory'sscripts/doc_health/lines.py:111and:132:join_rows(split_keepends(t)) == tfor everyt;head_sha(repo), the one read openXdox-code'sgenerator.py:128takes fromRealGit, mirroringRealGit.head_shaexactly (scripts/doc_health/corpus.py:417,:424-431,:739-741at openxFactory9171d14a):["git", "-C", str(repo), "rev-parse", "HEAD"], and the call iscapture_output=True, text=True, timeout=30;OSErrorgivesNone, a non-zero exit givesNone, and an empty answer givesNone;"", asRealGit'sout.strip() if out else Nonereads it. No git prints a blank answer forrev-parse HEAD; it is pinned so T074's retarget changes nothing.tests/test_lines.py(new), 123 cases, none skipped,--noconftestsafe.a\rb,a\nbanda\r\nbeach give two rows.str.splitlines()breaks on is named, and each leavesa<sep>bONE row: VT\v, FF\f, FS\x1c, GS\x1d, RS\x1e, NEL\x85, U+2028 and U+2029.str.splitlines()really breaks on, measured over every code point. One text holding every code point but CR and LF is one row.join_rowson its own. A test also shows that the round trip alone cannot tell this rule fromstr.splitlines(keepends=True)(design.md§ 3).a, CR, LF, FF, U+2028} read as an independent character-by-character reading of the rule reads them. Each round-trips and has the rows' shape.head_shaon real temporary repositories, and every way it degrades.Nonefor a non-repository, an unborn HEAD (git printsHEADand exits 128), a path that is not there, nogitonPATH, a timeout, a git that cannot start, a non-zero exit, and an empty answer.RealGit's, and any other error propagates.serve._head_of(6023517122): the two agree on a repository, an unborn HEAD and a non-repository. This is the drift guard while two copies exist.import opendox.linesloads the standard library and no other module of openDox, and its public names are the three.The falsifier, run (red first)
Red, with
src/identical tomain(the module moved out of the tree), and this branch's test file:Green, at the final head
2ab7c4ad,.[runtime,test]under the constraints file, Python 3.12.3,CI=true:The round trip alone does not fail a
splitlinesrule; the boundaries do (design.md§ 3). This was measured with mutant M06 below applied, where the split isstr.splitlines(keepends=True):Mutants: 33, all killed
Each mutant replaces one exact string in
src/opendox/lines.py(the needle occurs once), runstests/test_lines.pywith-x, records the first failing node, and restores the file byte for byte (sha256e11c714c…before and after). The run below is against the final head's test file,2ab7c4ad; it is line for line the same as the run ate4920717.The whole suite, as CI runs it
CI's
validatejob at the final head2ab7c4ad(run 37552064211, job 112569631082). It ran on the merge reff0380f7, which is2ab7c4admerged intomaind616da3e, so T104 was included:At
d1268f58(run 37546933980, job 112553070043), CI read the same triple. This change adds 123 cases and no skip, soEXPECT_SKIPPEDstays 11, and the floors are not moved. The local replicas of the job were stopped at the holder's word, because CI's triple answers the gate.How the head moved
e4920717: T072, the module and its tests.d1268f58: mergedorigin/maina7a1c4d3(T014, T014: submission_factory and _submission_port, defaulting to LocalGitSubmissions (plan 038) #93), as a merge commit with no rebase. T014 changedserve.pyandtests/test_submission_default.py.serve._CheckoutHeadandserve._head_of, which the parity test reads, are byte-identical before and after it.2ab7c4ad: SonarCloud's four findings folded (below).src/opendox/lines.pyis unchanged. The diff againstmainis still the two files.SonarCloud: 0 open new issues at the final head
At
d1268f58SonarCloud reported four new MAJOR code smells, all intests/test_lines.py, and2ab7c4adfixes them:python:S9073, twice: two composite assertions joined withandare split into separate assertions.python:S8993, twice: the parity test no longer looks fixtures up withrequest.getfixturevalue(). Two plain functions build the repository and the unborn HEAD, and the fixtures and the parity cases both call them.At
2ab7c4adall four readCLOSED, and the quality gate isOK: every new-code rating is 1, duplication is 0.0, hotspots reviewed is 100.0, and there are 0 hotspots.Copilot: three reviews, 0 threads
e4920717: "Approval recommended", "Findings: None".d1268f58: "Approval recommended", "Findings: None".2ab7c4ad(review5436081242): "Needs a closer look", "Findings: None", 0 inline threads. Its body lists two "Previously missed" items in code unchanged sincee4920717. Each has a proposed class under the convergence rule (openDox + openXdox: two open-source layers, an installable app with users, projects and a database; domain descendants pin openXdox (Brett's ruling 2026-09-04) openXfactory#6565988818366), for the holder to rule at READY. Neither is a bypass, so neither forced a push.os.fspath(repo)rather thanstr(repo)(lines.py:89). The annotation admits anyos.PathLike[str], andstr()of anos.DirEntryis not its path.str(repo)isRealGit._run's own spelling, which the holder's ruling6023517122says to mirror.RealGitandserve._head_oftake (strandpathlib.Path), both spellings give the same argv. T074's retarget passesPath(repo), and no caller in the estate passes another path-like.TypeErrorwhereRealGitwould run git on itsstr().""return for a blank answer (lines.py:87).test_a_blank_answer_is_read_as_realgit_reads_it, and stated in that test's docstring and in "What it adds" above.rev-parse HEAD.The module's name
src/opendox/lines.py, the brief's default, so T074's retarget of openXdox-code'scompleteness.py,round_trip.pyandgenerator.pyis a one-word import change. Measured free at84f8ed83and again at09b8d44a:linesoropendox.linesin openDox-code;src/opendox/__init__.py;Two existing private helpers stay as they are (
6023517122)serve._CheckoutHead.head_sha(src/opendox/serve.py:964-983, plan 034 T012) makes the same read.serve.pyis single-writer (T014 → T015 → T016 → T052 → T057) and is not edited here. The parity test above holds the two together. Folding_CheckoutHeadontolines.head_shais an unscheduled, optional follow-on for a later owner ofserve.py, and neither T072 nor the arc owes it.doxbench_defaults._REAL_LINE_END(src/opendox/doxbench_defaults.py:67) splits on CR, LF and CRLF for oneStatus:read, without endings. It is untouched. Moving it ontosplit_keependsis unscheduled and optional, owed by no one.No guard needed an entry
Every package guard scans the files on disk:
tests/test_consumer_reach.py's derived whole-package record;tests/test_imports_standalone.py;tests/test_reach_sweep.py;tests/test_hermeticity.py;tests/test_provider_boundary.py;tests/test_projection_seams.py;tests/test_edit_action_one_entry.py.tests/fixtures/web_boundary_census.yamlcovers onlyweb/. No census, guard or boundary file is edited.Files changed
src/opendox/lines.py(new).tests/test_lines.py(new).What is NOT done here
completeness.py,round_trip.pyandgenerator.py's generic half onto this module, and the seams.opendox @pin, which are #1144's landings under #1144's trailer. Otherwise the arc brings its own. T061 never waits for it.lines.py. It would need openxFactory, so it belongs in the composed run, not in openDox-code's own suite (design.md§ 3).🤖 Generated with Claude Code