Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions .codex/restore-product-context.mjs
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,7 @@ async function restoreProductContext() {
const rule = [
'CODEBOOK: RESTORE PRODUCT CONTEXT AFTER COMPACTION',
`Repository root: ${root}`,
"The owner's most important rule: before any other work after this compaction, whatever the task, read PRODUCT_GOAL.md in full, every line, and open the approved PNG (docs/designs/assets/codebook-product-spec-v9.png) with an image-viewing tool and check its identity against PRODUCT_GOAL.md's Design target; then read the active cycle Issue (the open Issue with the label `cycle`) with its comments and AGENTS.md in full from disk. A compacted summary or this reminder is not evidence of those reads or of the image inspection.",
"The owner's most important rule: before any other work after this compaction, whatever the task, read PRODUCT_GOAL.md in full, every line, and open the approved PNG (docs/designs/assets/codebook-product-spec-v9.png) with an image-viewing tool and check its identity against PRODUCT_GOAL.md's Design target; then read the active cycle Issue (the open Issue with the label `cycle`) with its comments. AGENTS.md is loaded into context automatically as project instructions; read it from disk only when its text is not in your context or it changed on disk since the session began. A compacted summary or this reminder is not evidence of those reads or of the image inspection.",
'Reconcile the current source and affected acceptance gaps, then resume the latest owner-authorized task. Preserve pending owner instructions and any explicit pause; this reminder grants no additional work scope.',
]
const found = RESTORED_SECTIONS.map((heading) => ({
Expand All @@ -73,7 +73,7 @@ async function restoreProductContext() {
const full = [
...rule,
...missingNote,
'These AGENTS.md sections follow verbatim; read the whole file on disk and resolve its relative links from the repository root:',
'These AGENTS.md sections follow verbatim; the whole file is in your project instructions (read it on disk when it is not), and its relative links resolve from the repository root:',
...sections,
].join('\n\n')
// A grown AGENTS.md must never push the rule out of the inline context: keep the rule and point to the file.
Expand Down
2 changes: 1 addition & 1 deletion .codex/restore-product-context.test.mjs
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,7 @@ function runHookBeside(agentsText) {
}
}

// Value: protects=the owner's 2026-10-21 rule reaching the agent whole after every compaction (PRODUCT_GOAL.md in full and the PNG, then the Issue and AGENTS.md); fails_when=the hook prints all of AGENTS.md (Claude Code then injects only a 2,000-character preview), the rule leaves the first 2,000 characters, or a restored section differs from AGENTS.md; no_claim=that the agent actually performs the reads
// Value: protects=the owner's 2026-10-21 rule reaching the agent whole after every compaction (PRODUCT_GOAL.md in full and the PNG, then the Issue; AGENTS.md from disk only when it is not in context or changed, owner 2026-10-26); fails_when=the hook prints all of AGENTS.md (Claude Code then injects only a 2,000-character preview), the rule leaves the first 2,000 characters, or a restored section differs from AGENTS.md; no_claim=that the agent actually performs the reads
test('compaction restores the re-entry rule and the Mandatory entry and Owner directions sections within the inline limit', () => {
// Arrange
const config = JSON.parse(
Expand Down
2 changes: 2 additions & 0 deletions .github/workflows/storage-locks-windows.yml
Original file line number Diff line number Diff line change
Expand Up @@ -141,6 +141,8 @@ on:
- extension/src/utils/systemErrorCode.ts
- extension/src/utils/trimMatchingEnds.ts
- extension/src/utils/unopenedFileCode.ts
- extension/src/utils/wikiRunBoundMs.ts
- extension/src/utils/wikiUpdateRun.ts
- extension/src/utils/windowsPowerShellPath.ts
- extension/src/utils/withStorageLock.ts
- extension/src/utils/withoutBootTime.ts
Expand Down
4 changes: 2 additions & 2 deletions AGENTS.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ Single operational entry point for every coding agent; Codex and Claude Code (v2
Before planning, implementation or runtime trials:

1. New session, or PRODUCT_GOAL.md changed: read [PRODUCT_GOAL.md](PRODUCT_GOAL.md) in full except `## Final acceptance protocol`; open [the approved PNG](docs/designs/assets/codebook-product-spec-v9.png) with an image tool; read the active cycle Issue (open, label `cycle`) with comments (`gh issue view <N> --comments`).
2. After every context compaction, before any other work, whatever the task: read PRODUCT_GOAL.md in full, every line; open the PNG with an image tool and check its identity; then read the active cycle Issue with comments and this file in full. Owner's most important rule (2026-10-21): the goal and the image are the final product every token is spent for; a plan or change made without them is waste. A compacted summary, the restore hook's text or an earlier read is no substitute.
2. After every context compaction, before any other work, whatever the task: read PRODUCT_GOAL.md in full, every line; open the PNG with an image tool and check its identity; then read the active cycle Issue with comments. This file is loaded into context automatically as project instructions (Claude Code and Codex): read it from disk again only when its text is not in your context or it changed on disk since the session began (owner, 2026-10-26). Owner's most important rule (2026-10-21): the goal and the image are the final product every token is spent for; a plan or change made without them is waste. A compacted summary, the restore hook's text or an earlier read is no substitute.
3. Final acceptance selected: read [`## Final acceptance protocol`](PRODUCT_GOAL.md#final-acceptance-protocol).

The PNG is the product to build:
Expand Down Expand Up @@ -402,7 +402,7 @@ Single-context: one root `GLOSSARY.md` and `docs/adr/`, created lazily. See `doc

[`.codex/hooks.json`](.codex/hooks.json) registers only `SessionStart` with `^compact$` (startup and resume ignored). Claude Code runs the same command from `.claude/settings.json`, the only shared Claude file (`compact` matcher, 5 s timeout).

- The command (Node, Git, POSIX shell) prints ≤ 10,000 characters: the owner's re-entry rule first (PRODUCT_GOAL.md in full + the PNG, then the Issue and this file in full), the scope and pause sentence, then this file's `## Mandatory entry` and `## Owner directions in force` verbatim. Why: Claude Code injects longer hook context only as a 2,000-character preview + file path; printing this whole file once cut the restore order.
- The command (Node, Git, POSIX shell) prints ≤ 10,000 characters: the owner's re-entry rule first (PRODUCT_GOAL.md in full + the PNG, then the Issue; this file from disk only when it is not in context or changed), the scope and pause sentence, then this file's `## Mandatory entry` and `## Owner directions in force` verbatim. Why: Claude Code injects longer hook context only as a 2,000-character preview + file path; printing this whole file once cut the restore order.
- Sections outgrowing the limit → it prints the rule and points to this file.
- Missing or renamed section (CRLF line ends and trailing spaces after a heading tolerated) → rule still printed; names what is missing on stderr; exit 0.
- Restores no editing gate or Stop continuation.
Expand Down
28 changes: 28 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,33 @@
# Changelog

## [0.2.45.0] - 2026-10-26 (development candidate)

Cycle 0055 ([Issue #132](https://github.com/laststance/codebook/issues/132)), a feature cycle, first of its two pull requests: Codebook generates a project's first LLM Wiki from its own commands. The LLM Wiki view in the Activity Bar and the native trial follow in the second.

**Generate a project's first LLM Wiki from Codebook.**

- **Codebook: Generate LLM Wiki** writes the first Wiki of a folder that has none through your editor's agent and the bundled skill's DeepWiki procedure: in VS Code a new Copilot Chat session gets the generate request, in Cursor the Cursor Agent CLI (`cursor-agent`) runs it. No runtime MCP connection, debugger or application is needed.
- **A confirmation comes first** and names the folder the Wiki is written to and where the request goes; **Change location** opens the `codebook.wikiOutputDirectory` setting and starts nothing. In VS Code it says that the chat asks you to approve its commands and may ask you to Continue.
- **Codebook waits up to 55 minutes** for the publish, in both editors, and says `LLM Wiki generated in <folder>.` with **Open in Browser**. A Wiki published while sources changed says how many files changed and offers **Update LLM Wiki** first.
- **It never overwrites a Wiki:** a folder that already holds one gets `An LLM Wiki already exists in <folder>. Update it instead?`, also when one appears while you confirm. A folder that exists but holds no Wiki is refused before any agent starts, since the publisher writes a first Wiki only into a folder it makes itself; its files stay.
- **In Cursor, the managed skill is readied first**, for a generation and an update alike, once the run's checks have passed: a missing or outdated skill is installed, a skill of your own named `codebook` refuses the run and stays.
- **Every ending says what was left and the next step**: stopped, timed out, finished without publishing, a publication of another checkout, a missing entry page, a manifest that cannot be read, a publish still running. A stop names a Wiki as published only for a verified publish. The README's new troubleshooting section lists each sentence.

**Stop a run and read its record.**

- **Codebook: Stop LLM Wiki Run** stops this window's generation or update: in VS Code Codebook's watch (the chat may still publish, and a new start waits for it), in Cursor the agent. During a start that has not begun its run, it says that a run is starting.
- **Codebook: Show LLM Wiki Output** opens Output › Codebook, where every generation or update writes one record: its kind, host, start and end, how it ended, the agent's exit code and the folder, with your home folder as `~`. It never holds the agent's or the chat's text.

**Changed.**

- **Open LLM Wiki in Browser** is the new title of Open DeepWiki in Browser (its command id is unchanged), and the reader's offline note names it.
- **Open LLM Wiki in Browser and Update LLM Wiki in a folder without a Wiki** say `Codebook found no LLM Wiki in <folder>.` and offer **Generate LLM Wiki** instead of a chat request to retype; while a generation is under way they name it instead.
- **The VS Code watch's status bar entry reads `Watching for the LLM Wiki · Stop watching`** (it was `· Cancel`): it stops Codebook's watch, not the chat.
- **Generate anyway, Update anyway and "Update it instead?"** pressed while another run of the window works are told at once, instead of starting a second run when that one ends.
- **A marker file of a run that cannot be read** counts for up to 61 minutes 30 seconds after its last write (the longest generation with its grace), not 21 minutes 30 seconds.
- **The bundled skill moves to 1.0.49** for the reader's offline note.
- **Several windows:** update every window of a project to this version before generating; an older Codebook reads a generation's marker as an update's and may start beside it after 15 minutes.

## [0.2.44.0] - 2026-10-26 (development candidate)

Cycle 0054 ([Issue #130](https://github.com/laststance/codebook/issues/130)), a bug-fix cycle: the three defects Cycle 0053 carried.
Expand Down
5 changes: 3 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ Codebook contributes `debug.focusEditorOnBreak: false` as the native debugger de

## Implementation status

This is a preview, not a Marketplace or Open VSX release. The delivered version is **0.2.44.0** once the pull request of [Cycle 0054](https://github.com/laststance/codebook/issues/130) is merged; until then 0.2.43.0 ([PR #129](https://github.com/laststance/codebook/pull/129)) is the delivered one, and the active cycle Issue says where the delivery stands. Cycle 0053 was a feature cycle: a test inside a workspace package runs with that package's Vitest and config, as the package's own `vitest` would, while a test the repository root's config already selects keeps running from the root. Cycle 0054 is a bug-fix cycle that closes the three defects Cycle 0053 carried: a test that ends before a later declared stop says so, a package test's launch asks the repository root again whether its config now selects the test, and the native-trial bootstrap keeps a listing it could not release. Cycle 0051 opened a test replay in the learning-replay composition a browser replay has: the Learning summary in the chat's place, one transport for both replay families, and a Learning summary button that shows a hidden summary again. Cycle 0052 was a bug-fix cycle that closed every defect Cycle 0051 carried, in three pull requests: the first makes replays leave, open and reload without stale frames and makes their entries and exits behave as the learner chose; the second fixes a test replay's moves and its summary page; the third the live runtime's unreadable facts, a browser run's refusals and the tests' hygiene. The MCP API is 1.8. What each earlier cycle delivered, with its tests, trials and limits, is in the [change history](CHANGELOG.md) and in that cycle's record, kept under the tag [`docs-archive-2026-10-20`](https://github.com/laststance/codebook/tree/docs-archive-2026-10-20/docs/cycles); from Cycle 0048 on, the cycle's Issue holds its tasks and state, and its pull requests the results.
This is a preview, not a Marketplace or Open VSX release. The delivered version is **0.2.45.0** once the first pull request of [Cycle 0055](https://github.com/laststance/codebook/issues/132) is merged; until then 0.2.44.0 ([PR #131](https://github.com/laststance/codebook/pull/131) of Cycle 0054) is the delivered one, and the active cycle Issue says where the delivery stands. [Cycle 0055](https://github.com/laststance/codebook/issues/132) is a feature cycle: **Codebook: Generate LLM Wiki** writes a project's first LLM Wiki through the editor's agent from Codebook's own entry (its first pull request), and an **LLM Wiki** view in the Activity Bar shows, opens and updates it (its second). Cycle 0053 was a feature cycle: a test inside a workspace package runs with that package's Vitest and config, as the package's own `vitest` would, while a test the repository root's config already selects keeps running from the root. Cycle 0054 is a bug-fix cycle that closes the three defects Cycle 0053 carried: a test that ends before a later declared stop says so, a package test's launch asks the repository root again whether its config now selects the test, and the native-trial bootstrap keeps a listing it could not release. Cycle 0051 opened a test replay in the learning-replay composition a browser replay has: the Learning summary in the chat's place, one transport for both replay families, and a Learning summary button that shows a hidden summary again. Cycle 0052 was a bug-fix cycle that closed every defect Cycle 0051 carried, in three pull requests: the first makes replays leave, open and reload without stale frames and makes their entries and exits behave as the learner chose; the second fixes a test replay's moves and its summary page; the third the live runtime's unreadable facts, a browser run's refusals and the tests' hygiene. The MCP API is 1.8. What each earlier cycle delivered, with its tests, trials and limits, is in the [change history](CHANGELOG.md) and in that cycle's record, kept under the tag [`docs-archive-2026-10-20`](https://github.com/laststance/codebook/tree/docs-archive-2026-10-20/docs/cycles); from Cycle 0048 on, the cycle's Issue holds its tasks and state, and its pull requests the results.

The specification is [goal version 10](PRODUCT_GOAL.md), and the implementation targets external repositories. Historical fixture or coupled-Wiki success is not proof of that destination.

Expand All @@ -42,7 +42,8 @@ Read [AGENTS.md](AGENTS.md) when starting or resuming work; Codex loads it as it
## Tracking and continuation

- [Goal Issue #1](https://github.com/laststance/codebook/issues/1) remains open until all acceptance conditions and owner acceptance hold.
- [Cycle 0054 Issue #130](https://github.com/laststance/codebook/issues/130) is the active cycle: a bug-fix cycle with no increment that closes the three defects Cycle 0053 carried (an unreached declared stop explains itself, a launch asks the root claim again, the native trial keeps unreleased listings); the Issue holds its tasks and state.
- [Cycle 0055 Issue #132](https://github.com/laststance/codebook/issues/132) is the active cycle: a feature cycle in which Codebook's Activity Bar generates, opens and updates the LLM Wiki, re-proven natively in both editors. Its baseline E1 measured a first generation at 34 min 33 s in VS Code and 4 min 14 s in Cursor's agent CLI, so a generation is bounded at 55 minutes.
- [Cycle 0054 Issue #130](https://github.com/laststance/codebook/issues/130) is closed after [PR #131](https://github.com/laststance/codebook/pull/131): a bug-fix cycle with no increment that closed the three defects Cycle 0053 carried (an unreached declared stop explains itself, a launch asks the root claim again, the native trial keeps unreleased listings); the Issue holds its tasks and state.
- [Cycle 0053 Issue #128](https://github.com/laststance/codebook/issues/128) is closed after [PR #129](https://github.com/laststance/codebook/pull/129): a feature cycle in which a test inside a workspace package runs with that package's Vitest and config (TanStack Query's and Redux Toolkit's library tests among the final-acceptance targets); the three defects it carried are the tasks of Cycle 0054.
- [Cycle 0052 Issue #124](https://github.com/laststance/codebook/issues/124) is closed after [PR #125](https://github.com/laststance/codebook/pull/125), [PR #126](https://github.com/laststance/codebook/pull/126) and [PR #127](https://github.com/laststance/codebook/pull/127): a bug-fix cycle with no increment that closed every defect Cycle 0051 carried (replays leave, open and reload without stale frames; a test replay's moves and summary page; the live runtime, a browser run's refusals and the tests' hygiene); it carried nothing.
- [Cycle 0051 Issue #122](https://github.com/laststance/codebook/issues/122) is closed after [PR #123](https://github.com/laststance/codebook/pull/123): a feature cycle that opens a test replay in the learning-replay composition a browser replay has, with the Learning summary in the chat's place and one transport; the defects it carried are the tasks of Cycle 0052.
Expand Down
2 changes: 1 addition & 1 deletion VERSION
Original file line number Diff line number Diff line change
@@ -1 +1 @@
0.2.44.0
0.2.45.0
Loading