Skip to content

Commit 794ecc0

Browse files
committed
Merge FEATURE-ci-audit-fixture-paths: Canonicalize audit fixture identities
2 parents 54fa6aa + 0f10b51 commit 794ecc0

2 files changed

Lines changed: 82 additions & 1 deletion

File tree

‎scripts/test-v3-installed-package.py‎

Lines changed: 24 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -88,7 +88,7 @@ def setUp(self):
8888
os.environ.pop('V3_PACKAGE_TOOLCHAIN', None)
8989
self.tmp = tempfile.TemporaryDirectory()
9090
self.addCleanup(self.tmp.cleanup)
91-
self.root = Path(self.tmp.name)
91+
self.root = Path(self.tmp.name).resolve()
9292
self.policy = audit.load_policy()
9393

9494
def graph(self, links):
@@ -506,5 +506,28 @@ def test_current_umbrella_has_no_backend_types(self):
506506
self.assertEqual([], audit.header_violations(result, []))
507507

508508

509+
class AuditFixturePathTest(unittest.TestCase):
510+
def test_unwind_contract_under_symlinked_temporary_root(self):
511+
original_tempdir = tempfile.tempdir
512+
original_environment = dict(os.environ)
513+
with patch.object(tempfile, 'tempdir', original_tempdir), tempfile.TemporaryDirectory() as outer:
514+
target = Path(outer).resolve() / 'real-temp'
515+
target.mkdir()
516+
alias = target.parent / 'alias-temp'
517+
alias.symlink_to(target, target_is_directory=True)
518+
case = AuditTest('test_selected_unwind_still_inspects_hashes_and_rejects_transitive_provider')
519+
result = unittest.TestResult()
520+
with patch.object(tempfile, 'tempdir', str(alias)):
521+
case.run(result)
522+
self.assertEqual(1, result.testsRun)
523+
self.assertTrue(result.wasSuccessful(), result.errors + result.failures)
524+
self.assertFalse(result.skipped)
525+
self.assertNotEqual(Path(case.tmp.name), Path(case.tmp.name).resolve())
526+
self.assertFalse(Path(case.tmp.name).exists())
527+
self.assertTrue(alias.is_dir())
528+
self.assertIs(original_tempdir, tempfile.tempdir)
529+
self.assertEqual(original_environment, dict(os.environ))
530+
531+
509532
if __name__ == '__main__':
510533
unittest.main()
Lines changed: 58 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,58 @@
1+
# FEATURE-ci-audit-fixture-paths: canonical audit fixture roots
2+
3+
Status: Complete (local implementation, Groundwork validation and finalization).
4+
Base: `v3` at `54fa6aae23ee91db861a9802f27d2dac9c28ed2c`.
5+
6+
Mac package job120420002071 and archiveDarwin job120420935245 both failed
7+
`test_selected_unwind_still_inspects_hashes_and_rejects_transitive_provider`
8+
with a `/private/tmp/.../consumer` dictionary lookup error. The audit correctly
9+
canonicalizes graph identities, while the fixture built its keys from an
10+
unresolved `/tmp` directory. `AuditTest.setUp` now resolves its temporary root
11+
before constructing paths, matching the existing `CompileProbeTest` fixture.
12+
13+
Action items:
14+
15+
- [x] Create the isolated Groundwork worktree from the recorded v3 head;
16+
preserve the bauth worktree and all prior closed repairs.
17+
- [x] Preserve both original native CI logs and reproduce the actual original
18+
test entrypoint locally through a real symlinked temporary root before edits.
19+
- [x] Add a durable regression that runs the original unwind contract through
20+
a real temporary directory alias; observe its canonical lookup failure first.
21+
- [x] Canonicalize only the fixture root. Preserve production audit code and
22+
all 40 original test bodies, including inspection, hashes, transitive provider
23+
rejection, missing dependency rejection, prefix negatives and symlink escapes.
24+
- [x] Keep tempfile selection and environment restoration scoped; run nested
25+
fixture cleanup before deleting its outer alias directory. Check restoration
26+
even when the tempfile cache started uninitialized.
27+
- [x] Run the regression, original entrypoint, complete affected module and
28+
focused alias cases; run changed-file Python compilation and diff checks.
29+
- [x] Retain raw RED/GREEN commands, logs and journal under root
30+
`.debug/FEATURE-ci-audit-fixture-paths/`.
31+
- [x] Caller: Groundwork validation and local finalization into v3; three reviewers approved with zero findings.
32+
- [ ] CI / v3 PR: native Mac package and selected-archive execution.
33+
34+
Local verification: all 41 affected module tests pass (all original 40 plus
35+
the alias regression). Six additional focused cases pass under a real symlinked
36+
temporary root: the original unwind contract, canonical selected-directory and
37+
numeric-name negatives, graph cycle/alias edges, installed header escape, and
38+
both compiler probe contracts. The original entrypoint also passes with the
39+
same reproduction driver that failed before the fix. AST comparison confirms
40+
all original test methods are unchanged; production audit bytes are unchanged.
41+
Changed-file `py_compile` and `git diff --check` pass. Python scripts have no
42+
documented standalone linter; no C++ files changed.
43+
44+
The regression uses real directory symlinks and the original test case through
45+
unittest, replacing only temporary-root selection. It does not mock path
46+
resolution, skip original contracts, or alter runtime policy. The Linux host
47+
supports these symlinks. Local fixture execution is not native Mac package or
48+
archive proof; those gates remain incomplete and CI / v3 PR owned under AGENTS.
49+
50+
No broad native baseline, CI rerun, validation loop, merge or publication was
51+
performed. Older Linux parity causality remains UNCERTAIN after its previously
52+
closed bounded diagnosis; no additional investigation was run. Closed entropy,
53+
selected LLVM unwind policy, and prior consumer alias findings remain unchanged.
54+
55+
Project notes: Autotools/C++20 builds require bootstrap and out-of-tree configure
56+
and make; this fixture-only change needs no dependency installation. Tests use
57+
Python unittest and the available C++ compiler. Worktree identity came verbatim
58+
from the Groundwork helper; Git metadata writes required sandbox escalation.

0 commit comments

Comments
 (0)