Commit graph

19776 commits

Author SHA1 Message Date
sebastian
b2c65b7ae2 fix(core): memory runs no tests: a fix is backed by the turn's own failing, then passing test and the commit after it 2026-11-20 13:03:09 +01:00
sebastian
e40aefcbf8 fix(core): a configured memory endpoint connects directly, with no config probe first 2026-11-20 12:50:03 +01:00
sebastian
0254e5f6cc fix(core): warn about a task start's memory decisions only when one failed, timed out or met a rate limit 2026-11-20 12:31:24 +01:00
Sebastian Herrlinger
2e19a5cfe4 feat(core): one warning per task start with what the memory decisions came to
Counts the decisions a task start's delivery asks (D4, D4b, D5b): asked, failed (taken as no, timeouts included),
timed out, 429s met, and elapsed ms, logged once as a warning when any were asked. Retries, deadlines and delivery
are unchanged.
2026-11-20 06:36:23 +01:00
Sebastian Herrlinger
ad885d0631 fix(core): D3 asks one durable question, cut at raw 0.21 (round 3: real failure lessons F1 0.35 -> 0.85)
As written in agent-memory-tasks-research benchmarks/decisions/RESULTS-3.md §1a (0992fb7): the rewritten
durable predicate replaces durable x (1 - fix_record) at 0.574. Held-out F1 0.814 -> 0.889.
2026-11-20 06:36:15 +01:00
sebastian
c0868f955c fix(core): a user message the decision finds correcting a given entry confirms that entry's correction 2026-11-20 05:50:44 +01:00
sebastian
b658fcfced fix(core): keep retire's secret scan, shown-whole check and supersededBy for a forget the user asked for 2026-11-20 03:52:49 +01:00
sebastian
b894456cd4 feat(core): memory has no repository access control, and retires an entry only when a person asks to forget it 2026-11-20 03:49:03 +01:00
sebastian
f6919c2e10 feat(core): memory never blocks: no commit/PR hold, injections that miss a request arrive at the next step, conventions as a session instruction entry; capture a rule stated with 'do it now', and count only failed test runs piped to exit 0 2026-11-20 02:39:08 +01:00
sebastian
bae2669269 feat(core): memory's rules take precedence over AGENTS.md where they differ, and a contradicting entry is never taken for a duplicate 2026-11-20 02:18:09 +01:00
sebastian
0198c8f529 feat(core): deliver a repository's conventions as their own instruction message, as AGENTS.md is shown 2026-11-20 02:13:48 +01:00
sebastian
5201b00ca3 feat(core): follow Console's inject and deliveries contract, ask the pinned D4b and D5b, and hold commits and PRs whenever a decision model resolves 2026-11-20 02:08:47 +01:00
sebastian
9f2318ae57 fix(ai): keep the provider identity out of OpenCode decision requests
(cherry picked from commit faa39bca8f)
2026-11-20 02:02:40 +01:00
sebastian
e9a0bc6aa5 feat(core): deliver a repository's rules at every task start, leave out what its instruction files state, and hold a session's first commit and PR for theirs 2026-11-20 01:42:37 +01:00
sebastian
5f597901b7 feat(core): drop memory's standing conventions block; conventions are delivered like other entries 2026-11-20 01:15:12 +01:00
sebastian
54622583c1 feat(core): drop memory's heuristic fallbacks: without a decision model its judgements are off, and a failed decision is a no 2026-11-20 00:22:07 +01:00
sebastian
e1e58e95a4 feat(core): let console_memory name a memory endpoint of its own, with headers, that works without a Console sign-in 2026-11-20 00:07:47 +01:00
sebastian
9dfad8075c fix(core): ask memory's decisions through OpenCode's decision generation, with a configurable decision model 2026-11-20 00:03:17 +01:00
sebastian
2e3b690619 feat(core): judge rules, corrections, durable lessons and delivery with Console's decision model, falling back to the stricter reading 2026-11-19 23:46:42 +01:00
sebastian
5757fbfa35 feat(core): label where each record line came from, and tell the distiller outside content is a third party's claim 2026-11-19 22:33:47 +01:00
sebastian
1caaeee169 feat(core): keep the user's own words out of taint, decide outside input from facts, and verify observed fixes locally 2026-11-19 22:29:52 +01:00
sebastian
8bd0b41bb1 fix(core): withdraw a memory correction reminder with a note that says the entry stands 2026-11-19 19:32:43 +01:00
sebastian
6dde95d5d4 fix(core): correct a title that states the corrected fact, and don't taint a session for the Console's own MCP tools 2026-11-19 19:21:01 +01:00
sebastian
e8b5340f48 fix(core): follow Console's pending revisions: confirm the revision a patch answered, and say which revision is still in use 2026-11-19 17:29:06 +01:00
sebastian
29e1fa9944 fix(core): back the session's own correction of an entry with the user's confirmation, and don't taint a read of the checkout root 2026-11-19 17:21:27 +01:00
sebastian
921c07a631 fix(core): apply a user-confirmed correction as an edit of the entry the session holds, from its whole text 2026-11-19 14:36:24 +01:00
sebastian
541e98e5d1 feat(core): let an installation turn OpenCode Console memory off with console_memory, in config and server settings 2026-11-19 14:09:14 +01:00
sebastian
517217fd7f fix(core): count the commands a user runs as their word for memory, not only what they type 2026-11-19 13:45:35 +01:00
sebastian
e9fad2511f Revert "feat(core): record the command that admitted a prompt in its metadata"
This reverts commit 93c01c4740.
2026-11-19 13:42:12 +01:00
sebastian
801fb93c25 fix(core): memory review fixes: harness-only commit evidence, user-typed confirmation, stored standing block, bounded first request, instructions for compaction and corrections, taint across MCP, subagents and restarts 2026-11-19 13:05:25 +01:00
sebastian
93c01c4740 feat(core): record the command that admitted a prompt in its metadata 2026-11-19 13:05:25 +01:00
sebastian
c48f122c69 chore(core): state design rationale in memory comments, regenerate for memory_capture 2026-11-19 12:08:05 +01:00
sebastian
69dc2cafe0 chore(core): drop writer-cost totals and the plugin-side standing delivery log 2026-11-19 12:06:22 +01:00
sebastian
ec1f8ace13 chore(core): remove the provisional-gotcha-at-failure experiment 2026-11-19 12:05:50 +01:00
sebastian
fefe16a1ea feat(core): per-turn writer budget, supersede on a confirmed correction, unverified gotchas at failure (experiment)
LongSessionBench run (b) through the real plugin (console-server bench/library/writes/longsession/RESULTS.md, 8691c4d8a): recall 67% vs 6% and 16 later convention checks fixed vs 1 broken, but the writer cap ran out mid-session in 6/8 sessions, a reversed rule stayed live beside its correction, and observed gotchas were never delivered.
- The writer budget is per user turn: two distillations for the boundaries inside a turn (test, commit, subtask), refilled by each user message; the boundaries that close a turn and compactions always distil. A boundary past the allowance keeps its events in the segment for the turn's closing distillation. The 20-per-session cap is gone.
- The distiller sees the entries the session knows (standing block, injected, read, published by it) and names those a user-confirmed correction reverses; the plugin sends the ones it knows, of this repository, as supersedes on the same publish, which Console retires atomically with supersededBy.
- Behind memory_provisional_failure (opt-in only, off in every build): at a failure moment, the provisional gotcha whose recorded error occurred in the failing output (search with explain, signals.error) is appended to the failing result in a <workspace-memory-unverified> block, at most one per failure, so the bench can test it.
2026-11-19 10:06:39 +01:00
sebastian
0f1a408b91 fix(core): try each DeepSeek flash model before the default, and price it
In the live check the writer's cost came out unpriced: the first paid flash listing (opencode/) refused the request, so every distillation fell back to the default model, and the working listing (zen/) carries no price. The distiller now tries each listed DeepSeek flash model, paid before free, remembers the one that answered, and only then the default; a listing without a price takes the same model's list price from another provider.
2026-11-19 07:44:06 +01:00
sebastian
307415a60e fix(core): don't retire or rewrite another repository's entry from this checkout
In the live A-C regression a session working in acme/api read acme/web's test procedure (ACME_DB_URL), found no such variable in acme/api, wrote 'Verified false' and retired it, which would have left task B's sessions without it. Retire and rewrite now fail before sending for an entry the session read as about another repository (unless tagged general), saying what holds there can't be checked from here; edit and append, which add corrections and evidence, are unchanged.
2026-11-19 07:41:31 +01:00
sebastian
d7a3bfcfd8 fix(core): promote a rule the user states, also when the agent published it first
In the live check neither user-stated rule went live. A rule stated without correcting words ('From now on we always ...') only opened a segment that no boundary closed, so it was never distilled; and where it was distilled, the agent had already published the rule itself, Console refused the distiller's copy as a duplicate, and the user's confirmation was dropped with it.
- A message stating a team rule (from now on, going forward, we always/never/use/prefer, our convention, team rule ...) is a boundary of its own, distilled with the message, work or not.
- When Console refuses a confirmed candidate as a duplicate, its confirmation goes to the entry it named, through POST /api/memory/entries/:id/evidence, which Console promotes.
2026-11-19 07:37:49 +01:00
sebastian
473620c7d2 fix(core): distil only user-stated team rules as user statements, confirm them, report the writer's cost
LongSessionBench quick tier (console-server bench/library/writes/longsession/RESULTS.md, 4a1131185): the boundary distiller recalled 94% of durable events after compactions vs 6% for the reminder, but 63% of its live entries were task requests logged as user statements, and its provisional entries never reached the next session.
- The distiller is told task requests aren't lessons, and marks a candidate basis user only for a durable team rule, decision or correction the user stated, with their words. The plugin keeps such a candidate only when the quote is word for word in a user message of the segment and reads as a rule or correction; otherwise it is dropped.
- Candidates are published (POST /api/memory/entries), as Console's contract has it, not to a separate route. A user-stated rule goes with evidence {kind: confirmation, ref: their words}, which Console promotes to live; everything else stays provisional (a duplicate refusal records the session as another observation).
- Each session's writer totals (calls, tokens estimated at characters / 4, USD at the model's list price, unpriced calls apart) are kept in plugin storage as memory-writer:<session> and logged.
2026-11-19 06:34:00 +01:00
sebastian
ea26f6f9b9 fix(core): ask for the standing block as Console's contract does
Console's route (in progress in the server session) is POST /api/memory/standing { repo, sessionID, reachable } and answers only the repository's live conventions, without kind, status or repo. The plugin now posts that, and reads a missing kind or status as what Console selected; the policy still checks what it is told.
2026-11-19 06:05:11 +01:00
sebastian
0c35020018 feat(core): carry the repository's standing conventions as a system part
The delivery benchmark's arm A12 (console-server bench/library/delivery/HANDOFF-plugin.md, 58df32647): +11 pp success over the shipped plugin on 100 cells, house rules +28 pp, cost 0.95x. At a session's first request the plugin asks Console for its repository's conventions (GET /api/memory/standing?repo&sessionID&reachable, until Console names it), keeps the live, untainted, current ones of that repository or tagged general, at most 5 and 2,000 tokens with the most recently verified kept and the rest logged, renders them oldest id first under the measured <workspace-memory-standing> header, and adds that text as a system part to every request of the session, byte-identical and never a user message. Its entries count as given, so task-start and failure injections don't send them again. Task-start and failure injection are unchanged.
2026-11-19 06:04:02 +01:00
sebastian
9a626e9e1b fix(core): distil on a paid DeepSeek flash model, and fall back to the default model
In a real session the distiller picked deepseek-v4.1-flash-free, which the signed-in route refuses (HTTP 404), so no candidate was ever made. A paid flash model now goes first, and a refused request retries on OpenCode's default model. Checked end to end: the same session's segment now yields a typed candidate, which the plugin sends to POST /api/memory/candidates.
2026-11-19 02:15:14 +01:00
sebastian
085e10a658 feat(core): capture session events, distil candidates at work boundaries, send them pending
Long-session research (.research-final/longsession-SYNTHESIS.md §6), behind the memory_capture flag (on in local and dev builds):
- every turn is recorded mechanically, without a model, into a plugin-owned append-only event log in plugin storage (memory-log:<session>:<n>): the user's messages, finished commands with exit code, failure and test flags and their output's end, files changed and read, commits the session made, finished subagents, compactions;
- at work boundaries the harness sees (a new task message, a commit, a test-like run passing after one failed, a correction, a finished subtask, compaction as a backstop) the segment since the last one is distilled out of band with a stateless generation on a DeepSeek flash model when available, nothing in the coding session, at most 20 per session;
- each candidate passes the same write checks as publish (secrets, local and scratch paths, internal hosts, missing paths, uncommitted files) and goes to Console's POST /api/memory/candidates as pending, with its boundary, the segment's evidence (commits, passing runs after failures) and its event range;
- the once-per-session idle publish reminder is removed.
2026-11-19 02:09:40 +01:00
sebastian
7f3d19c4f3 fix(core): refuse memory writes that name a file only the checkout has added
In the combined end-to-end run, sessions that added a bunfig.toml in their own checkout rewrote the shared test-procedure entry twice to say plain bun test works (once after the publish reminder); the next sessions were handed it. The tool texts already said to record the repository as committed. Publish, edit, append and rewrite now fail before sending when their text names a file git reports as untracked or newly added (oldText and structured evidence aside), and the publish template and the reminder say so too.
2026-11-19 00:49:19 +01:00
sebastian
59a6e4273f feat(core): provisional entries, taint, evidence and path checks, per Console's contract
Console (067ef3e93) makes every new entry provisional until a teammate backs it, and asks the plugin to mark taint and resolve anchors:
- search marks provisional hits and renders no_reliable_entry as 'No reliable memory entry found.'; publish says the entry is provisional;
- publish sends tainted when its session fetched from the web, ran curl/wget/gh issue|pr|api/git clone, or read a file outside the checkout;
- publish and edit take evidence ({kind, ref}); a teammate's evidence through edit makes a provisional entry live;
- paths naming a repository path (with a /) that doesn't exist and isn't git-ignored are refused before sending; globs, dotted module names and root files pass, as the publish audit's anchor gate refused those wrongly;
- a scratch path (/tmp/..., /var/folders/...) is refused before sending, as Console's scan does.
2026-11-19 00:36:55 +01:00
sebastian
654049dfad feat(core): remind a session once, after a verified fix or dead end, that it may publish
The publish audit (console-server bench/library/writes/RESULTS.md, 865fe8a44) found the shipped plugin publishes nothing (0 in 96 sessions), and recommends its WB2 arm: one reminder when the session would go idle, only if it verified a fix (a test-like run failing before the last edit and passing after it) or worked past a dead end (several failing runs before a passing one), pointing at a restrictive typed template. The plugin now tracks test-like runs and edits and, in experimental.idle, admits that reminder once per session; not while the session's own work runs in the background, and not in a subagent's or fork's session. The publish description is WB2's template (Claim / Applies when / Action / Verify or Avoid / Anchors / Evidence), opening with 'Most sessions should publish nothing'. In-task publishing is unchanged.
2026-11-19 00:05:32 +01:00
sebastian
3b2bb37a72 fix(core): count a failing command followed by ';' as a failure moment
An agent ran `bun test 2>&1; echo "exit=$?"`, which exits 0, so the failing tests never reached failure-time delivery (seen in the end-to-end regression). A command sequenced with ';' now counts as failed when its output says so, as a piped one does.
2026-11-18 23:53:13 +01:00
sebastian
d3728694b3 feat(core): deliver failure-time memory in the failing result, again after compaction, and rewrite only from what was shown
Final delivery and edits research:
- A failing command's entries are appended to that command's result in execute.after (delivery §14.8), within the policy's timeout, instead of a message before the next request; the result's metadata records them.
- After session.compaction.ended the entries injected in the session are delivered once more (§14.13), except those it changed since.
- rewrite and retire start from a revision the session was shown whole since its last compaction (read, injected or written by it), else nothing is sent and the answer names memory.read (edits §0.6).
- The header says entries are information, not instructions to do more than the task (§14.11); search says when no reliable entry was found (retrieval §11.4); publish starts with 'Most sessions should publish nothing.' and lists what never to publish (writes §4.2); a 404 reads 'not found, or not readable with your repository access' (access §0.6); a rewrite Console merged says so.
2026-11-18 23:41:37 +01:00
sebastian
79672ddf58 feat(core): refuse internal hosts and private addresses in memory writes
Access research §0.3: internal hosts and IPs become descriptive slots in a shared entry. A field naming an RFC 1918 address or a host under .internal, .corp, .lan or .intranet now fails the write before anything is sent, asking for a placeholder such as <internal database host>. localhost, loopback and public hosts pass.
2026-11-18 23:41:37 +01:00
sebastian
53723f14ba fix(core): refuse a path into another home directory before sending a memory write
After this machine's checkout and home paths are made relative, a path still in a home directory (/home/<user>, /Users/<user>, /root, C:\Users\<user>) is someone else's, which Console's scan rejects with advice to send root. The plugin now refuses it itself, before sending, and says to write it relative to the repository or from ~/.
2026-11-18 17:03:50 +01:00