Skip to content

Commit cdf691d

Browse files
Release v1.2.1 with AI side-load cache and handover automation
1 parent 92b759b commit cdf691d

23 files changed

Lines changed: 1771 additions & 18 deletions

AGENTS.md

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -140,6 +140,20 @@ When a user asks to update the workspace's reviewed GitHub refs or managed upstr
140140

141141
Do not refresh those sources by hand when the wrapper already covers them.
142142

143+
## Handover closeout
144+
145+
When a user asks for a handover update, treat that as a memory-closeout request too.
146+
147+
Default behavior:
148+
149+
- if the handover update is repo-specific, run `tools/bin/workspace-memory save-repo <repo-name>` after the docs update
150+
- if the handover update is workspace-level, docs-level, or release-level, run `tools/bin/workspace-memory save-workspace` after the docs update
151+
- if both repo and workspace handover surfaces changed in one slice, run the closeout commands serially rather than in parallel
152+
- run a quick `git status` sanity check before closing the chat so the handover does not imply a cleaner worktree than actually exists
153+
- if public docs changed, confirm the public surfaces stay aligned: `README.md`, `docs/README.md`, `docs/CHANGELOG.md`, and the relevant repo-local README when one exists
154+
155+
Do not leave MemPalace closeout as a manual reminder when the user explicitly asked for a handover update.
156+
143157
## New repo baseline
144158

145159
When a repo is first added under `repos/`, assume the baseline in `docs/09-new-repo-baseline.md` applies unless that repo already has clearer local instructions.

README.md

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -56,6 +56,7 @@ If you want the fuller workspace path after that:
5656

5757
- Start with [docs/08-first-run-and-updates.md](docs/08-first-run-and-updates.md).
5858
- Use [docs/README.md](docs/README.md) for the detailed docs index.
59+
- Use [docs/20-ai-context-side-load.md](docs/20-ai-context-side-load.md) for the generated AI side-load contract and the `generate-context-cache.sh` workflow.
5960
- Use [docs/09-new-repo-baseline.md](docs/09-new-repo-baseline.md) when adding or onboarding a repo.
6061

6162
## How To Contribute
@@ -173,6 +174,7 @@ Deeper docs:
173174
- [docs/11-core-memory-and-reference-promotion.md](docs/11-core-memory-and-reference-promotion.md)
174175
- [docs/18-mcp-server-catalog.md](docs/18-mcp-server-catalog.md)
175176
- [docs/19-mcp-authoring-rules.md](docs/19-mcp-authoring-rules.md)
177+
- [docs/20-ai-context-side-load.md](docs/20-ai-context-side-load.md)
176178

177179
Supporting references:
178180
- [docs/HANDOVER.md](docs/HANDOVER.md)
@@ -200,6 +202,8 @@ The practical model is:
200202
- local-only memory and MCP config kept separate from tracked repo content
201203
- a small official MCP v1 profile set for Codex, installed through workspace-owned scripts instead of ad hoc one-off setup
202204

205+
Side-load summaries are now generated with `tools/scripts/generate-context-cache.sh` into ignored `cache/context/workspace/` and `cache/context/repos/` paths. They are optional `L0` and `L1` cache files, not canonical workspace documentation.
206+
203207
The current MCP v1 support set is intentionally small: OpenAI Docs, Context7, Playwright, Chrome DevTools, and GitHub.
204208

205209
This keeps context easier to inspect, reason about, and adapt across tools while keeping each repo independently runnable.

docs/07-context-cache-and-retrieval.md

Lines changed: 33 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -239,6 +239,8 @@ For future long-running agent jobs, a similar compact summary file under `cache/
239239

240240
Use `tools/scripts/init-agent-job-bundle.sh` to create this local cache bundle when the work is large enough to justify it.
241241

242+
Concrete side-load generation rules, source sets, and freshness semantics now live in [20-ai-context-side-load.md](20-ai-context-side-load.md).
243+
242244
### `plan.md` and `summary.md`
243245

244246
These are job-level working files rather than canonical repo docs.
@@ -270,18 +272,40 @@ Suggested fields:
270272
```json
271273
{
272274
"version": 1,
273-
"generatedAt": "2026-03-21T10:30:00Z",
274-
"repoRoot": "/absolute/path/to/repo",
275+
"scope": "repo",
276+
"target": "workspace-hub",
277+
"generatedAt": "2026-04-10T10:30:00Z",
278+
"generator": {
279+
"path": "tools/scripts/generate-context-cache.sh"
280+
},
275281
"inputs": [
276282
{
277283
"path": "README.md",
278-
"kind": "readme",
279-
"mtime": "2026-03-20T13:00:00Z"
284+
"role": "repo-readme",
285+
"bytes": 2048,
286+
"mtimeMs": 1775816400000.0,
287+
"sha256": "..."
280288
},
281289
{
282290
"path": ".workspace/project.json",
283-
"kind": "manifest",
284-
"mtime": "2026-03-20T13:05:00Z"
291+
"role": "repo-manifest",
292+
"bytes": 512,
293+
"mtimeMs": 1775816700000.0,
294+
"sha256": "..."
295+
}
296+
],
297+
"outputs": [
298+
{
299+
"path": "cache/context/repos/workspace-hub/abstract.md",
300+
"role": "abstract"
301+
},
302+
{
303+
"path": "cache/context/repos/workspace-hub/overview.md",
304+
"role": "overview"
305+
},
306+
{
307+
"path": "cache/context/repos/workspace-hub/sources.json",
308+
"role": "sources"
285309
}
286310
]
287311
}
@@ -355,10 +379,12 @@ For Workspace Hub, the relevant near-term use is modest:
355379

356380
- detect whether context cache files exist
357381
- show whether summaries are fresh or stale
358-
- link to the source files behind a summary
382+
- link to generated summary files and tracked provenance
359383
- use cached `L0` and `L1` summaries to reduce repeated full-repo reads
360384
- explain which files and signals drove repo classification when available
361385

386+
Agent-job bundles under `cache/context/agents/jobs/` stay separate from repo and workspace side-load summaries. They are local task artifacts, not the repo-level side-load cache.
387+
362388
Good future enhancements:
363389

364390
- regenerate summaries on demand

docs/08-first-run-and-updates.md

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -41,6 +41,22 @@ Then, once the app is open:
4141

4242
If that trial path is enough, stop there and keep the rest of this doc as optional setup and maintenance guidance.
4343

44+
## Fresh chat handover
45+
46+
If you are starting a fresh repo-aware chat and want a cheaper wake-up path, use this sequence:
47+
48+
1. read `docs/HANDOVER.md` and the directly relevant tracked README or doc first
49+
2. optionally refresh side-load summaries:
50+
`tools/scripts/generate-context-cache.sh --workspace --run`
51+
3. for `workspace-hub` work, also run:
52+
`tools/scripts/generate-context-cache.sh --repo workspace-hub --run`
53+
4. treat generated files under `cache/context/` as compact `L0` and `L1` summaries only
54+
5. trust tracked docs, manifests, and repo files over generated summaries whenever they differ
55+
56+
Suggested instruction for a fresh chat:
57+
58+
> Read `docs/HANDOVER.md` first. Use generated side-load files under `cache/context/` only as a compact summary layer, and treat tracked docs and repo files as canonical.
59+
4460
## Optional first-run questions
4561

4662
Answer these in order:

docs/14-git-and-github-workflow.md

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -83,6 +83,10 @@ These names are guidance, not enforcement.
8383
- Use non-closing references such as `Refs #123` when the issue lives in another repo, when the PR targets a fork first, or when more work remains.
8484
- Close the issue when the accepted change actually lands, not when a branch merely exists.
8585
- For local-only or git-only repos, record equivalent closeout context in tracked docs instead of inventing a fake issue queue.
86+
- In Codex Workspace, a request to update a tracked handover should also trigger the matching `workspace-memory` closeout after the docs update:
87+
repo-specific handover updates should run `tools/bin/workspace-memory save-repo <repo-name>`, and workspace-level handover updates should run `tools/bin/workspace-memory save-workspace`.
88+
- If both repo and workspace handover surfaces changed in one slice, run those MemPalace closeout commands serially so they do not contend on the same local store.
89+
- Before closing the chat, run a quick `git status` sanity check and confirm any changed public doc surfaces still agree, especially `README.md`, `docs/README.md`, `docs/CHANGELOG.md`, and the relevant repo-local README.
8690

8791
## What this baseline does not require
8892

docs/20-ai-context-side-load.md

Lines changed: 195 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,195 @@
1+
# 20-ai-context-side-load
2+
3+
## Purpose
4+
5+
This note defines the concrete v1 side-load layer for Codex Workspace.
6+
7+
The goal is to make the existing layered context model operational by generating small, disposable `L0` and `L1` summaries under `cache/context/` without changing the canonical source-of-truth rule.
8+
9+
This note is implementation-specific. It does not replace [07-context-cache-and-retrieval.md](07-context-cache-and-retrieval.md).
10+
11+
## Scope
12+
13+
V1 covers:
14+
15+
- workspace-level summaries
16+
- one repo-level summary target: `workspace-hub`
17+
- provenance metadata in `sources.json`
18+
- a dry-run-first generator script
19+
- one Workspace Hub read path for repo-detail side-load freshness and file-open actions
20+
21+
V1 does not cover:
22+
23+
- tracked side-load files
24+
- automatic regeneration during bootstrap or release checks
25+
- task-bundle generation
26+
- summary writes from Workspace Hub
27+
- broad per-repo rollout across every repo in `repos/`
28+
29+
## Canonical versus generated context
30+
31+
The split stays explicit:
32+
33+
- tracked docs, manifests, and repo files remain canonical
34+
- generated side-load files under `cache/context/` are disposable working summaries
35+
36+
If generated summaries disagree with tracked repo truth, regenerate or ignore the cache.
37+
38+
## Generated layout
39+
40+
V1 generates only these paths:
41+
42+
```text
43+
cache/context/
44+
├── workspace/
45+
│ ├── abstract.md
46+
│ ├── overview.md
47+
│ └── sources.json
48+
└── repos/
49+
└── workspace-hub/
50+
├── abstract.md
51+
├── overview.md
52+
└── sources.json
53+
```
54+
55+
Agent-job bundles under `cache/context/agents/jobs/` remain a separate local artifact path created by `tools/scripts/init-agent-job-bundle.sh`.
56+
57+
## Generator
58+
59+
Use:
60+
61+
```bash
62+
tools/scripts/generate-context-cache.sh --workspace
63+
tools/scripts/generate-context-cache.sh --workspace --print
64+
tools/scripts/generate-context-cache.sh --workspace --run
65+
tools/scripts/generate-context-cache.sh --repo workspace-hub --run
66+
```
67+
68+
Behavior:
69+
70+
- dry-run by default
71+
- `--print` shows the generated content on stdout
72+
- `--run` writes files into `cache/context/`
73+
- `--repo <name>` resolves a repo name under `repos/` and rejects unsafe path input
74+
75+
## Chat handover protocol
76+
77+
Use this when starting a fresh chat that needs repo-aware handover context.
78+
79+
Recommended sequence:
80+
81+
1. treat tracked docs as canonical and start with the relevant handover or README surface
82+
2. refresh the side-load cache if the session is broad, new, or likely to re-read workspace context repeatedly
83+
3. let the chat use generated `abstract.md` and `overview.md` as the fast entry layer
84+
4. fall back to tracked docs, manifests, and repo files for any real decision or ambiguity
85+
5. regenerate or ignore the cache if Workspace Hub reports the side-load state as `stale` or `missing`
86+
87+
Practical operator flow:
88+
89+
```bash
90+
tools/scripts/generate-context-cache.sh --workspace --run
91+
tools/scripts/generate-context-cache.sh --repo workspace-hub --run
92+
```
93+
94+
Then start the chat with a handover instruction such as:
95+
96+
> Read `docs/HANDOVER.md` first for the current workspace state. Use generated side-load files under `cache/context/` only as a compact entry layer, and treat tracked docs and repo files as canonical.
97+
98+
For repo-specific work, point the chat at the relevant repo README or handover note as well as the repo side-load cache when it exists.
99+
100+
## Source set
101+
102+
### Workspace
103+
104+
- `README.md`
105+
- `AGENTS.md`
106+
- `docs/07-context-cache-and-retrieval.md`
107+
- `docs/08-first-run-and-updates.md`
108+
- `docs/09-new-repo-baseline.md`
109+
- `repos/workspace-hub/README.md`
110+
111+
### Repo: `workspace-hub`
112+
113+
- `repos/workspace-hub/README.md`
114+
- optional `repos/workspace-hub/AGENTS.md`
115+
- optional `repos/workspace-hub/.workspace/project.json`
116+
117+
## Summary contracts
118+
119+
### `abstract.md`
120+
121+
Use this as the `L0` entry check.
122+
123+
It should stay small enough for quick relevance decisions and answer:
124+
125+
- what this workspace or repo is
126+
- what kind of surface it is
127+
- the main runtime or entrypoint
128+
- the main constraint or warning
129+
130+
### `overview.md`
131+
132+
Use this as the `L1` planning summary.
133+
134+
It should stay compact enough for planning and answer:
135+
136+
- major directories or surfaces
137+
- main commands
138+
- runtime assumptions
139+
- main rules
140+
- next canonical docs to open when more detail is needed
141+
142+
## Provenance contract
143+
144+
Each `sources.json` file uses this structure:
145+
146+
```json
147+
{
148+
"version": 1,
149+
"scope": "workspace",
150+
"target": "workspace",
151+
"generatedAt": "2026-04-10T12:00:00Z",
152+
"generator": {
153+
"path": "tools/scripts/generate-context-cache.sh"
154+
},
155+
"inputs": [
156+
{
157+
"path": "README.md",
158+
"role": "workspace-readme",
159+
"bytes": 14786,
160+
"mtimeMs": 1775858522000.0,
161+
"sha256": "..."
162+
}
163+
],
164+
"outputs": [
165+
{
166+
"path": "cache/context/workspace/abstract.md",
167+
"role": "abstract"
168+
}
169+
]
170+
}
171+
```
172+
173+
Rules:
174+
175+
- `sha256` is stored for provenance and debugging
176+
- freshness checks compare current file existence and recorded `mtimeMs`
177+
- output freshness depends on `abstract.md`, `overview.md`, and `sources.json` all existing
178+
179+
## Workspace Hub behavior
180+
181+
Workspace Hub consumes repo side-load data only during repo-detail hydration.
182+
183+
It does not load side-load metadata during the base-summary discovery path.
184+
185+
The details panel should show:
186+
187+
- `missing` when no valid repo side-load cache exists
188+
- `fresh` when all declared inputs still exist, `mtimeMs` values still match, and required outputs exist
189+
- `stale` when an input changed or disappeared, or a required output file is missing
190+
191+
The Hub can open the generated `abstract.md`, `overview.md`, and `sources.json` files directly through the existing generic open-path route.
192+
193+
## Practical rule
194+
195+
Use the side-load layer to reduce repeated high-signal doc loading, not to replace tracked workspace guidance.

docs/CHANGELOG.md

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,13 @@
22

33
## 2026-04-10
44

5+
- Bumped the workspace baseline release to `v1.2.1` and updated `repos/workspace-hub` to `1.2.1` to capture the AI side-load cache flow, handover-closeout automation, and the serialized `workspace-memory` write path.
6+
- Updated the workspace workflow so an explicit handover-update request now implies the matching `workspace-memory` closeout: repo-scoped handovers should trigger `save-repo`, workspace-scoped handovers should trigger `save-workspace`, and mixed closeout should run serially.
7+
- Hardened `tools/bin/workspace-memory` write-heavy commands with a re-entrant workspace lock under `cache/mempalace/<user>/locks/`, so overlapping `save-repo`, `save-workspace`, `mine-*`, and `wake-up` runs serialize instead of contending on the same local MemPalace SQLite and Chroma state.
58
- Bumped the workspace baseline release to `v1.2.0` and updated `repos/workspace-hub` to `1.2.0` to capture the finished MemPalace search flow, onboarding alignment, Memory Graph Phase 1, and the managed MCP v1 rollout.
9+
- Added `docs/20-ai-context-side-load.md` plus `tools/scripts/generate-context-cache.sh` so Codex Workspace now has a dry-run-first generator for workspace and `workspace-hub` side-load summaries under ignored `cache/context/` paths.
10+
- Updated `docs/07-context-cache-and-retrieval.md`, the root README, the docs index, and the Workspace Hub README so the concrete side-load contract, generator entrypoint, and canonical-versus-generated split are discoverable from the public surfaces.
11+
- Extended `tools/scripts/bootstrap-workspace.sh` to prepare `cache/context/repos/`, and updated Workspace Hub repo details so selected repos can show side-load freshness plus open actions for generated `abstract.md`, `overview.md`, and `sources.json` files without loading side-load metadata on the base-summary path.
612
- Hardened the managed Playwright and Chrome DevTools wrappers against bad host environments where `HOME=/`, by falling back to workspace-owned runtime and npm-cache paths under `cache/` and forcing Playwright into isolated mode with a stable output directory.
713
- Added the MCP v1 operating-model pack as `docs/15-mcp-profiles-and-trust-levels.md` through `docs/19-mcp-authoring-rules.md`, preserving the existing `10` through `14` docs and turning the older generic MCP note into a concrete support boundary.
814
- Added tracked MCP profile and server examples under `tools/templates/mcp/`, plus repo-safe `workspace-hub` examples under `repos/workspace-hub/.workspace/mcp/`.

0 commit comments

Comments
 (0)