test_a_symlinked_source_file_contributes_no_file_doc¶
Tests › tests/test_external_provenance.py
What this test is for
Why it exists
The second half of H2. `filedocs` reads `repo_root / rel` for every INDEXED file, so a symlinked `.c` whose target lives outside the tree has its docblock extracted and served as that path's file documentation. The path list comes from the index, so this one is reachable even where the prose globs are not.
Given
outside = tmp_path / "outside" / "leak.c"outside.parent.mkdir(parents=True)
10 more
outside.write_text("/** @file\n * SENTINEL-FILEDOC-LEAK\n */\n", encoding="utf-8")repo = tmp_path / "repo"repo.mkdir()(repo / "leaked.c").symlink_to(outside)db = tmp_path / "clew.db"conn = sqlite3.connect(str(db))conn.execute("CREATE TABLE path (name TEXT PRIMARY KEY, type INTEGER NOT NULL)")conn.execute("INSERT INTO path (name, type) VALUES ('leaked.c', 1)")conn.commit()conn.close()
When
ingest_file_docs(db, repo)conn = sqlite3.connect(str(db))docs = conn.execute("SELECT file_path, doc FROM file_docs").fetchall()conn.close()
Then
- ✓ any("SENTINEL-FILEDOC-LEAK" in doc for _, doc in docs) is false
tests/test_external_provenance.py:566 · its file's page
What it checks (1)
assert not any("SENTINEL-FILEDOC-LEAK" in doc for _, doc in docs), ( f"an outside file was read as an in-repo file's documentation: {docs}" )not attributed
Where the product reaches it
No product flow reaches this code: no product entry point's flow calls any of the functions this test calls.
Call flow
What it reaches
Each row runs from this test, through the calls it makes, to the code a requirement names. If that code breaks, the test's checks are what should catch it. Reaching is not proving: a check only proves what it observes. No mutation records were given, so these rows say what the test REACHES.
Also reaches 4 requirements
Its run touches their code; that is reach, not proof.
- REQ-DDB-INDEX-002 inferred
- REQ-DDB-PIPE-008 measured
- REQ-DDB-PIPE-014 measured
- REQ-DDB-SCHEMA-014 measured