ambient: session-end learnings rules + agent task-artifact writing#287
Open
Zpankz wants to merge 3 commits into
Open
ambient: session-end learnings rules + agent task-artifact writing#287Zpankz wants to merge 3 commits into
Zpankz wants to merge 3 commits into
Conversation
…sidecar fallback Queried live provider catalogs via wired OAuth creds (Codex backend, Antigravity cloudcode-pa, xAI) instead of relying on stale hardcoded lists. Documented Pareto-optimal model->role assignments for every specialized agent role (primary coding, swarm subagents, memory sidecar, autoreview, autojudge, ambient) in docs/model-role-assignment.md, including a status table, a per-role config example, and reproducible catalog-fetch commands. gpt-5.4-mini is now live (272k ctx, cheaper/faster than gpt-5.4) so it is the Pareto-better OpenAI sidecar fallback for the high-frequency relevance/extraction workload. Added it to ALL_OPENAI_MODELS so the picker/catalog surface it.
Adds docs/SESSION_END_LEARNINGS_RULES.md: a series of rules formalizing what the session-end learnings+work capture records (categories, dedup, trust, no-ephemera, cost bounds) and how it is enforced across the pipeline, extraction prompt, and ambient directive seed. Wires Rule 8: trigger_save_memory_extraction (the /exit/quit teardown path) now records an auditable, data-only session-end directive into the ambient store when ambient mode is enabled. Best-effort; never blocks or fails teardown. Adds record_session_end_directive + a unit test for the directive format. No behavior change for users without ambient enabled; reuses the existing final-extraction pipeline rather than introducing a new one.
…jor tasks Add a 'Task artifacts' section to the agent system prompt directing every jcode agent surface (TUI, server, swarm subagents, ambient) to write durable markdown artifacts to disk at the end of major tasks, mirroring the planning-with-files + memex file-writing pattern. Reaches all agents via build_system_prompt_split, which embeds DEFAULT_SYSTEM_PROMPT. Document as Rule 9 in docs/SESSION_END_LEARNINGS_RULES.md and add a 4th enforcement layer (agent system prompt). Guidance only: data, not executed instructions; no breaking behavior change.
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.
What
Two complementary, opt-in/guidance-only enforcement layers for durable agent memory:
Session-end learnings capture (Rules 1-8): documents the existing teardown
extraction pipeline contract and wires an auditable on-exit ambient directive
(
record_session_end_directive) so capture is explicit, gated onambient.enabled, and best-effort.Task artifact writing (Rule 9, this update): a "Task artifacts" section in
the agent system prompt (
crates/jcode-base/src/prompt/system_prompt.md)directs every jcode agent surface (TUI, server, swarm subagents, ambient) to
write durable markdown artifacts to disk at the end of major tasks, mirroring
the planning-with-files + memex file-writing pattern. Reaches all agents via
build_system_prompt_split, which embedsDEFAULT_SYSTEM_PROMPT.Design
no impact for users who have not opted in.
run_final_extraction, ambient directives,system-prompt assembly) rather than inventing new ones.
extraction prompt.
Files
docs/SESSION_END_LEARNINGS_RULES.md- 9 rules, 4 enforcement layers.crates/jcode-base/src/prompt/system_prompt.md- "Task artifacts" section.crates/jcode-app-core/src/ambient/directives.rs+ambient.rs- on-exit directive.crates/jcode-tui/src/tui/app/conversation_state.rs- directive call site.Verification
cargo build --profile selfdev -p jcode-baseclean.cargo test --profile selfdev -p jcode-base prompt- 18 passed.session_end_directive_fields_formatunit test for the directive helper.