Track target adapter ownership by digest - #117
Merged
Merged
Conversation
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
.loaf-target-manifest.jsonfiles for Claude Code, Cursor, Codex, OpenCode, and Amp build outputs, recording each managed artifact's destination, kind, mode, and SHA-256 digest.Why
Target-adapter ownership was implicit and target-specific. Installers could not consistently distinguish Loaf-owned generated content from foreign, modified, or stale files. Content-addressed manifests give each build a deterministic ownership contract so installation converges safely and refuses ambiguous or tampered state.
User impact
Install and upgrade operations can now prove which adapter artifacts belong to the current Loaf build before replacing or removing them. Foreign content, digest drift, mode drift, path escapes, symlinked destinations, and concurrent changes fail closed instead of being overwritten.
Validation
LOAF_VALIDATE_TYPESCRIPT=1 npm run buildnpm run testnpm run typecheckgo vet ./...go test ./internal/cli/ -run 'TargetAdapter|AdapterManifest|TestRunnerBuildRunsContentBuilderNatively|TestTargetCapabilityAdapters'render-drift,ephemeral-provenance,check-secrets,validate-commit, andsecurity-auditA redundant cache-cold
go test ./internal/... -count=1started by the reviewer was stopped after more than ten minutes of buffered silence; it produced no failure output and is not counted as a passing validation above.Non-blocking review observations
These low-severity observations are preserved for follow-up and do not block this change:
json.Unmarshal, while Codex uses the strict loader (internal/cli/build_manifest.go:240,300-324).decodeCodexHooksBodyStrictround-trips through a temporary file to reuse the file-based strict loader during read-only ownership inspection (internal/cli/build_manifest.go:300-324).internal/cli/build.go:417-419).versionmetadata, while Cursor removes empty arrays; this is content-safe shape drift (internal/cli/build_manifest.go:978-982,1009;internal/cli/install_target.go:117).plugins/loaf.tswould fall through beneathAmpPluginsDir; generated manifests cannot currently reach this path, and collision rechecks still protect it (internal/cli/build_manifest.go:708-717).