Skip to content

Pin evidence JSON files to LF - #711

Merged
justinchuby merged 2 commits into
mainfrom
justinchuby-pin-evidence-json-line-endings
Aug 31, 2026
Merged

justinchuby merged 2 commits into
mainfrom
justinchuby-pin-evidence-json-line-endings

Conversation

@justinchuby

@justinchuby justinchuby commented Aug 30, 2026

Copy link
Copy Markdown
Member

Summary

  • pin all JSON evidence under testdata/evidence/, including nested paths, to text eol=lf
  • refresh both hash-bound traces with semantics-preserving leading JSON whitespace so existing Windows worktrees receive new LF-normalized blobs
  • preserve future non-JSON evidence as unclassified so binary artifacts are not treated as text
  • validate effective attributes in an isolated temporary Git repository with system/global/caller-repository attribute sources excluded
  • regress metadata-bound LF bytes, simulated CRLF bytes, and canonical parsed-JSON semantics

Validation

  • draft evidence unit and integration guards: 4 passed, 2 skipped (opt-in real 16 GiB probes disabled)
  • evidence/artifact suite: 85 passed
  • lintrunner f --output oneline --all-files
  • git diff --check
  • exact-head GPT-5.6 Sol review: no significant issues

Evidence identities

  • dflash blob: bf42e00a181fa54a2fe6da19ae85c0c810b8c58f -> b2966dd06ae6daa5f5b764ebd8d12b74f8824d69
  • dflash LF: 1062e5ed665aeafbcf0d0fb250f9b48c520091ebc4b2ad6b19dbd341518c481f; simulated CRLF: e0e70e909f33ed44aa87da39bab721ebbee0c3e730e2f89dbc509c6683701e42
  • eagle3 blob: 9498c417c8a22cf1a387b7dbd801a8701df0cfae -> 9e02745b6f3b087dbdce4d5fc9d7ff224af0ba6b
  • eagle3 LF: 9d6c6fdb630bc0a040eacc2a2357a2991609ea0d904ff16574a9b55f7d010d55; simulated CRLF: 78aa94f24d5f1b9ae020de1ffa5a70c6a30f30ff45eb5310a540cdd2b3d8fab2

Follow-up

PR #698 must rebase this fix from main before its Windows jobs can pass.

Preserve byte-identical raw evidence hashes across Windows and POSIX checkouts by assigning LF normalization only to JSON evidence paths. Add an effective-attribute regression covering nested evidence, binary exclusions, and the known LF/CRLF trace digests.

Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
Signed-off-by: Justin Chu <justinchuby@users.noreply.github.com>
@justinchuby
justinchuby requested review from a team and a lite review from Copilot August 30, 2026 17:19
@github-actions

github-actions Bot commented Aug 30, 2026

Copy link
Copy Markdown

🏗️ Architecture Diff

Comparing dda71aaf6dd7e1

Model Sub-model Changes Status

No architecture changes detected.


Legend: ⚪ No change · 🔵 Minor (attrs/inits) · 🟡 Moderate (nodes added/removed) · 🔴 Major (interface changed)

@github-actions

github-actions Bot commented Aug 30, 2026

Copy link
Copy Markdown

Performance Comparison

Comparing dda71aaf6dd7e1

Model Metric Baseline Current Delta
bert (feature-extraction) model_size_bytes 359 KB 359 KB +0.0%
bert (feature-extraction) num_nodes 68 68 +0.0%
falcon model_size_bytes 364 KB 364 KB +0.0%
falcon num_nodes 66 66 +0.0%
gemma2 model_size_bytes 428 KB 428 KB +0.0%
gemma2 num_nodes 105 105 +0.0%
gpt2 model_size_bytes 324 KB 324 KB +0.0%
gpt2 num_nodes 54 54 +0.0%
llama model_size_bytes 425 KB 425 KB +0.0%
llama num_nodes 60 60 +0.0%
llama (static-cache) model_size_bytes 425 KB 425 KB +0.0%
llama (static-cache) num_nodes 56 56 +0.0%
mamba (ssm-text-generation) model_size_bytes 296 KB 296 KB +0.0%
mamba (ssm-text-generation) num_nodes 94 94 +0.0%
phi3 model_size_bytes 421 KB 421 KB +0.0%
phi3 num_nodes 58 58 +0.0%
phi3 (static-cache) model_size_bytes 421 KB 421 KB +0.0%
phi3 (static-cache) num_nodes 54 54 +0.0%
qwen2 model_size_bytes 425 KB 425 KB +0.0%
qwen2 num_nodes 60 60 +0.0%
qwen2 (static-cache) model_size_bytes 425 KB 425 KB +0.0%
qwen2 (static-cache) num_nodes 56 56 +0.0%
qwen3_5_moe (hybrid-text-generation) model_size_bytes 506 KB 506 KB +0.0%
qwen3_5_moe (hybrid-text-generation) num_nodes 265 265 +0.0%
qwen3_5_text (hybrid-text-generation) model_size_bytes 458 KB 458 KB +0.0%
qwen3_5_text (hybrid-text-generation) num_nodes 127 127 +0.0%
qwen3_5_vl (hybrid-qwen-vl) model_size_bytes 977 KB 977 KB +0.0%
qwen3_5_vl (hybrid-qwen-vl) num_nodes 450 450 +0.0%
t5 (seq2seq) model_size_bytes 836 KB 836 KB +0.0%
t5 (seq2seq) num_nodes 176 176 +0.0%
whisper (speech-to-text) model_size_bytes 1008 KB 1008 KB +0.0%
whisper (speech-to-text) num_nodes 128 128 +0.0%

No performance regressions.

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🟡 Changes recommended

The new regression test relies on git and assumes deterministic check-attr behavior; it should skip cleanly when Git/.git is unavailable and guard against system attribute influence/malformed output.

Once you've addressed the issues Copilot identified, you can request another Copilot review.

Pull request overview

Pins GGUF runtime evidence JSON under testdata/evidence/ to LF line endings via Git attributes, and adds a regression test to ensure both the effective attributes and the raw-hash evidence files remain stable across platform line-ending differences.

Changes:

  • Add .gitattributes rule to force testdata/evidence/**/*.json to text eol=lf.
  • Refactor evidence test path handling and add a new regression asserting effective Git attributes and LF-only payload bytes for hashed evidence traces.
File summaries
File Description
src/mobius/integrations/gguf/_draft_runtime_evidence_test.py Adds Git-attribute regression and raw LF/CRLF digest assertions for evidence trace payloads.
.gitattributes Pins all JSON under testdata/evidence/ to text eol=lf.
Review details
  • Files reviewed: 2/2 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.

Comment on lines +57 to +65
def test_evidence_json_files_are_lf_normalized_for_raw_hashes(tmp_path: Path) -> None:
global_attributes = tmp_path / "global-attributes"
global_attributes.touch()
evidence_json = sorted(_EVIDENCE_DIR.rglob("*.json"))
future_binary = _EVIDENCE_DIR / "future-evidence.bin"
attributes = _effective_git_attributes(
[*evidence_json, future_binary],
global_attributes=global_attributes,
)
Comment on lines +32 to +54
relative_paths = [path.relative_to(_REPO_ROOT).as_posix() for path in paths]
result = subprocess.run(
[
"git",
"-c",
f"core.attributesFile={global_attributes}",
"check-attr",
"-z",
"text",
"eol",
"--",
*relative_paths,
],
cwd=_REPO_ROOT,
check=True,
capture_output=True,
)
fields = result.stdout.decode("utf-8").split("\0")
assert fields[-1] == ""
attributes: dict[str, dict[str, str]] = {}
for path, attribute, value in zip(fields[0::3], fields[1::3], fields[2::3]):
attributes.setdefault(path, {})[attribute] = value
return attributes
Force new trace blobs so existing Windows worktrees refresh the evidence under the LF attribute contract. Preserve parsed JSON semantics, update exact byte hashes, and validate attributes in an isolated repository without global or system attribute influence.

Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
Signed-off-by: Justin Chu <justinchuby@users.noreply.github.com>
env=environment,
)
fields = result.stdout.decode("utf-8").split("\0")
assert fields.pop() == ""
@justinchuby
justinchuby merged commit f66b1c7 into main Aug 31, 2026
24 of 25 checks passed
@justinchuby
justinchuby deleted the justinchuby-pin-evidence-json-line-endings branch August 31, 2026 17:44
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants