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: 4 additions & 0 deletions .ai/agent-practices.md
Original file line number Diff line number Diff line change
Expand Up @@ -52,6 +52,10 @@ verifies claims with **executed evidence** — actually running the command, the
`git log`/`git show`/`wc -l` check — rather than re-reading the diff and trusting the prose.
Findings get fixed, then re-reviewed, until the loop is clean.

Review checklist:

- the docs touched describe what this PR changes

## 4. Shell pitfalls in an agent harness

Commands that read fine to a human can silently misbehave or get blocked in an agent
Expand Down
7 changes: 7 additions & 0 deletions .ai/contexts/activitywatch.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,10 @@
---
covers:
- "public/activity-reporting-panel.js"
- "src/main/integrations/activitywatch/activitywatch-client.js"
- "src/main/integrations/activitywatch/activitywatch-reporter.js"
---

# Context: activitywatch

Switchboard reports session activity to a local [ActivityWatch](https://activitywatch.net)
Expand Down
11 changes: 11 additions & 0 deletions .ai/contexts/app-dialogs.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,14 @@
---
covers:
- "public/choice-dialog.js"
- "public/resume-guard.js"
- "public/app-dialogs.js"
- "public/app-notices.js"
- "public/dialogs.js"
- "public/modal-stack.js"
- "src/main/app/ui-notice-log.js"
---

# Renderer modal stack and questions

## Runtime launch form (#1201)
Expand Down
19 changes: 19 additions & 0 deletions .ai/contexts/bg-agents.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,22 @@
---
covers:
- "claude-binary.js"
- "delete-session-guard.js"
- "public/resume-guard.js"
- "bridge-session-id.js"
- "project-root.js"
- "public/agents-view.js"
- "public/app.js"
- "sidebar-bg-sessions.js"
- "src/main/bg-agents/bg-agents-ipc.js"
- "src/main/bg-agents/bg-agents-roster.js"
- "src/main/bg-agents/bg-agents.js"
- "src/main/bg-agents/bg-handoff.js"
- "src/main/bg-agents/bg-worker-liveness.js"
- "src/main/app/session-exit.js"
- "src/main/terminals/tab-input-lock.js"
---

# Context: bg-agents

## Scheduled background jobs (#611, CLI 2.1.302 Windows measurements)
Expand Down
47 changes: 34 additions & 13 deletions .ai/contexts/build-release.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,17 @@
---
covers:
- ".github/workflows/build.yml"
- ".github/workflows/pr-title.yml"
- ".github/workflows/release-provenance.yml"
- ".github/workflows/test.yml"
- "package.json"
- "scripts/check-release-provenance.js"
- "scripts/check-release-tag.js"
- "scripts/lint-pr-title.js"
- "scripts/platform-tests.js"
- "scripts/publish-release.sh"
---

# Build and release workflow

## Advisory PR title check
Expand Down Expand Up @@ -314,19 +328,26 @@ no dependency) and is blocking; its rules are in
[changelog.md](../../docs/changelog.md#doc-references).

The `docs` job invokes `scripts/check-docs.js` with the PR base/head SHAs and
repository/PR number, full checkout history and `GH_TOKEN`. It reuses
`check-changelog.js`'s app-path classification and label validation, reads a
NUL-delimited `git diff --name-only --no-renames <base>...<head>`, and fetches
current labels via `gh api`. App changes need a changed `docs/`, `.ai/contexts/`
or `README.md` path, or the exact `no-docs` label; non-app changes pass.
Errors reading inputs fail closed with exit 2; missing docs exits 1.
`test/check-docs.test.js` loads the real script with plain require and a VM
with a filename, substituting only command execution for the CLI checks.
The rule and PR-body requirements are in [changelog.md](../../docs/changelog.md#documentation-in-the-same-pr).
The gate does not assess relevance, require both doc categories, or parse the
PR body. Adding the label requires a job rerun, as for `no-changelog`.
Creating the label and making `docs` a required check are separate repository
administration actions; this workflow does neither.
repository/PR number, full checkout history and `GH_TOKEN`. Node 22 installs
locked dependencies with lifecycle scripts disabled for the existing js-yaml
parser. The gate reuses the changelog app-path classification, reads a
NUL-delimited diff with renames disabled and fetches live labels and PR body.
Covered non-hub app changes need a changed doc whose `covers` matches them.
The explicit hub list in the checker accepts any eligible coverage doc with a
non-whitespace body change. The gate reads docs from the PR head and compares
bodies with the merge base, ignoring metadata and whitespace-only edits.
Uncovered non-hub app files accept any changed eligible coverage doc; ADRs,
product pages, `_issues.md` and READMEs do not count. Uncovered files are printed
as an advisory inventory.
The exact `no-docs` label requires a nonempty `no docs: <reason>` body line.
Unknown metadata keys, malformed covers or globs without a tracked match fail
even a docs-only PR. Metadata is validated here so the gate cannot rely on
invalid declarations. Operational failures exit 2; missing docs or invalid
coverage exit 1. Unit tests load the real script with plain require and a VM
with a filename; only CLI command/filesystem boundaries are substituted.
The rule is in [changelog.md](../../docs/changelog.md#documentation-in-the-same-pr).
Review still assesses the prose. Adding the label or editing the reason needs
a rerun. Required-check settings and label creation remain separate actions.

Linux runs the full Node suite with coverage. Every non-Linux runner runs
`node scripts/run-tests.js --platform-only` without c8; its matrix and job
Expand Down
12 changes: 12 additions & 0 deletions .ai/contexts/changes-view.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,15 @@
---
covers:
- "public/file-panel.js"
- "src/main/changes/git-changes-file.js"
- "src/main/changes/git-changes-runner.js"
- "src/main/changes/git-changes-target.js"
- "src/main/changes/git-changes-watch.js"
- "src/main/changes/git-changes.js"
- "src/main/remote/remote-attach.js"
- "src/main/shared/run-to-exit.js"
---

# Context: changes-view

## Local file toolbar actions (#1203)
Expand Down
14 changes: 14 additions & 0 deletions .ai/contexts/cli-harnesses.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,17 @@
---
covers:
- "main.js"
- "harnesses/claude.js"
- "harnesses/codex.js"
- "harnesses/contract.js"
- "harnesses/index.js"
- "jsonl-scan.js"
- "read-session-file.js"
- "scripts/launcher-env.js"
- "session-cache.js"
- "src/main/usage/codex-usage.js"
---

# CLI harness port

## Isolated developer launchers (#1314)
Expand Down
13 changes: 12 additions & 1 deletion .ai/contexts/cli-session-state.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,14 @@
---
covers:
- "bridge-session-id.js"
- "cli-session-state.js"
- "public/resume-guard.js"
- "src/main/cli/proc-start.js"
- "src/main/cli/session-state-v1.js"
- "src/main/terminals/windows-job-helper.js"
- "src/main/triggers/session-status.js"
---

# Context: cli-session-state

The process-table timeout is an `execFile` child-kill budget, not a hard
Expand Down Expand Up @@ -211,7 +222,7 @@ including the `session-live-elsewhere` and `sessions-live-elsewhere` IPCs),
Related code: `src/main/cli/session-state-v1.js` (V1 reader), `src/main/cli/proc-start.js`,
`src/main/projects/project-delete-main.js` (deletion snapshot),
`src/main/triggers/trigger-context.js` (trigger consumer; `src/main/triggers/session-status.js`
builds the 2 s status deadline), `src/main/terminals/windows-job-helper.ps1` (`observe`).
builds the 2 s status deadline), `src/main/terminals/windows-job-helper.js` (`observe`).
Only Claude descriptors are read (`~/.claude/sessions`, `DEFAULT_DIR`); nothing in
this module or `public/resume-guard.js` reads Codex state.

Expand Down
47 changes: 44 additions & 3 deletions .ai/contexts/fast-check.md
Original file line number Diff line number Diff line change
@@ -1,14 +1,34 @@
---
covers:
- ".husky/pre-commit"
- "Taskfile.yaml"
- "scripts/check-doc-refs.js"
- "scripts/check-docs.js"
- "scripts/check-fast.js"
- "scripts/run-tests.js"
---

# Fast pre-commit check

`scripts/check-fast.js` is the common entry point for `task check:fast` and
the hook's fallback when Task is absent. `SKIP_TESTS` with any nonempty value
skips tests, retaining staged-JS lint in both routes. When any staged path ends
in `.md`, it first spawns `scripts/check-doc-refs.js --root <cwd>` (the whole
tree, about a second) and returns its status if nonzero; `SKIP_TESTS` does not
skip it. A rename in JavaScript that breaks a doc is caught by `task check` and
skip it. Reference scanning skips initial YAML front matter, retaining body
line numbers. Coverage declarations are validated by `scripts/check-docs.js --validate` in
`Taskfile.yaml` (`task check`), by the real-checkout regression in
`test/check-docs.test.js`, and by the PR docs gate. The PR gate requires a body
change in a matching owner doc for non-hubs, comparing the PR head with the
merge base, and prints uncovered files. The explicit `HUB_FILES` set in
`scripts/check-docs.js` accepts a non-whitespace body change in any eligible
coverage doc. Metadata-only and whitespace-only edits do not count, and the
uncovered-file fallback excludes ADRs, product pages, `_issues.md` and READMEs.
Root patterns must be exact paths; each file still has at most four owners.
`public/resume-guard.js` keeps the three contexts describing its decisions and
wording plus the session-restore user page as its four owners. A rename in JavaScript that breaks a doc is caught by `task check` and
the `docs-refs` CI job, not here. Rules are in
[changelog.md](../../docs/changelog.md#doc-references). `task check` and the full
suite runner remain unchanged and are the required gate before a PR.
[changelog.md](../../docs/changelog.md#doc-references). `task check` and the full suite remain the required gate before a PR.

The script reads `git diff --cached --name-only --diff-filter=ACMR -z`, so
deleted paths are excluded and spaces survive. The exported pure `selectTests`
Expand Down Expand Up @@ -38,3 +58,24 @@ required CI and `task check` cover unrelated regressions.
real lint and test execution and leaving files and the index untouched.
`test/check-fast.test.js` exercises mapping, orchestration, errors and wiring;
external command spawning is replaced only at its process boundary.

## Coverage ownership

`covers` records substantive documentation, not path mentions or test inventories.
ADRs, product docs, `_issues.md` and all navigation READMEs are excluded.
Patterns require a literal prefix; leading wildcards are rejected. There is no
files-per-pattern cap: validation instead limits each tracked file to four
distinct owner documents, even when a no-docs waiver is present.

The hub owner sets are deliberately narrow:

| File | Owners and substantive sections |
|---|---|
| `main.js` | ipc-bridge (IPC contracts), cli-harnesses (launching), window-frame (construction and exit) |
| `preload.js` | ipc-bridge (public surface), window-frame (exit handshake and native dialogs) |
| `public/app.js` | bg-agents (background restore), session-cache (startup and project projections), session-state (restore and lifecycle), docs/session-restore (restore behavior) |
| `public/sidebar.js` | session-cache (search and grouping), session-state (row state and lifecycle), subagent-observability (child rows), docs/session-browser (browser behavior) |
| `session-cache.js` | session-cache (index and watcher), cli-harnesses (harness folder dispatch), subagent-observability (subagent projection) |

The PR template and checker accept `- no docs: <reason>` on its own line with
the exact `no-docs` label. Replace the placeholder with a nonempty reason.
25 changes: 25 additions & 0 deletions .ai/contexts/ipc-bridge.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,28 @@
---
covers:
- "claude-auth.js"
- "delete-session-target.js"
- "public/utils.js"
- "src/main/terminals/stop-process-tree.js"
- "public/session-projection-diagnostics.js"
- "src/main/projects/last-known-projects.js"
- "main.js"
- "preload.js"
- "public/archived-manager.js"
- "public/activity-trace.js"
- "src/main/app/main-error-handlers.js"
- "src/main/shared/diagnostic-files.js"
- "src/main/shared/activity-trace.js"
- "src/main/shared/ipc-path-validator.js"
- "src/main/shared/resolve-path-on-disk.js"
- "src/main/terminals/pre-launch-cmd-guard.js"
- "src/main/terminals/pty-ops.js"
- "src/main/triggers/trigger-renderer-bridge.js"
- "src/main/terminals/windows-job-helper.js"
- "src/main/shared/clean-env.js"
- "worktree-delete.js"
---

# Context: ipc-bridge

## UI notice log (#1196)
Expand Down
10 changes: 10 additions & 0 deletions .ai/contexts/managed-browser.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,13 @@
---
covers:
- "src/main/browser/discovery.js"
- "src/main/browser/linux-process.js"
- "src/main/browser/managed-browser.js"
- "src/main/browser/owner-lock.js"
- "src/main/browser/storage.js"
- "src/main/browser/transport.js"
---

# Managed browser lifecycle (#812)

`src/main/browser/managed-browser.js` exports `createManager` and
Expand Down
6 changes: 6 additions & 0 deletions .ai/contexts/module-moves.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,9 @@
---
covers:
- "scripts/module-paths.js"
- "scripts/move-modules.js"
---

# Module-move tooling

`scripts/move-modules.js` plans reference rewrites using `scripts/module-paths.js`.
Expand Down
9 changes: 9 additions & 0 deletions .ai/contexts/panel-terminal.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,12 @@
---
covers:
- "public/panel-terminal.js"
- "public/file-panel.js"
- "public/splitter.js"
- "public/terminal-manager.js"
- "src/main/terminals/panel-terminal-target.js"
---

# Context: panel-terminal

**Purpose**: a shell inside the right-hand file panel, below whatever the panel
Expand Down
6 changes: 6 additions & 0 deletions .ai/contexts/plain-terminal.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,9 @@
---
covers:
- "src/main/terminals/plain-terminal-shell.js"
- "src/main/terminals/shell-profiles.js"
---

# Context: plain-terminal

**Purpose**: a plain terminal (sidebar "+" → Terminal, and the panel shell of
Expand Down
8 changes: 8 additions & 0 deletions .ai/contexts/project-delete.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,11 @@
---
covers:
- "derive-project-path.js"
- "public/archived-manager.js"
- "src/main/projects/project-archive-workflow.js"
- "src/main/projects/project-delete*.js"
---

# Project deletion (#474 A4a–A4d, E)

## Repository session grouping (#1137)
Expand Down
5 changes: 5 additions & 0 deletions .ai/contexts/project-operation-gate.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,8 @@
---
covers:
- "src/main/shared/project-operation-gate.js"
---

# Project operation gate (#474 A3)

`src/main/shared/project-operation-gate.js` exports the main-process singleton
Expand Down
15 changes: 15 additions & 0 deletions .ai/contexts/schedule-runner.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,18 @@
---
covers:
- "src/main/shared/normalize-project-path.js"
- "public/schedules-view.js"
- "src/main/schedules/run-schedule-now-target.js"
- "src/main/schedules/schedule-background.js"
- "src/main/schedules/schedule-delete-file.js"
- "src/main/schedules/schedule-history-import.js"
- "src/main/schedules/schedule-ipc.js"
- "src/main/schedules/schedule-list.js"
- "src/main/schedules/schedule-run-results.js"
- "src/main/schedules/schedule-runner.js"
- "src/main/schedules/schedules-tab-migration.js"
---

# Context: schedule-runner

## Opt-in background runs (#611)
Expand Down
Loading
Loading