feat(intelligence): accept directly authored profiles - #659
Conversation
tangletools
left a comment
There was a problem hiding this comment.
✅ Auto-approved drewstone PR — 1d1badab
This PR was opened by the trusted drewstone account.
The full PR reviewer audit still runs separately and will publish findings if it detects issues.
tangletools · auto-approval · reason: drewstone_author · 2026-07-29T21:28:13Z
tangletools
left a comment
There was a problem hiding this comment.
🟢 Value Audit — sound
| Verdict | sound |
| Concerns | 0 (none) |
| Heuristic | 0.0s |
| Duplication | 0.0s |
| Interrogation | 276.7s (2 bridge agents) |
| Total | 276.7s |
💰 Value — sound
Extends the measured profile-improvement path to accept completely authored AgentProfiles by deriving exact field-level diffs — coherent, in-grain, no existing capability duplicated.
- What it does: Before this change, the measured profile-improvement path could only express 'prompt' and 'skills' surface changes (AGENT_PROFILE_MEASURED_SURFACES = ['prompt','skills']); any other profile field (model, permissions, tools, hooks, mcp, subagents, identity, metadata, etc.) was rejected with 'measured profile contract cannot apply'. Now agentImprovementProfileDiffs computes a whole-profile reset+set
- Goals it achieves: 1) Let product-owned directly-authored profiles use the same measured lifecycle as optimizer-produced granular changes — no parallel candidate type or lifecycle. 2) Fix a real correctness gap: the old per-surface shortcut could re-add unchanged external resources (GitHub-hosted skills/tools) because AgentProfileDiff.set uses array-append semantics (mergeAgentProfiles); the new field-level differ o
- Assessment: Coherent and well-executed. The central design decision — emit a reset diff (remove only changed fields) followed by a set diff (set only changed fields), rather than a blunt whole-profile overwrite — is forced by the append semantics of applyAgentProfileDiff (confirmed in agent-interface/dist/profile-diff.d.ts:39-40: 'set is an AgentProfile overlay: profile arrays are appended'). A blunt overwrit
- Better / existing approach: none — this is the right approach. Searched for an existing 'compute diff between two profiles' primitive: agent-interface/dist/profile-diff.d.ts exports only applyAgentProfileDiff (apply), changedAgentProfileAxes (axes changed BY a diff), pruneAgentProfileDiff (prune), and defineAgentProfileDiff (identity) — none compute a diff FROM two profiles, so the field-level differ is new and necessary. Th
- Model: opencode/zai-coding-plan/glm-5.2
- Bridge attempts: 2
- Bridge warning: opencode/kimi-for-coding/k2p7: bridge stream ended without value-audit content
🎯 Usefulness — sound
A coherent extension of the existing measured profile-improvement lifecycle to directly-authored complete profiles, with a correct fix for unchanged-resource leakage and stronger receipt-based verification; no parallel lifecycle introduced and no dead surface.
- Integration: Fully reachable. The new complete-profile differ (agentImprovementProfileDiffs -> completeAgentProfileReplacementDiffs) is invoked by the public proposeAgentProfileImprovement (improvement-cycle.ts:824); the resulting agent-profile surface is admitted by the propose guard (improvement-cycle.ts:765) and by profileTargets in the activation path (profile-activation.ts:358, via isAgentProfileMeasuredS
- Fit with existing patterns: Fits the codebase grain precisely. It deliberately avoids a new candidate type or parallel lifecycle (confirmed by code): it widens the existing AgentProfileMeasuredSurface union with 'agent-profile', reuses applyExactAgentProfileDiff as the applier, the existing experiment sealing, and the profile-transition activation mechanism. The switch from agentProfileImprovementMeasuredComparisonSchema.par
- Real-world viability: Robust beyond the happy path. The differ round-trip-verifies (canonicalCandidateDigest(applied) !== candidate -> throw, improvement-surfaces.ts:408-410) so any non-reproducing diff is rejected before it ships. profileValuesDiffer normalizes absent-vs-present correctly; resource sub-fields are only included when they actually change (replaceChangedProfileResources), which is the fix for the prior b
- Model: opencode/zai-coding-plan/glm-5.2
- Bridge attempts: 1
No concerns — sound change, no better or existing approach found. ✅
What this audit checks
It judges the change on its merits — not whether it was tasked out in an issue. Unticketed, fast-moving work is fine; the question is whether the change is good and whether a better or existing approach should be used instead.
| Pass | What it asks |
|---|---|
| Heuristic | Vague title? Whitespace-only or cruft-bearing diff? (content signals only) |
| Duplication | Do added function/class names already exist elsewhere in the repo? |
| Value Audit | What does it do? What goal does it achieve? Is it good? Better architecture or already-exists? |
| Usefulness Audit | Does it integrate and fit? Will it hold up in real use and actually get used? |
Findings are concerns, not blocks — the human reviewer decides what to do with them.
❌ Needs Work —
|
tangletools
left a comment
There was a problem hiding this comment.
❌ 5 Blocking Findings — 1d1badab
Full multi-shot audit completed 7/7 planned shots over 10 changed files. Global verifier still owns final merge decision.
Full immutable report for this review: trace
Summary comment for this run: full summary
tangletools · 2026-07-29T21:46:12Z · immutable trace
Summary
No new candidate type or parallel lifecycle is introduced.
Proof