Skip to content

feat(core): select Project Profiles at runtime - #72

Merged
siracusa5 merged 2 commits into
mainfrom
codex/project-profiles-runtime-selection
Jul 29, 2026
Merged

feat(core): select Project Profiles at runtime#72
siracusa5 merged 2 commits into
mainfrom
codex/project-profiles-runtime-selection

Conversation

@siracusa5

Copy link
Copy Markdown
Collaborator

Summary

  • select exactly one Project Profile for resolver, MCP, batch writes, live capture, telemetry, cache identity, and promotion
  • add contextcake profile current/list/create/map/unmap/delete with locked migration and reference-only deletion
  • bind capture and promotion writes to manifest/layer identity, with machine-local promotion authority and resumable failure recovery
  • keep activeProfile local-only and return synced display labels as structured MCP metadata rather than instruction prose
  • document the shipped selection, privacy, promotion, and legacy-compatibility behavior

Acceptance evidence

  • explicit --profile wins over cwd; deepest canonical project mapping wins; unmatched cwd uses default
  • MCP list/search/read/link traversal cannot cross the selected stack
  • same-named cache and live layers remain profile-isolated
  • batch writes accept only selected non-live OKF targets and reject traversal and symlink escapes
  • capture/telemetry and promotion write only to the selected live/curated roots
  • staged writes reject manifest or layer changes; manifest mutation cannot race the local commit
  • promotion rejects symlink reads, reserved/duplicate metadata, editable binding substitution, commit failure, push-lock failure, and post-commit crash windows
  • cached foreign MCP children are drained and forcibly terminated when a harness disconnects
  • legacy flat manifests and explicit --legacy-paths compatibility remain green
  • original MCP read-tool schemas remain byte-identical

Adversarial review

Two independent attack passes found and drove fixes for unsafe batch destinations, symlink side effects, self-authored promotion bindings, revalidation races, destructive failure ordering, push retry/crash recovery, synced-label prompt injection, and foreign-child shutdown. Both reviewers completed a final closure audit with no residual blockers. The review record and resulting spec amendment are included in this PR.

Test plan

  • npm test
  • npm --prefix apps/desktop test — 34 tests
  • npm --prefix apps/console run typecheck
  • npm --prefix apps/site run build — 28 pages + install verification
  • git diff --check

Notes

This is Project Profiles PR2 of 5, following Manifest v2 trust-boundary PR #70. The engine service/profile-scoped configuration API remains intentionally deferred to PR3; the desktop/Console management UI remains PR4.

@siracusa5 siracusa5 added the enhancement New feature or request label Jul 29, 2026
@siracusa5
siracusa5 force-pushed the codex/project-profiles-runtime-selection branch from fa91a82 to 421d3d1 Compare July 29, 2026 06:40
siracusa5 and others added 2 commits July 29, 2026 03:08
Signed-off-by: John Siracusa <siracusa5@users.noreply.github.com>
runProfilePromotion held the shared manifest lock for the entire
approve step, including the git push at the end. The manifest lock
times out after 15s (MANIFEST_LOCK_TIMEOUT_MS), but a push can take
much longer (retry-with-rebase against a 90s per-call git timeout) —
so a slow or retried push could make every other profile-aware
operation sharing that manifest (a concurrent capture confirm,
another promotion, a profile-cli edit) fail with a spurious "Timed
out acquiring the ContextCake manifest lock" error.

confirmCapture already avoids this by releasing the lock before
pushing; promotion's own adversarial-review notes (B10) describe the
same "selection through local mutation" boundary but the
implementation held the lock through the push too. Split
approvePromotion into commitPromotion (validate, write curated
concept, commit the live deletion — stays inside the lock) and
finalizePromotion (push + review/binding cleanup — runs after the
lock is released), matching the documented design.

Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
Signed-off-by: John Siracusa <siracusa5@users.noreply.github.com>
@siracusa5
siracusa5 force-pushed the codex/project-profiles-runtime-selection branch from 02f593b to af1f222 Compare July 29, 2026 07:08
@siracusa5
siracusa5 merged commit b3e90db into main Jul 29, 2026
8 checks passed
@siracusa5
siracusa5 deleted the codex/project-profiles-runtime-selection branch July 29, 2026 07:10
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

enhancement New feature or request

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant