Repository navigation
Description
Measured 2026-11-17, while landing P06 leg 3 (charly's audit wiring) against sdk v0.2026321.810.
The design row. DESIGN.md:376 lists audit_append as a host method:
|
audit_append| appends one audit record (D-AUDIT) | always |
A host method is performed by the HOST — charly core — not by a plugin or a kit.
The layout rule. charly/AGENTS.md's IMPORT-PURITY gate states it:
charly/core importsspec/*+ proto only. The sdk mechanism kits are for PLUGINS, never the host.
So the two facts collide, and the gate proved it. Importing auditkit in charly/ core:
$ go test -count=1 ./... # TestImportPurity_HostImportsOnlySpecAndVettedThirdParty
--- FAIL: TestImportPurity_HostImportsOnlySpecAndVettedThirdParty (0.01s)
IMPORT-PURITY gate: 1 UNDECLARED github.com/opencharly/sdk import(s) in charly/ core
audit_event.go:27: forbidden import "github.com/opencharly/sdk/auditkit" — the sdk mechanism
kits (and the sdk root plugin-authoring package) are for PLUGINS, never the hostsdk/auditkit (opencharly/sdk#550, merged as v0.2026321.810) is therefore unreachable from the only layer that can call it for a host method. That PR passed its own review — the defect is not in its code, it is in the LAYER CHOICE, which no gate in sdk could see because sdk has no host.
Why the interim existed, and why it was flagged. Before the tag, charly carried a local JSON-Lines appender, and the validator correctly called it SHOULD-BE-sdk (ARCH). That finding was right about the mechanism and wrong about the destination: moving it to sdk satisfies ARCH and violates IMPORT-PURITY. The two gates point in opposite directions because the writer sits between them.
The three candidate resolutions, with their costs:
- Move the writer to
spec/auditkit.specis core-importable, already hostsstoreroot(the same shape: one implementation of a cross-cutting concern that the host must perform), andsdkcan re-export it exactly assdk/storekitre-exportsspec/storeroot. This is the smallest change and it matches the existing precedent. - Declare it in
residualSDKImportSiteswith a named exit — but that list is debt with an expiry, and adding a NEW permanent dependency to it is the thing the gate exists to prevent. - Route the append through a plugin — but the recorder must be the layer that PERFORMS the act, and a plugin round-trip inside a mutation is the double-record risk D-AUDIT-1 forbids.
I would take (1), and I am not doing it unilaterally because moving a package between contract layers changes who owns it.
Until then P06 leg 3 stays closed: the wiring is correct and proven (three records for three acts, none for deploy add), and it cannot be completed against a package the host may not import.
Agent: lead
Assisted-by: DeepSeek Harness ollama-cloud/deepseek-v4.1-flash (fully tested and validated)
Activity