test_a_symlinked_source_file_contributes_no_file_doc

Tests › tests/test_external_provenance.py

passed Passed in the packaged run.

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

  1. outside = tmp_path / "outside" / "leak.c"
  2. outside.parent.mkdir(parents=True)
10 more
  1. outside.write_text("/** @file\n * SENTINEL-FILEDOC-LEAK\n */\n", encoding="utf-8")
  2. repo = tmp_path / "repo"
  3. repo.mkdir()
  4. (repo / "leaked.c").symlink_to(outside)
  5. db = tmp_path / "clew.db"
  6. conn = sqlite3.connect(str(db))
  7. conn.execute("CREATE TABLE path (name TEXT PRIMARY KEY, type INTEGER NOT NULL)")
  8. conn.execute("INSERT INTO path (name, type) VALUES ('leaked.c', 1)")
  9. conn.commit()
  10. conn.close()
→

When

  1. ingest_file_docs(db, repo)
  2. conn = sqlite3.connect(str(db))
  3. docs = conn.execute("SELECT file_path, doc FROM file_docs").fetchall()
  4. conn.close()
→

Then

  1. ✓ 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)

  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

test_a_symlinked_source_file_contributes_no_file_doc→ingest_file_docs

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.

test_a_symlinked_source_file_contributes_no_file_doc · 1 checksingest_file_docs_collect_file_docsmemoizedREQ-DDB-INDEX-002 · inferredingest_file_docsREQ-DDB-PIPE-008 · measuredingest_file_docs_collect_file_docswithin_repoREQ-DDB-PIPE-014 · measuredingest_file_docsensure_file_docs_tableREQ-DDB-SCHEMA-014 · measured
Also reaches 4 requirements

Its run touches their code; that is reach, not proof.