Memory CI
Compare explicit base/head knowledge snapshots using approved syn verify --deep
and syn state verify --profile contracts. The POSIX runner supports macOS/Linux
and requires Python 3.10+, Git, an approved
native Synapse binary and explicit existing Git knowledge workspaces. No models,
connector, daemon or mandatory account is needed for local/basic verification.
The executable SHA-256 and exact raw policy-file SHA-256 are independently reviewed pins. They are not taken from a PR-controlled manifest. Review the executable’s release/source authenticity separately; a matching hash alone does not establish it. Use this runner/action from a reviewed immutable revision, not PR-edited runner code.
python3 tools/memory-ci/memory_ci.py \
--binary /approved/bin/syn --binary-sha256 <reviewed-executable-sha256> \
--policy /approved/memory-policy.json --policy-sha256 <reviewed-raw-file-sha256> \
--base /prepared/base --base-revision <exact-base-40hex-sha> \
--head /prepared/head --head-revision <exact-head-40hex-sha> \
--output /private/artifacts/memory-ci
policy.basic.json is an explicit example, not an implicit default. It requires
INV-1 and deep INV-13, permits honest legacy receipt/witness gaps and does not prove
general semantic truth. All deterministic Fail results deny the current head,
including pre-existing failures; the diff describes changed evidence for review.
Policy fields: schema, profile (basic, strict-local, strict-team),
required_invariants, required_surfaces, max_snapshot_bytes, max_report_bytes,
timeout_ms. Unknown fields, floats, duplicate requirements and wrong pins deny.
Surfaces: storage, transitions, receipts, trust_freshness, identity, witness.
Strict profiles add their native mandatory surfaces even if the list is empty.
Required Skip/Partial/missing/Fail deny. Strict-team currently denies missing complete
team authority/source integration; a separately verified historical grant does not
silently enable the profile. A passed basic result keeps strict_requirements_met:false.
External --base-evidence / --head-evidence optionally name JSON descriptors with
absolute public-file paths and independent pins:
{
"trust": "/approved/local-public-trust.json",
"trust_sha256": "<normative-trust-sha256>",
"witness": "/independently-retained/state-witness.json",
"witness_key": "<canonical-public-key-base64>",
"audit_witness": "/independently-retained/optional-audit-witness.json"
}
Omit unused fields. Trust and witness keys are never inferred from workspace or
receipt contents. Base/head witnesses may differ; each describes its own retained
range. A new limited baseline leaves earlier history unknown, including a legacy
base. Different initialized governed GUIDs deny rather than comparing unrelated
ledgers. same_governed_namespace:null means legacy/new-baseline identity comparison
was unavailable, not that namespace equality was proven.
The runner validates Git HEAD labels, freezes the executable, copies bounded raw Markdown/control metadata into private snapshots, backs up an existing SQLite index read-only, and checks source hashes/ref stability. Symlinks, private key files, interrupted source transactions and exceeded budgets deny. It never recovers the original workspace. A missing disposable index is rebuilt only inside the copy; a mismatching existing index is reported, not repaired. Caller source files and accepted evidence stay unchanged. The raw snapshot digest includes files not necessarily tracked by Git; it is separate from the Git label/logical projection.
Outputs: report.json and comment.md, outside both source workspaces. Reports
separate deterministic checks, raw source/drift, declared baseline range, receipts,
trust, identity and witness. They export aggregate fingerprints/status/reason codes,
not native evidence text, titles, fact ids, raw source paths or source contents.
Current INV-13 aggregate output is bounded to 50 details by the native verifier;
a changed fingerprint is labelled new/changed aggregate evidence, not invented
individual findings. SYN-319 adds the finer typed diagnostic surface separately.
INV-13 checks indexed structured temporal facts; assertions in unindexed/malformed
documents are not semantically assessed. Raw source hashing does not supply that
missing assessment. General natural-language truth, opaque agent attention and unobserved revocations
remain excluded. No automatic repair or comment posting occurs.
The composite action .github/actions/memory-ci accepts the same inputs, displays
its redacted preview in the step summary and retains only these artifacts for seven
days. Call it under contents: read; it needs no pull-request write permission.
Install/verify the approved binary and stage snapshots/trusted inputs yourself.
No private-repository credential is introduced by this action. A separate caller
may post a reviewed preview only under its explicitly configured permissions.
Required repository native test/pre-push gates run:
python3 scripts/check-native-contracts.py
This shared CI/pre-push runner builds syn and the native rejection core probe
with all features, then runs the 15 guarded rejection cases and Memory CI tests.
Cargo metadata selects the configured target directory, including a custom
CARGO_TARGET_DIR; Cargo’s build messages supply the actual executable paths.
Python fixtures receive private HOME/XDG directories. Rust unit gates keep their
existing enrichment configuration. Empty suites, skipped required cases and
expected failures fail the native contract gate.
Real-binary cases cover partial legacy basic, required missing receipts, strict missing trust, signed strict-local migration/witness, unjournaled drift, introduced inverted validity, source immutability, wrong pins, pending transactions and symlinks. Adversarial runner cases cover malformed/oversized/timed-out outputs and invalid policies. Missing actual binary fails validation; tests never silently skip it.