Runs take only curated memories, a step's prompt carries its task's note, comments, plan and the flow's earlier reports, and a run's environment names its gate cache #195

Merged
agra merged 4 commits from task/3981-runs-receive-hundreds-of-unreviewed-agen into master 2026-10-30 18:41:13 +02:00
Owner

Tracker: #3981

What it delivers

  • Agents' memories are held for review by default. A project's memory_review defaults to after_review. Migration 55 rebuilds project with that column default, moves every existing project to after_review, and holds every agent memory still new. On the live database that holds the 726 new memories, so a run's instructions carry only the memories Agra took into use. A project can still be set to at_once. A global memory whose author's project is gone is no longer used.
  • The Memories part of a run's instructions says a memory is only for a rule that holds beyond its task, never the task's progress, what one run hands the next, a review's findings, a commit or a probe's log, because a later step of the task's flow is asked those. It also says whether sak holds the memory until Agra takes it into use or the runs after use it at once, by the project's switch.
  • A step's run is asked its whole context. flow_prompt gives a step's run, after its task's title and description: the task's note; its comments, oldest first; its parent task's title, description and note; each subtask's status, PR, latest flow run and that flow run's latest step report; and the report of each earlier step run of its flow run (node, run, role and out over its summary). Then come the Orchestrator's brief and what a re-run is told, as before.
  • SAK_GATE_CACHE is in a run's environment: the project's gate cache directory, the same one its gates and gate jobs run with.

Regressions, failing before and passing after

Before: a git archive arm of master ce44f520 holding this branch's test files, with dist/ built there by the gate cache's sx (af8455c3). After: this branch's head.

Test file Master Head
tests/memories.sx MEMORIES FAIL (8 checks): the default switch, the three instruction texts, the gone author's global memory, and the three checks of the upgrade from 54 MEMORIES OK
tests/flow_prompt.sx (new) FLOW PROMPT FAIL (3 checks): a step's first prompt (note, comments, parent), the next step's (earlier step report, then brief), and a plan's (subtasks) FLOW PROMPT OK
tests/runner_core.sx RUNNER CORE FAIL (6 checks): the four exact-environment checks, one per harness; the harness's SAK_GATE_CACHE; a saved memory held by default ok 130s
tests/blockers.sx 2 checks: the resumed step's prompt carries the earlier step's report before its Blockers; the schema head 55 BLOCKERS OK
tests/deployed_upgrade.sx 1 check: the deployed fixture's projects and new memory are moved as migration 55 says, every other value kept DEPLOYED UPGRADE OK

The run that delivered this showed the third symptom in its own shell: SAK_GATE_CACHE was empty, while SAK_GATE_SOCKET and SAK_REPORT were set.

Goldens

The golden set this PR changes: web/e2e/surfaces.spec.ts-snapshots/memories-{light,dark,phone-light,phone-dark}-chromium-darwin.png. They were re-recorded in one full run of the main Playwright config with --update-snapshots=changed: 777 passed, 1 skipped, and no other snapshot moved. The scene's project now takes the new default, so the changed pixels are the banner ("waiting for review"), the group's switch ("after review") and the memory's mark ("held for review"). These are looks the Memories page already has for a project that reviews.

Gates

  • full, gate run 979 (this run's #2), passed at 39cca194, the head. Every step passed: 70 tests/*.sx files built and each ok, release.sh and step9, the deploy contract, the main Playwright config (777 passed, 1 skipped) and the runner config (10 passed).
  • fast, gate run 976 (#1), passed while iterating, on the uncommitted tree over ce44f520.

Deploying

Migration 55 rebuilds the small project table and updates memory, all in one transaction. Runs get SAK_GATE_CACHE once their runner is updated to a release that carries this change.

Tracker: [#3981](https://sak.swipelab.com/tasks/3981) ## What it delivers - **Agents' memories are held for review by default.** A project's `memory_review` defaults to `after_review`. Migration 55 rebuilds `project` with that column default, moves every existing project to `after_review`, and holds every agent memory still `new`. On the live database that holds the 726 `new` memories, so a run's instructions carry only the memories Agra took into use. A project can still be set to `at_once`. A global memory whose author's project is gone is no longer used. - **The Memories part of a run's instructions** says a memory is only for a rule that holds beyond its task, never the task's progress, what one run hands the next, a review's findings, a commit or a probe's log, because a later step of the task's flow is asked those. It also says whether sak holds the memory until Agra takes it into use or the runs after use it at once, by the project's switch. - **A step's run is asked its whole context.** `flow_prompt` gives a step's run, after its task's title and description: the task's note; its comments, oldest first; its parent task's title, description and note; each subtask's status, PR, latest flow run and that flow run's latest step report; and the report of each earlier step run of its flow run (node, run, role and out over its summary). Then come the Orchestrator's brief and what a re-run is told, as before. - **`SAK_GATE_CACHE` is in a run's environment**: the project's gate cache directory, the same one its gates and gate jobs run with. ## Regressions, failing before and passing after Before: a `git archive` arm of master ce44f520 holding this branch's test files, with `dist/` built there by the gate cache's sx (af8455c3). After: this branch's head. | Test file | Master | Head | | --- | --- | --- | | `tests/memories.sx` | `MEMORIES FAIL (8 checks)`: the default switch, the three instruction texts, the gone author's global memory, and the three checks of the upgrade from 54 | `MEMORIES OK` | | `tests/flow_prompt.sx` (new) | `FLOW PROMPT FAIL (3 checks)`: a step's first prompt (note, comments, parent), the next step's (earlier step report, then brief), and a plan's (subtasks) | `FLOW PROMPT OK` | | `tests/runner_core.sx` | `RUNNER CORE FAIL (6 checks)`: the four exact-environment checks, one per harness; the harness's `SAK_GATE_CACHE`; a saved memory held by default | `ok 130s` | | `tests/blockers.sx` | 2 checks: the resumed step's prompt carries the earlier step's report before its Blockers; the schema head 55 | `BLOCKERS OK` | | `tests/deployed_upgrade.sx` | 1 check: the deployed fixture's projects and `new` memory are moved as migration 55 says, every other value kept | `DEPLOYED UPGRADE OK` | The run that delivered this showed the third symptom in its own shell: `SAK_GATE_CACHE` was empty, while `SAK_GATE_SOCKET` and `SAK_REPORT` were set. ## Goldens The golden set this PR changes: `web/e2e/surfaces.spec.ts-snapshots/memories-{light,dark,phone-light,phone-dark}-chromium-darwin.png`. They were re-recorded in one full run of the main Playwright config with `--update-snapshots=changed`: 777 passed, 1 skipped, and no other snapshot moved. The scene's project now takes the new default, so the changed pixels are the banner ("waiting for review"), the group's switch ("after review") and the memory's mark ("held for review"). These are looks the Memories page already has for a project that reviews. ## Gates - `full`, gate run 979 (this run's #2), passed at 39cca194, the head. Every step passed: 70 `tests/*.sx` files built and each ok, release.sh and step9, the deploy contract, the main Playwright config (777 passed, 1 skipped) and the runner config (10 passed). - `fast`, gate run 976 (#1), passed while iterating, on the uncommitted tree over ce44f520. ## Deploying Migration 55 rebuilds the small `project` table and updates `memory`, all in one transaction. Runs get `SAK_GATE_CACHE` once their runner is updated to a release that carries this change.
agra changed title from Runs take only curated memories, and a step's prompt carries its task's note, comments, plan and the flow's earlier reports to Runs take only curated memories, a step's prompt carries its task's note, comments, plan and the flow's earlier reports, and a run's environment names its gate cache 2026-10-30 18:17:56 +02:00
agra merged commit bc8ec978c2 into master 2026-10-30 18:41:13 +02:00
Sign in to join this conversation.
No reviewers
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
sx/sak!195
No description provided.