Skip to content

test: read shared registry data from a declared root - #7

Merged
lusoris merged 3 commits into
mainfrom
fix/data-root-tests
Oct 23, 2026
Merged

lusoris merged 3 commits into
mainfrom
fix/data-root-tests

Conversation

@lusoris

@lusoris lusoris commented Oct 23, 2026

Copy link
Copy Markdown
Contributor

Six tests read shared registry data this repository does not hold. They now read it from the directory that KNOWLEDGE_DATA_ROOT names. Without the variable each one skips with a reason starting knowledge data root absent:, instead of failing on a missing path.

Tests that read the data root

  • tools/knowledge-retrieval: TestMultidomainBindingClosureDeterministicNineClose, TestMultidomainBindingClosureFailsClosed (acceptance data under knowledge/registry/acceptance/p1-src-03), TestGoldSpanLaneRanks, TestMineSeparatingCaseShapes (multidomain evaluation suite).
  • tools/knowledge-registry/p1-src03-acquisition-runner: TestExecutionManifestBindsExactRepositoryBytes and the schema part of TestP1SRC02RunnerAndSchemasRemainByteIdentical (registry schemas).
  • The seven runner pins of TestP1SRC02RunnerAndSchemasRemainByteIdentical read repository files and run with or without the data root.

Behaviour

  • Unset or blank KNOWLEDGE_DATA_ROOT: named skip.
  • Set to a directory that lacks an expected file: the test fails and names the path; it never skips.
  • Manifest artifacts outside knowledge/registry/ are read from the repository only; a missing repository file fails with its path.

Verification

  • Planted helper tests in both modules: unset root skips with the prefix, an empty root fails, a root with fixture files passes.
  • Planted execution-manifest tests use a synthetic artifact in temporary roots: missing from the repository fails even when the data root holds it, present with the right digest passes, a wrong digest fails. Restoring a data-root fallback turns the first one red.
  • Without KNOWLEDGE_DATA_ROOT: both modules pass the touched tests, 6 named skips.
  • With a full data root: knowledge-retrieval passes all touched tests; p1-src03-acquisition-runner passes everything except the canonical JSON vectors read, which the adoption change adds. With those vectors in place both modules pass the touched tests (36 and 35).
  • With an empty data root the six tests fail and name the missing files.

The README note on these tests describes the variable.

Read shared registry data from the directory declared by the
KNOWLEDGE_DATA_ROOT environment variable across knowledge retrieval and
registry acquisition runner tests.

When KNOWLEDGE_DATA_ROOT is unset or empty, tests that depend on shared
schemas or acceptance fixtures skip with the fixed prefix
"knowledge data root absent:" followed by the test purpose. When the
variable is set to a directory lacking expected files, the tests fail
with the missing file path. The frozen P1-SRC-02 runner pins always
execute, with only its four schema pins depending on the root.

Touched tests:
- tools/knowledge-retrieval:
  - TestMultidomainBindingClosureDeterministicNineClose
  - TestMultidomainBindingClosureFailsClosed
  - TestGoldSpanLaneRanks
  - TestMineSeparatingCaseShapes
- tools/knowledge-registry/p1-src03-acquisition-runner:
  - TestExecutionManifestBindsExactRepositoryBytes
  - TestP1SRC02RunnerAndSchemasRemainByteIdentical

Order: engine-knowledge-monorepo-test-data-20261023
Signed-off-by: lusoris <lusoris@proton.me>
Enforce that execution manifest artifacts with repository logical paths
are read strictly from the repository root, failing immediately with the
missing file path when absent.

Previously, an else-if fallback in
TestExecutionManifestBindsExactRepositoryBytes silently substituted
missing repository files with copies located under the data root,
allowing missing repository files to pass the digest check (review
finding F1).

Logical paths prefixed with knowledge/registry/ continue to be read from
the data root. Every other logical path is verified against the
repository only.

Touched:
- tools/knowledge-registry/p1-src03-acquisition-runner/runner_test.go:
  - verifyExecutionArtifact: read repository artifacts only from repo
  - TestExecutionManifestBindsExactRepositoryBytes: call helper
  - TestExecutionManifestPlantedRepositoryArtifactMissingFails: planted

Order: engine-knowledge-monorepo-test-data-20261023
Signed-off-by: lusoris <lusoris@proton.me>
Plant execution manifest repository artifact tests using synthetic
in-memory artifacts and isolated temporary directory roots, removing all
dependencies on repository tree state and the embedded gzip payload.

Previously, TestExecutionManifestPlantedRepositoryArtifactMissingFails
relied on findAbsentRepositoryArtifact to locate an artifact in the
manifest that happened to be absent from the repository worktree, and
embedded a gzipped copy of conformance vectors to seed the data root.
Adding those conformance vectors to the repository broke the test,
and the embedded gzip copy was irrelevant to the missing-path check.

Synthetic artifacts now define their own path, sha256 digest, and size
over a short text payload. The missing-artifact test verifies that an
artifact present only in the temporary data root still fails against an
empty repository root, naming the expected repository path. A companion
test verifies that matching bytes in the repository root pass, while
altered bytes fail with an artifact drift error.

Touched:
- tools/knowledge-registry/p1-src03-acquisition-runner/runner_test.go:
  - syntheticPlantedArtifact: generate synthetic artifact and bytes
  - TestExecutionManifestPlantedRepositoryArtifactMissingFails: plant
    synthetic artifact in temporary roots
  - TestExecutionManifestPlantedRepositoryArtifactPresentOrDrifted:
    verify matching digest passes and drifted digest fails
  - drop findAbsentRepositoryArtifact, testCanonicalVectorsPayload,
    canonicalVectorsGZBase64, compress/gzip, io

Order: engine-knowledge-monorepo-test-data-20261023
Signed-off-by: lusoris <lusoris@proton.me>
@lusoris
lusoris merged commit a84a1ed into main Oct 23, 2026
2 checks passed
@lusoris lusoris mentioned this pull request Oct 23, 2026
5 tasks done
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.

1 participant