This document defines the design for P4 from issue #63: preference maturation for
brief --agent.
It is a design document, not an implementation document. It defines how
experience may mature into onboarding preferences without changing the current
brief --agent contract or allowing agents to rewrite it silently.
Agents may propose preference changes. Humans approve them.
brief --agent remains a bounded, user-scope constitution. It is not a dump of
every lesson ever learned, and it is not a task-scoped context pack. P4 exists
to define how durable behavioral corrections can move toward that constitution
without breaking its stability.
P4 does:
brief --agentP4 does not:
brief --agent JSON shapebrief context responsible for onboarding behaviorFrom internal/cli/onboard.go, brief --agent currently loads:
category=preference and tag=onboardcategory=preference entries as a fallbackdefault_limit entriesThat remains the load-bearing contract.
P4 must preserve these rules from Context Contract:
brief --agent is stable and user-scoped.brief context is env-scoped and must not become a second onboarding
payload.Preference maturation works over memory that already exists in brief. It does
not invent a parallel storage model.
Possible inputs:
lesson entries that record concrete correctionsdecision entries that capture durable operating rulespreference entries that may need consolidation, supersession, or
expirybrief promoteThis preserves the memory/source boundary. Crawled source material is not
eligible to shape brief --agent until a human promotes it into the entries
store.
P4 depends on the primitives shipped in P3. It does not replace them.
| Primitive | Role in maturation |
|---|---|
brief stale |
Surface onboarding preferences or lessons that may no longer be current. |
brief duplicates |
Surface repeated lessons or overlapping preferences that need consolidation. |
brief promote |
Move source-derived evidence into durable memory before it can influence onboarding behavior. |
brief merge |
Collapse repeated corrections into one canonical candidate. |
brief review |
Establish the approval pattern: candidates are reviewed deliberately, not auto-applied. |
The current brief review TUI is a maintenance queue for stale and duplicate
entries. P4 does not require preference maturation to reuse the exact same UI,
but it should reuse the same human-review posture.
Preference maturation has five stages.
Behavioral corrections are first captured as ordinary memory:
lesson when the agent made a concrete mistakedecision when a broader operating rule is establishedAt this stage nothing changes in brief --agent.
Candidates are identified from accumulated memory and existing preferences.
Typical triggers:
This is where stale, duplicates, and merge provide the raw maintenance
signals.
A candidate preference change is drafted from one or more underlying entries.
The proposal may take one of four forms:
Promotion is not enough. Synthesis is conflict-resolution, not accumulation. The goal is a smaller, sharper onboarding set, not a longer one.
Until a human approves the proposal, it must remain outside the active
onboarding filter. In current repo terms, that means it must not yet be an
effective category=preference + tag=onboard entry that brief --agent
would load.
A human reviews the proposal before it changes onboarding behavior.
The review decision must answer:
onboard tag removed?No fully automatic rewrite path is allowed.
After approval, the human applies the change using existing entry operations.
Possible actions with the current model:
category=preference entrytag=onboard to an approved onboarding preferenceP4 does not require a new storage type. It uses existing entries, categories, tags, and maintenance operations.
The brief --agent payload is a startup budget, not a warehouse.
Preference maturation must obey these rules:
brief context, not unconditional
startup.tag=onboard, merging
redundant rules, or archiving stale preferences is part of maturation.default_limit remains the hard budget. Future implementation may improve
ranking or proposal flow, but it must not assume the onboarding set can grow
without bound.brief context does not become a pressure-release valve for bad onboarding
hygiene. User-scope and env-scope remain separate.The intended state model is:
lesson / decision / promoted memorycategory=preference with tag=onboard)Future implementation may add more explicit workflow surfaces, but it should map back to these transitions.
#57 defines the agent workflow layer: when agents start, search, save, and
end a session.#59 provides the maintenance primitives required to keep memory trustworthy.#62 is the problem statement for preference maturation and the reason this
design exists.#63 is the roadmap that sequences P4 after P3 and before later retrieval
work.The relationship is sequential, not competitive:
#59 provides the primitives#57 provides the workflow posture#62 applies both to onboarding preference maturationWhen P4 is implemented in code, that implementation should:
brief --agent schema