Skip to content

feat(env): apply carries env prompts/metrics forward #264

Merged
Koukyosyumei merged 2 commits into
mainfrom
apply-stash
Jul 6, 2026
Merged

feat(env): apply carries env prompts/metrics forward #264
Koukyosyumei merged 2 commits into
mainfrom
apply-stash

Conversation

@Koukyosyumei

Copy link
Copy Markdown
Collaborator

No description provided.

Fix env apply dropping prompt provenance:

- stamp_apply_provenance is now read-modify-write, preserving an
  env-tip commit's own ai_metadata/test_metrics on fast-forward apply
  (previously force-clobbered with a fresh ai_metadata=None record).
- --patch (squash) apply folds the squashed env commits' prompts (as a
  list, never concatenated), summed test metrics, subjects, and the
  context-branch tip onto the applied commit's env_provenance, so the
  driving prompt stays tracked on the parent branch and survives gc.
- pr.rs compute_aggregates scores folded prompts individually; merge/FF
  leave the fold empty so there is no double count.

Tests: fold collection, stamp RMW preservation, folded-prompt scoring
(+ no-double-count), and an end-to-end --patch fold integration test.
…aged mount

Memo the env model-pin feature and its enforcement analysis:
- Claude managed-settings availableModels/enforceAvailableModels is the
  hard lever; ANTHROPIC_MODEL alone is weak.
- container tier airtight (private overlay rootfs); kernel tiers share
  the host /etc so a rootless h5i cannot create the managed mountpoint.
- Option 1 (actionable): one-time root-provisioned
  /etc/claude-code/managed-settings.json, then per-env MS_BIND over it in
  pre_exec (like the existing /etc/hosts bind), with graceful fallback to
  today's soft pin. Option 2 (overlay /etc) rejected as fragile.
- Shared policy surface: [profile.X] model field, extend
  managed_settings_wrap_bash_json(), fold into policy_digest.
@Koukyosyumei Koukyosyumei changed the title Apply stash feat(env): apply carries env prompts/metrics forward Jul 6, 2026
@Koukyosyumei Koukyosyumei merged commit 3bd0704 into main Jul 6, 2026
9 of 10 checks passed
@Koukyosyumei Koukyosyumei deleted the apply-stash branch July 6, 2026 18:52
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