@timurproko/a1 0.2.7-dev.1276 → 0.2.7-dev.1286

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (184) hide show
  1. package/README.md +5 -1
  2. package/dist/app/session-shell/session-shell-root.d.ts +4 -68
  3. package/dist/app/session-shell/session-shell.js +5 -11
  4. package/dist/app/session-shell/shell-host.js +2 -2
  5. package/dist/app/session-shell/shell-options.d.ts +65 -0
  6. package/dist/app/session-shell/shell-options.js +1 -0
  7. package/dist/app/session-shell/workflow-router.d.ts +3 -1
  8. package/dist/app/session-shell/workflow-router.js +12 -0
  9. package/dist/cli/dispatch.js +27 -1
  10. package/dist/cli/packages.js +18 -2
  11. package/dist/cli/session-context.js +6 -2
  12. package/dist/composition/owned-ui.js +20 -8
  13. package/dist/composition/session-naming.js +1 -1
  14. package/dist/composition/session-runtime-registry.d.ts +2 -0
  15. package/dist/composition/session-runtime-registry.js +49 -9
  16. package/dist/contracts/agent-engine/package-ports.d.ts +10 -14
  17. package/dist/contracts/agent-engine/package-ports.js +5 -9
  18. package/dist/contracts/owned-ui/session-workflows.d.ts +6 -0
  19. package/dist/contracts/presentation/index.d.ts +1 -0
  20. package/dist/contracts/presentation/progress-palette.generated.d.ts +1 -1
  21. package/dist/contracts/presentation/progress-palette.generated.js +1 -1
  22. package/dist/contracts/presentation/progress-spinner.d.ts +7 -0
  23. package/dist/contracts/presentation/progress-spinner.js +1 -0
  24. package/dist/features/launch/session-context.d.ts +8 -0
  25. package/dist/features/launch/session-context.js +19 -10
  26. package/dist/features/owned-ui/reference-screen-app.js +9 -5
  27. package/dist/features/owned-ui/session-fork-prompt.d.ts +2 -1
  28. package/dist/features/owned-ui/session-fork-prompt.js +11 -5
  29. package/dist/features/owned-ui/settings-app.d.ts +1 -1
  30. package/dist/features/owned-ui/settings-app.js +14 -7
  31. package/dist/features/owned-ui/settings-spinner-preview.d.ts +9 -0
  32. package/dist/features/owned-ui/settings-spinner-preview.js +29 -0
  33. package/dist/features/session-naming/context.d.ts +17 -0
  34. package/dist/features/session-naming/context.js +39 -0
  35. package/dist/features/session-naming/controller.d.ts +1 -5
  36. package/dist/features/session-naming/controller.js +7 -4
  37. package/dist/features/session-naming/generate.d.ts +2 -1
  38. package/dist/features/session-naming/generate.js +14 -10
  39. package/dist/features/session-naming/index.d.ts +1 -1
  40. package/dist/foundation/lifecycle/index.d.ts +3 -1
  41. package/dist/foundation/lifecycle/index.js +3 -1
  42. package/dist/foundation/lifecycle/session-claim-lock.d.ts +2 -2
  43. package/dist/foundation/lifecycle/session-claim-lock.js +36 -10
  44. package/dist/foundation/lifecycle/session-context-retry.d.ts +2 -0
  45. package/dist/foundation/lifecycle/session-context-retry.js +17 -0
  46. package/dist/foundation/lifecycle/session-repository-context.d.ts +7 -1
  47. package/dist/foundation/lifecycle/session-repository-context.js +105 -39
  48. package/dist/foundation/lifecycle/session-worktree-entry.d.ts +3 -0
  49. package/dist/foundation/lifecycle/session-worktree-entry.js +87 -0
  50. package/dist/foundation/release/automatic-update.js +2 -2
  51. package/dist/foundation/release/bootstrap.js +19 -3
  52. package/dist/foundation/release/index.d.ts +1 -1
  53. package/dist/foundation/release/index.js +1 -1
  54. package/dist/foundation/release/release-gc.js +41 -5
  55. package/dist/foundation/release/release-state.d.ts +48 -4
  56. package/dist/foundation/release/release-state.js +168 -31
  57. package/dist/foundation/release/release-use.d.ts +10 -0
  58. package/dist/foundation/release/release-use.js +86 -0
  59. package/dist/foundation/release/update-activation.d.ts +3 -1
  60. package/dist/foundation/release/update-activation.js +23 -6
  61. package/dist/foundation/release/update-recovery.js +2 -2
  62. package/dist/foundation/release/update.d.ts +3 -1
  63. package/dist/foundation/release/update.js +61 -22
  64. package/dist/foundation/release/warmup.js +8 -9
  65. package/dist/foundation/session-writer-lock/index.d.ts +2 -2
  66. package/dist/foundation/session-writer-lock/index.js +82 -12
  67. package/dist/foundation/startup/startup-descriptor.js +2 -2
  68. package/dist/foundation/terminal-cleanup/fatal-diagnostic.d.ts +2 -0
  69. package/dist/foundation/terminal-cleanup/fatal-diagnostic.js +59 -0
  70. package/dist/foundation/terminal-cleanup/fatal-exit.js +1 -29
  71. package/dist/integrations/pi/components/resources/builtin-themes.d.ts +2 -2
  72. package/dist/integrations/pi/components/resources/builtin-themes.js +2 -2
  73. package/dist/integrations/pi/components/share-operation-dialog.d.ts +2 -1
  74. package/dist/integrations/pi/components/share-operation-dialog.js +13 -5
  75. package/dist/integrations/pi/components/shell-footer-status.d.ts +2 -1
  76. package/dist/integrations/pi/components/shell-footer-status.js +15 -8
  77. package/dist/integrations/pi/components/shell-session-info-reference.js +11 -8
  78. package/dist/integrations/pi/components/upstream/adjacent/core/keybindings.d.ts +1 -1
  79. package/dist/integrations/pi/components/upstream/adjacent/core/keybindings.js +1 -1
  80. package/dist/integrations/pi/components/upstream/assets/earendil-image.json +2 -2
  81. package/dist/integrations/pi/components/upstream/components/auth-url.d.ts +1 -1
  82. package/dist/integrations/pi/components/upstream/components/auth-url.js +1 -1
  83. package/dist/integrations/pi/components/upstream/components/countdown-timer.d.ts +1 -1
  84. package/dist/integrations/pi/components/upstream/components/earendil-announcement.js +1 -1
  85. package/dist/integrations/pi/components/upstream/components/extension-editor.d.ts +1 -1
  86. package/dist/integrations/pi/components/upstream/components/extension-editor.js +1 -1
  87. package/dist/integrations/pi/components/upstream/components/extension-input.js +1 -1
  88. package/dist/integrations/pi/components/upstream/components/extension-selector.js +1 -1
  89. package/dist/integrations/pi/components/upstream/components/login-dialog.js +1 -1
  90. package/dist/integrations/pi/components/upstream/components/mermaid.js +1 -1
  91. package/dist/integrations/pi/components/upstream/components/oauth-selector.d.ts +1 -1
  92. package/dist/integrations/pi/components/upstream/components/oauth-selector.js +1 -1
  93. package/dist/integrations/pi/components/upstream/components/owned-editor.d.ts +1 -1
  94. package/dist/integrations/pi/components/upstream/components/owned-editor.js +1 -1
  95. package/dist/integrations/pi/components/upstream/components/pi-logo.js +1 -1
  96. package/dist/integrations/pi/components/upstream/components/scoped-models-selector.d.ts +1 -1
  97. package/dist/integrations/pi/components/upstream/components/session-footer.js +14 -8
  98. package/dist/integrations/pi/components/upstream/components/session-selector-search.js +1 -1
  99. package/dist/integrations/pi/components/upstream/components/session-selector.js +1 -1
  100. package/dist/integrations/pi/components/upstream/components/skill-invocation-message.d.ts +1 -1
  101. package/dist/integrations/pi/components/upstream/components/skill-invocation-message.js +1 -1
  102. package/dist/integrations/pi/components/upstream/components/status-indicator.d.ts +1 -1
  103. package/dist/integrations/pi/components/upstream/components/status-indicator.js +1 -1
  104. package/dist/integrations/pi/components/upstream/components/themed-text.d.ts +1 -1
  105. package/dist/integrations/pi/components/upstream/components/themed-text.js +1 -1
  106. package/dist/integrations/pi/components/upstream/components/thinking-selector.d.ts +1 -1
  107. package/dist/integrations/pi/components/upstream/components/thinking-selector.js +1 -1
  108. package/dist/integrations/pi/components/upstream/components/tool-execution.js +1 -1
  109. package/dist/integrations/pi/components/upstream/components/tree-selector.d.ts +1 -1
  110. package/dist/integrations/pi/components/upstream/components/tree-selector.js +1 -1
  111. package/dist/integrations/pi/components/upstream/components/trust-selector.js +1 -1
  112. package/dist/integrations/pi/components/upstream/external-editor.js +1 -1
  113. package/dist/integrations/pi/components/upstream/history/editor-core.d.ts +1 -1
  114. package/dist/integrations/pi/components/upstream/history/editor-core.js +1 -1
  115. package/dist/integrations/pi/components/upstream/history/kill-ring.d.ts +1 -1
  116. package/dist/integrations/pi/components/upstream/history/kill-ring.js +1 -1
  117. package/dist/integrations/pi/components/upstream/history/printable-key.js +1 -1
  118. package/dist/integrations/pi/components/upstream/history/text-helpers.js +1 -1
  119. package/dist/integrations/pi/components/upstream/history/undo-stack.d.ts +1 -1
  120. package/dist/integrations/pi/components/upstream/history/undo-stack.js +1 -1
  121. package/dist/integrations/pi/components/upstream/history/word-navigation.js +1 -1
  122. package/dist/integrations/pi/components/upstream/model-search.d.ts +1 -1
  123. package/dist/integrations/pi/components/upstream/program-status-reporter.d.ts +1 -1
  124. package/dist/integrations/pi/components/upstream/theme/theme.js +1 -1
  125. package/dist/integrations/pi/engine/adapter.d.ts +3 -1
  126. package/dist/integrations/pi/engine/adapter.js +24 -6
  127. package/dist/integrations/pi/engine/changelog.js +5 -2
  128. package/dist/integrations/pi/engine/delivery-retention.d.ts +7 -0
  129. package/dist/integrations/pi/engine/delivery-retention.js +66 -0
  130. package/dist/integrations/pi/engine/event-delivery.d.ts +17 -1
  131. package/dist/integrations/pi/engine/event-delivery.js +25 -3
  132. package/dist/integrations/pi/engine/extension-ui-binding.d.ts +2 -1
  133. package/dist/integrations/pi/engine/extension-ui-binding.js +45 -0
  134. package/dist/integrations/pi/engine/host-ports.d.ts +2 -0
  135. package/dist/integrations/pi/engine/host.d.ts +3 -0
  136. package/dist/integrations/pi/engine/host.js +2 -0
  137. package/dist/integrations/pi/engine/package-integration.js +19 -4
  138. package/dist/integrations/pi/engine/pending-delivery.d.ts +4 -1
  139. package/dist/integrations/pi/engine/pending-delivery.js +51 -18
  140. package/dist/integrations/pi/engine/resources/changelog.json +4 -4
  141. package/dist/integrations/pi/engine/runtime-integration.d.ts +8 -0
  142. package/dist/integrations/pi/engine/runtime-integration.js +58 -9
  143. package/dist/integrations/pi/engine/session-cwd-recovery.d.ts +11 -0
  144. package/dist/integrations/pi/engine/session-cwd-recovery.js +18 -0
  145. package/dist/integrations/pi/engine/session-runtime.d.ts +3 -0
  146. package/dist/integrations/pi/engine/session-runtime.js +2 -0
  147. package/dist/integrations/pi/engine/session-selection.d.ts +3 -2
  148. package/dist/integrations/pi/engine/session-selection.js +25 -5
  149. package/dist/integrations/pi/engine/transcript-image-assets.d.ts +3 -0
  150. package/dist/integrations/pi/engine/transcript-image-assets.js +65 -14
  151. package/dist/integrations/pi/engine/view-state.d.ts +14 -0
  152. package/dist/integrations/pi/engine/view-state.js +17 -0
  153. package/dist/integrations/pi/engine/workflow-runner.d.ts +2 -0
  154. package/dist/integrations/pi/engine/workflow-runner.js +47 -26
  155. package/dist/integrations/pi/engine/worktree-tools.d.ts +4 -0
  156. package/dist/integrations/pi/engine/worktree-tools.js +26 -0
  157. package/dist/integrations/pi/session-presenters/components.d.ts +2 -1
  158. package/dist/integrations/pi/session-presenters/components.js +5 -3
  159. package/dist/integrations/pi/session-presenters/presenters.d.ts +3 -1
  160. package/dist/integrations/pi/session-presenters/presenters.js +1 -1
  161. package/dist/integrations/pi/startup-public.d.ts +1 -1
  162. package/dist/integrations/pi/startup-public.js +16 -20
  163. package/dist/integrations/pi/startup-public.manifest.json +29 -29
  164. package/dist/integrations/pi/tui-runtime/damage-aware-terminal.d.ts +1 -1
  165. package/dist/integrations/pi/tui-runtime/damage-aware-terminal.js +1 -1
  166. package/dist/product-identity.json +1 -1
  167. package/dist/runtime-payload-inventory.json +5027 -5027
  168. package/dist/ui/components/index.d.ts +1 -1
  169. package/dist/ui/components/index.js +1 -1
  170. package/dist/ui/components/progress-status.d.ts +7 -0
  171. package/dist/ui/components/progress-status.js +21 -0
  172. package/dist/ui/components/value-menu.d.ts +1 -1
  173. package/dist/ui/components/value-menu.js +4 -2
  174. package/dist/ui/settings/declarations.d.ts +16 -4
  175. package/dist/ui/settings/declarations.js +13 -4
  176. package/docs/architecture/internal-naming.md +1 -1
  177. package/docs/architecture/project-structure.md +7 -11
  178. package/docs/features/session-exports.md +1 -1
  179. package/docs/features/session-naming.md +8 -6
  180. package/docs/features/worktrees.md +38 -0
  181. package/docs/local-worktree-cleanup.md +27 -4
  182. package/docs/openspec-archive-automation.md +30 -4
  183. package/docs/worktree-link-recovery.md +2 -2
  184. package/package.json +5 -5
@@ -16,7 +16,7 @@ export type { ParsedMouseInput, RoutedMouseInput } from "./mouse.js";
16
16
  export { isInsidePane, toPaneLocalMouse } from "./pane.js";
17
17
  export type { Pane, PaneInputResult, PaneMouseEvent } from "./pane.js";
18
18
  export { sessionNameFrame } from "./session-name-frame.js";
19
- export { progressStatusFrame, progressStatusText } from "./progress-status.js";
19
+ export { progressStatusFrame, progressStatusText, isProgressSpinnerStyle, progressSpinnerFrame, PROGRESS_SPINNER_INTERVAL_MS } from "./progress-status.js";
20
20
  export type { ProgressStatusFrameStyles, ProgressStatusMarker } from "./progress-status.js";
21
21
  export { FrameCache, RENDER_REVISION_KINDS, RenderRevisionTracker, ZERO_REVISIONS, normalizeRevisions, revisionsEqual } from "./revision.js";
22
22
  export type { RenderCacheContract, RenderRevisionKind, RenderRevisions } from "./revision.js";
@@ -8,7 +8,7 @@ export { STEPPER_RESERVE, placementFor, regionAt, renderGroupHeader, renderListR
8
8
  export { MOUSE_TRACKING_OFF, MOUSE_TRACKING_ON, parseMouseInput, routeMouseInput } from "./mouse.js";
9
9
  export { isInsidePane, toPaneLocalMouse } from "./pane.js";
10
10
  export { sessionNameFrame } from "./session-name-frame.js";
11
- export { progressStatusFrame, progressStatusText } from "./progress-status.js";
11
+ export { progressStatusFrame, progressStatusText, isProgressSpinnerStyle, progressSpinnerFrame, PROGRESS_SPINNER_INTERVAL_MS } from "./progress-status.js";
12
12
  export { FrameCache, RENDER_REVISION_KINDS, RenderRevisionTracker, ZERO_REVISIONS, normalizeRevisions, revisionsEqual } from "./revision.js";
13
13
  export { COPY_ACKNOWLEDGEMENT_DURATION_MS, MAX_COPY_ROWS, MAX_COPY_SOURCE_UNITS, copyAcknowledgementText, selectionCopyLineContent, selectionCopyRowText } from "./selection-copy.js";
14
14
  export { ScrollbarRails, isThumbRow, scrollForThumbRow, scrollForTrackPage, scrollbarGeometry, scrollbarPresentation, scrollbarReservesSpace, scrollbarSelectionRows, scrollbarWheelRows, } from "./scrollbar.js";
@@ -1,4 +1,11 @@
1
+ import type { ProgressSpinnerStyle } from "../../contracts/presentation/index.js";
1
2
  export type ProgressStatusMarker = "…" | "...";
3
+ /** Pinned loader cadence, shared by the focused Settings preview. */
4
+ export declare const PROGRESS_SPINNER_INTERVAL_MS = 80;
5
+ /** Accepts only the declared owned spinner choices. */
6
+ export declare function isProgressSpinnerStyle(value: unknown): value is ProgressSpinnerStyle;
7
+ /** One fixed-cell glyph; actual Current indicators retain the loader's supplied frame. */
8
+ export declare function progressSpinnerFrame(style: ProgressSpinnerStyle, phase: number, currentFrame?: string): string;
2
9
  export interface ProgressStatusFrameStyles {
3
10
  readonly muted: (text: string) => string;
4
11
  readonly highlight: (text: string) => string;
@@ -1,3 +1,24 @@
1
+ /** Pinned loader cadence, shared by the focused Settings preview. */
2
+ export const PROGRESS_SPINNER_INTERVAL_MS = 80;
3
+ const SPINNER_FRAMES = {
4
+ none: [],
5
+ current: ["⠋", "⠙", "⠹", "⠸", "⠼", "⠴", "⠦", "⠧", "⠇", "⠏"],
6
+ circle: ["◐", "◓", "◑", "◒"],
7
+ diamond: ["◇", "◈", "◆", "◈"],
8
+ square: ["◧", "◩", "◨", "◪"],
9
+ };
10
+ /** Accepts only the declared owned spinner choices. */
11
+ export function isProgressSpinnerStyle(value) {
12
+ return typeof value === "string" && Object.hasOwn(SPINNER_FRAMES, value);
13
+ }
14
+ /** One fixed-cell glyph; actual Current indicators retain the loader's supplied frame. */
15
+ export function progressSpinnerFrame(style, phase, currentFrame) {
16
+ if (style === "current" && currentFrame !== undefined)
17
+ return currentFrame;
18
+ const frames = SPINNER_FRAMES[style];
19
+ const index = Number.isFinite(phase) ? Math.max(0, Math.floor(phase)) : 0;
20
+ return frames.length === 0 ? "" : frames[index % frames.length];
21
+ }
1
22
  const GRAPHEMES = new Intl.Segmenter(undefined, { granularity: "grapheme" });
2
23
  const HIGHLIGHT_WIDTH = 2;
3
24
  const UPDATES_PER_STEP = 3;
@@ -7,7 +7,7 @@ import type { UiTheme } from "./theme.js";
7
7
  export interface ValueMenuState {
8
8
  /** Values offered, as they should read. */
9
9
  readonly choices: readonly string[];
10
- /** Optional already-painted square previews, aligned before each choice label. */
10
+ /** Optional already-painted glyph previews, aligned before each choice label. */
11
11
  readonly previews?: readonly string[];
12
12
  /** The value in effect, marked rather than highlighted. */
13
13
  readonly current: string | null;
@@ -11,7 +11,7 @@ export function valueMenuFrame(state, anchor, layout) {
11
11
  const top = Math.max(bodyTop, Math.min(anchor.screenRow - currentIndex, bodyBottom - state.choices.length));
12
12
  const previewWidth = Math.max(0, ...(state.previews ?? []).map(displayWidth));
13
13
  const previewColumns = previewWidth === 0 ? 0 : previewWidth + 1;
14
- const width = Math.max(...state.choices.map(choice => displayWidth(choice) + previewColumns + 4), 6);
14
+ const width = Math.min(Math.max(0, layout.surfaceWidth - layout.reservedRight), Math.max(...state.choices.map(choice => displayWidth(choice) + previewColumns + 4), 6));
15
15
  // Invariant: rows reserve two cells for the effective-value mark and, when present,
16
16
  // a preview plus one gap. Choice text remains aligned with the source value column.
17
17
  const column = Math.min(Math.max(0, anchor.valueColumn - 2 - previewColumns), Math.max(0, layout.surfaceWidth - width - layout.reservedRight));
@@ -20,6 +20,8 @@ export function valueMenuFrame(state, anchor, layout) {
20
20
  /** Draws the menu over the rows behind it, leaving them otherwise untouched. */
21
21
  export function renderValueMenu(lines, state, frame, theme) {
22
22
  const output = [...lines];
23
+ if (frame.width <= 0)
24
+ return output;
23
25
  state.choices.forEach((choice, index) => {
24
26
  const target = frame.top + index;
25
27
  if (target < 0 || target >= output.length)
@@ -31,7 +33,7 @@ export function renderValueMenu(lines, state, frame, theme) {
31
33
  const previewWidth = Math.max(0, ...previews.map(displayWidth));
32
34
  const preview = previewWidth === 0 ? "" : `${padToWidth(previews[index] ?? "", previewWidth)} `;
33
35
  // Invariant: the current-value check stays on ordinary text while the optional
34
- // square carries the palette color; the row treatment supplies only its surface.
36
+ // preview carries its own color; the row treatment supplies only its surface.
35
37
  const tail = padToWidth(`${current ? " " : " "}${preview}${choice} `, frame.width - (current ? 1 : 0));
36
38
  const painted = current
37
39
  ? `${paint(theme.fg("text", "✓"))}${paint(tail)}`
@@ -70,6 +70,18 @@ export declare const OWNED_SETTING_DECLARATIONS: Readonly<{
70
70
  defaultValue: true;
71
71
  allowedValues: readonly [true, false];
72
72
  }>;
73
+ readonly spinnerStyle: Readonly<{
74
+ id: "spinnerStyle";
75
+ label: "Spinner style";
76
+ section: Readonly<{
77
+ id: "appearance";
78
+ title: "Appearance";
79
+ }>;
80
+ description: "Indicator beside working and operation progress text. None keeps text only; Current keeps the dot spinner.";
81
+ application: "live";
82
+ defaultValue: "current";
83
+ allowedValues: readonly ["none", "current", "circle", "diamond", "square"];
84
+ }>;
73
85
  readonly scrollbarAppearance: Readonly<{
74
86
  id: "scrollbarAppearance";
75
87
  label: "Scrollbar mode";
@@ -149,7 +161,7 @@ export declare const OWNED_SETTING_DECLARATIONS: Readonly<{
149
161
  id: "agent";
150
162
  title: "Agent";
151
163
  }>;
152
- description: "Name unnamed sessions from the first prompt; regenerate automatic names on the next prompt after a worktree context change. Manual names are preserved.";
164
+ description: "Name unnamed sessions from the current task and relevant discussion; regenerate on the next prompt after a worktree context change. Manual names are preserved.";
153
165
  application: "live";
154
166
  defaultValue: true;
155
167
  allowedValues: readonly [true, false];
@@ -161,10 +173,10 @@ export declare const OWNED_SETTING_DECLARATIONS: Readonly<{
161
173
  id: "agent";
162
174
  title: "Agent";
163
175
  }>;
164
- description: "Format for future automatic names: fix-api-cache, Fix API cache, or Fix API Cache. Existing and manual names stay unchanged.";
176
+ description: "Format for future automatic names: Fix API cache (default), fix-api-cache, or Fix API Cache. Existing and manual names stay unchanged.";
165
177
  application: "live";
166
- defaultValue: "kebab";
167
- allowedValues: readonly ["kebab", "sentence", "title"];
178
+ defaultValue: "sentence";
179
+ allowedValues: readonly ["sentence", "kebab", "title"];
168
180
  }>;
169
181
  readonly promptSuggestions: Readonly<{
170
182
  id: "promptSuggestions";
@@ -46,6 +46,15 @@ export const OWNED_SETTING_DECLARATIONS = Object.freeze({
46
46
  defaultValue: true,
47
47
  allowedValues: Object.freeze([true, false]),
48
48
  }),
49
+ spinnerStyle: Object.freeze({
50
+ id: "spinnerStyle",
51
+ label: "Spinner style",
52
+ section: APPEARANCE_SECTION,
53
+ description: "Indicator beside working and operation progress text. None keeps text only; Current keeps the dot spinner.",
54
+ application: "live",
55
+ defaultValue: "current",
56
+ allowedValues: Object.freeze(["none", "current", "circle", "diamond", "square"]),
57
+ }),
49
58
  scrollbarAppearance: Object.freeze({
50
59
  id: "scrollbarAppearance",
51
60
  label: "Scrollbar mode",
@@ -104,7 +113,7 @@ export const OWNED_SETTING_DECLARATIONS = Object.freeze({
104
113
  id: "sessionAutoName",
105
114
  label: "Automatic session name",
106
115
  section: AGENT_SECTION,
107
- description: "Name unnamed sessions from the first prompt; regenerate automatic names on the next prompt after a worktree context change. Manual names are preserved.",
116
+ description: "Name unnamed sessions from the current task and relevant discussion; regenerate on the next prompt after a worktree context change. Manual names are preserved.",
108
117
  application: "live",
109
118
  defaultValue: true,
110
119
  allowedValues: Object.freeze([true, false]),
@@ -113,10 +122,10 @@ export const OWNED_SETTING_DECLARATIONS = Object.freeze({
113
122
  id: "sessionNameFormat",
114
123
  label: "Session name format",
115
124
  section: AGENT_SECTION,
116
- description: "Format for future automatic names: fix-api-cache, Fix API cache, or Fix API Cache. Existing and manual names stay unchanged.",
125
+ description: "Format for future automatic names: Fix API cache (default), fix-api-cache, or Fix API Cache. Existing and manual names stay unchanged.",
117
126
  application: "live",
118
- defaultValue: "kebab",
119
- allowedValues: Object.freeze(["kebab", "sentence", "title"]),
127
+ defaultValue: "sentence",
128
+ allowedValues: Object.freeze(["sentence", "kebab", "title"]),
120
129
  }),
121
130
  promptSuggestions: Object.freeze({
122
131
  id: "promptSuggestions",
@@ -66,7 +66,7 @@ The old environment registry included `fixture` and `inputAcknowledgement`, but
66
66
 
67
67
  `certificationTarball`, `internalPackaging`, `nativePi`, `piParityIntentionalMutation`, `protocolVersion`, `structuredFlowLimits`, `terminalArgumentsJson`, and `terminalExecutable` had no active runtime consumer in the reviewed tree. They are removed from the current environment authority, not renamed into new settings. Rejection patterns and immutable historical evidence remain factual.
68
68
 
69
- The release store (`src/foundation/release/release-state.ts`, persisted as `release-state.json`) keeps the schema id `a1-release-cohort-v1` and the identity key `releaseCohortSchema`. "Cohort" is a legacy name from the retired supervisor era; the id is unchanged because every installed release state carries it, and renaming it would make existing installations unreadable.
69
+ The release store (`src/foundation/release/release-state.ts`, persisted as `release-state.json`) uses `a1-release-cohort-v2` and retains the identity key `releaseCohortSchema`. "Cohort" is a historical wire name, not a supervisor. New readers accept v1 and preserve its records; the next locked write upgrades control state to v2. This deliberately fences older cleanup/control writers that cannot protect live release-use claims. Existing sessions are not migrated or restarted, legacy approved roots remain protected, and a claim-aware launcher may still run a retained older UI. A pre-v2 launcher cannot independently control a v2 store.
70
70
 
71
71
  ## Negotiated handoff and protected state
72
72
 
@@ -93,11 +93,11 @@ Build output mirrors the production namespaces directly under ignored `dist/`, w
93
93
 
94
94
  ## Development worktrees
95
95
 
96
- Every task worktree must be created at `{working-dir}/.worktrees/<task-id>`, where `{working-dir}` is the agent session's initial working directory. The `.worktrees` directory is inside that working directory, not beside it. For working directory `D:/Git/a1`, `D:/Git/a1/.worktrees/<task-id>` is correct and `D:/Git/a1-<task-id>` is forbidden.
96
+ Task checkouts live inside the primary repository's `.worktrees/<task-id>/`, not beside the repository. Follow the shared Worktrees guidance in `AGENTS.md`. The product command contract is documented in [Worktree commands](../features/worktrees.md).
97
97
 
98
98
  ### Common Git workflow
99
99
 
100
- External agents use ordinary Git without an A1 installation, runtime, or session link. Keep primary on `develop`, run the bounded cleanup sweep and relay its `lines`, then inspect `git worktree list --porcelain` from primary. Inventory is read-only and advisory; it is not atomic editing exclusion or permission to adopt a checkout.
100
+ Keep primary on `develop` and run the delivery skill's bounded cleanup sweep. In A1, enter or attach once; success is authoritative and informational inventory is not a second approval gate. Outside A1, use ordinary Git without installing A1 or inventing runtime identities.
101
101
 
102
102
  For a new delivery, create a unique absent task path and a new topic branch from freshly fetched `origin/develop`, unless the maintainer selected another base. For example, with primary at `D:/Git/a1` and unused task/branch names:
103
103
 
@@ -105,25 +105,21 @@ For a new delivery, create a unique absent task path and a new topic branch from
105
105
  cd /d/Git/a1 && git fetch origin develop && git worktree add -b feature/example-task .worktrees/example-task origin/develop && git -C .worktrees/example-task rev-parse --show-toplevel --git-common-dir && git -C .worktrees/example-task status --short --branch
106
106
  ```
107
107
 
108
- Successful creation by this session establishes provenance for that fresh checkout. Before planning, implementation, test, or delivery-documentation edits, verify the exact canonical root, common Git repository, intended branch, and working-tree state. Relative Git directory results must resolve to the primary repository's common directory. A path/branch collision never permits force creation, overwriting, or adoption of the existing checkout. A context mismatch means stop edits and report the blocker; never fall back to task edits in primary.
108
+ For external agents, successful creation establishes provenance for a fresh checkout; verify the canonical root, common repository, branch, and local work before using it. Never force a collision or fall back to task edits in primary. A1 performs its own exact-context and editing-claim checks internally.
109
109
 
110
110
  ### Resume and ownership
111
111
 
112
- Reuse an existing checkout only when its exact branch, OpenSpec change, and PR match the requested stream and continuing ownership or explicit handoff from the prior owner or maintainer is established without conflicting ownership evidence. Names, similar files, recency, cleanliness, and ancestry are not ownership evidence. Inspect Git worktree locks and the cleanup journal's `status`; claim any released cleanup registration through the [cleanup ownership protocol](../local-worktree-cleanup.md#resume-or-recover-ownership) before editing. An owned registration requires matching owner authority. Neither an unregistered path nor a successful cleanup claim proves that no other editor is using it.
112
+ Continue the same task's branch, change, and PR. A1 owns cooperative editing claims and preserves existing edits when resuming; external agents establish continuing ownership or an explicit handoff themselves. Cleanup registration remains a separate repository concern: follow [cleanup ownership](../local-worktree-cleanup.md#resume-or-recover-ownership) when resuming a released cleanup candidate. Neither attachment nor cleanup registration authorizes merge or deletion.
113
113
 
114
- Known live editing claims, foreign cleanup ownership, Git locks, and unverifiable handoffs block reuse. Stop edits and report the blocker, or use a safe fresh worktree without overriding, recovering, unlocking, unlinking, or waiting out another owner. Preserve the existing delivery's branch/history/PR: do not force a branch checked out elsewhere or create a replacement PR to evade ownership. If the same stream cannot safely continue, report that concrete blocker.
115
-
116
- Repeat exact-context and ownership verification when resuming or switching streams. Handoffs name the absolute worktree, branch, change, PR, and whether editing ownership is being handed over. This is cooperative coordination, not enforcement against arbitrary external editors. Missing A1 integration alone never blocks external agents and is not evidence of a conflicting owner.
114
+ Do not replace a delivery's history or PR to evade a real ownership conflict. Handoffs name the absolute worktree, branch, change, PR, and editing handoff. Runtime coordination is cooperative, not exclusion against arbitrary external editors.
117
115
 
118
116
  ### Environment-specific adapters
119
117
 
120
- Inside an active A1 shell-tool session only, run `a1 session worktrees` and `a1 session link-worktree <absolute-worktree>` before edits to acquire the runtime's editing claim and footer association. An `available` result still needs atomic linking; a `busy` or `unverifiable` owner, failed association, lost race, or different returned path blocks edits there. A failed stream switch preserves the prior association. External agents use the common Git workflow instead of fabricating runtime identities or starting A1 just to satisfy repository policy.
121
-
122
- A stale Git registration elsewhere whose directory is missing and whose row is `prunable` may be pruned before retrying inventory; this does not permit removing a live checkout. Mutation-gate corruption and transient A1 startup-registration failures have a separate [worktree-link recovery procedure](../worktree-link-recovery.md). Recovery never overrides a live or unverifiable editing claim.
118
+ A1 owns creation/attachment, bounded retries, and ordinary recovery behind its worktree commands. Successful attachment returns the canonical path and branch; no follow-up inventory check is required. The old session link/unlink commands remain compatible aliases. Rare installation/legacy coordination failures have an operator [recovery reference](../worktree-link-recovery.md), not an agent preflight procedure.
123
119
 
124
120
  Claude Code uses its established `EnterWorktree` tool by task name. The tracked `.claude/settings.json` wires `scripts/governance/claude-worktree-create.mjs` to create `.worktrees/<task-id>` detached at fresh `origin/develop`, or return an already registered path. The agent must still establish ownership before reusing that path and create the topic branch in a new detached worktree before editing. Passing an absolute `path` to `EnterWorktree` is reserved for a worktree created by hand, from primary before any shell command in that session. The matching `WorktreeRemove` hook declines removal: leave with `ExitWorktree` `keep` and use only the guarded cleanup tool for removal. Other agents do not need these tools or hooks.
125
121
 
126
- A1 linking acquires a cooperative live-session editing claim and switches footer repository/PR discovery; an existing draft PR is not required when linking first succeeds. Clean unlink/disposal releases that runtime claim; a crashed A1 owner becomes reusable only after its recorded process is no longer running. Runtime association does not change process or tool cwd, create a Git lock, or register, release, or authorize cleanup. Context verification and editing handoff also grant no acceptance, finalization, merge, deletion, or cleanup authority. Repository commands therefore keep an explicit worktree path. The primary worktree stays on `develop` for integration and must not be used for task edits. Do not edit, adopt, move, or remove another session's worktree.
122
+ A1 attachment updates footer repository/PR discovery and subsequent built-in tool working directories without changing process-global cwd. Detach/disposal releases the runtime's claim and preserves Git data. An existing PR is not required. Explicit absolute paths retain their meaning; custom extensions and independent terminals keep their own cwd. Attachment never creates a Git lock, changes cleanup registration, or grants acceptance, finalization, merge, or deletion authority.
127
123
 
128
124
  An agent that directly chooses a transient file path for a PR/comment body, command payload, captured output, temporary patch/diff, or ad hoc log must place it beneath the verified task worktree's exact `.artifacts/` root, never the primary checkout, another worktree, OS temp, home/desktop, or a sibling path. Such scratch remains ignored, unstaged, uncommitted, disposable, non-authoritative, and secret-free. This repository path rule does not relocate storage internally selected by tools, product runtime code, or hermetic tests.
129
125
 
@@ -12,4 +12,4 @@ Automatic export storage refuses linked storage-directory entries rather than fo
12
12
 
13
13
  Exports are user data and can contain private session content. They are not disposable build artifacts, do not belong in `.artifacts/`, and are never removed by ordinary worktree cleanup. The `a1 pi` comparison profile retains its pinned export behavior.
14
14
 
15
- For an old export already blocking an eligible merged worktree, see the explicit named-export preservation operation in [local worktree cleanup](../local-worktree-cleanup.md). It preserves and verifies the selected export before removing only its original pathname; it does not remove the worktree or bypass other local-content checks.
15
+ For an old export blocking worktree cleanup, follow [export decisions](../local-worktree-cleanup.md#export-decisions): an explicit request to delete the identified file is sufficient, without mandatory preservation or another confirmation. If preservation is wanted instead, the optional named-export operation saves and verifies a copy before removing the source. Neither choice bypasses ordinary worktree cleanup checks.
@@ -1,6 +1,8 @@
1
1
  # Session names
2
2
 
3
- Bare A1 automatically names an unnamed session from its first prompt while the agent works. Names are short labels (up to 16 characters, including separators), generated by the active model in a separate tool-free request. The request does not add a conversation turn or delay the main response. It makes at most two attempts, with 30-second deadlines and respective 4,096/32,768 token ceilings; provider failures use a deterministic prompt-based fallback.
3
+ Bare A1 automatically names an unnamed session from its current task while the agent works. Names prefer two or three descriptive words, with a maximum of three words and 32 characters including separators. The active model receives the current prompt, verified worktree/branch hints, and bounded relevant recent discussion in a separate tool-free request. Short approvals such as `ok do it` refer back to the concrete task, producing names such as `Spinner style settings` rather than `Implement task`. Images, tool output, thinking blocks, and pasted-image paths are not naming subjects.
4
+
5
+ The request does not add a conversation turn or delay the main response. It makes at most two attempts, with 30-second deadlines and respective 4,096/32,768 token ceilings. Failed, empty, generic, or attachment-path results use a deterministic fallback from meaningful task words or current branch hints; when no usable task words exist, the fallback is `New task` in the default format.
4
6
 
5
7
  **Automatic session name** in the Agent settings group is enabled by default. Turning it off cancels pending naming without deleting the current name. The `a1 pi` comparison profile does not receive automatic naming or the A1 footer layout/reveal.
6
8
 
@@ -10,11 +12,11 @@ Choose **Session name format** in Agent settings:
10
12
 
11
13
  | Choice | Example |
12
14
  | --- | --- |
13
- | **Kebab case** (default) | `fix-api-cache` |
14
- | **Sentence case** | `Fix API cache` |
15
+ | **Sentence case** (default, first choice) | `Fix API cache` |
16
+ | **Kebab case** | `fix-api-cache` |
15
17
  | **Title Case** | `Fix API Cache` |
16
18
 
17
- Sentence case capitalizes the first word; Title Case capitalizes every ordinary word. Both preserve acronyms and technical spellings supplied by the model, such as `API` and `GitHub`. The same format applies to prompt-based fallback, and all formats keep the 16-character limit, trimming at a word boundary where possible.
19
+ Sentence case capitalizes the first word; Title Case capitalizes every ordinary word. Both preserve acronyms and technical spellings supplied by the model, such as `API` and `GitHub`. The same format applies to contextual fallback, and all formats enforce the three-word/32-character limits, trimming at a word boundary where possible. Valid saved format choices are preserved; only missing or invalid values use Sentence case.
18
20
 
19
21
  The choice is saved to your A1 profile and applies live to future automatic naming, including context regeneration and pending results. Changing it does not rewrite an existing name or start another naming request. Manual `/name` values remain untouched.
20
22
 
@@ -22,7 +24,7 @@ The choice is saved to your A1 profile and applies live to future automatic nami
22
24
 
23
25
  Linking a different worktree, clearing and re-entering the same worktree, or changing its confirmed branch makes an automatic name eligible for regeneration. A durable association revision detects exit/re-entry even between footer refreshes. Repeating a link without leaving, runtime heartbeats, commits, dirty files, and PR-check updates do not trigger regeneration.
24
26
 
25
- The old name stays visible until the **next user prompt** starts a run in the new context. That prompt and bounded worktree/branch hints determine the replacement; the original session prompt and old conversation are not reused. Worktree changes during a running turn wait for another prompt. Naming provenance and the completed context survive restart/resume, so resuming unchanged work does not rename it.
27
+ The old name stays visible until the **next user prompt** starts a run in the new context. That prompt, bounded worktree/branch hints, and relevant recent task discussion determine the replacement. A short approval can use discussion matching the new task, but unrelated original prompts and old tasks are excluded. Worktree changes during a running turn wait for another prompt. Naming provenance and the completed context survive restart/resume, so resuming unchanged work does not rename it.
26
28
 
27
29
  Manual `/name` renames always win, including a manual rename to the same text as an automatic name. Existing named sessions without A1 automatic-name provenance are preserved. Automatic generation cannot overwrite a manual rename or apply to a different session/context after a late provider response.
28
30
 
@@ -30,7 +32,7 @@ Manual `/name` renames always win, including a manual rename to the same text as
30
32
 
31
33
  - The first footer row shows the path, branch, and optional linked PR number.
32
34
  - The second row shows stats/context, then ` • session-name`, with the model/thinking text still aligned right.
33
- - If space is tight, the name is clipped or omitted before existing stats/model content is displaced. Unnamed sessions have no dangling separator.
35
+ - If space is tight, detailed stats are trimmed first to preserve the full name beside the model/thinking segment. Optional provider/route text can be omitted; the name is clipped only if it still cannot fit after stats are reduced. Unnamed sessions and rows without stats have no dangling separator.
34
36
 
35
37
  A changed automatic name reveals in the configured accent's **secondary color**: 600 ms tonal shimmer over the old name, 45 ms per grapheme to reveal the replacement, then 300 ms fade to ordinary dim text. Palette terminals use a plain typewriter reveal. Live accent changes recolor active frames without restarting them. Repeated redraws, resume, and an unchanged regenerated name do not replay the animation; manual names change immediately.
36
38
 
@@ -0,0 +1,38 @@
1
+ # Worktree commands
2
+
3
+ A1 owns worktree creation, attachment, cooperative editing claims, and ordinary recovery. Repository instructions only guide agents to these commands; they do not implement a second verification or lock-management procedure.
4
+
5
+ ## Command contract
6
+
7
+ Run these commands through an active A1 session's shell tool:
8
+
9
+ | Command | Result |
10
+ | --- | --- |
11
+ | `a1 worktree enter <type/short-description> [--base <branch>]` | Create or resume the matching task checkout and attach it. |
12
+ | `a1 worktree attach <absolute-path>` | Attach an existing registered task checkout in this session's repository. |
13
+ | `a1 worktree detach` | Release this session's attachment without deleting files or branches. |
14
+ | `a1 worktree list` | Informational same-repository inventory; never required after success. |
15
+
16
+ Successful enter/attach returns the canonical root and branch after acquiring the editing claim. It is the complete attachment result: agents do not run a second inventory approval gate or implement their own retry loop. Temporary registration/coordination contention is retried within an operation budget. Actual ownership conflicts and uncertain records produce actionable failures rather than unsafe takeovers. A failed switch preserves the prior attachment. No command removes worktrees, branches, user files, or private workspace data.
17
+
18
+ Enter creates `.worktrees/<short-description>` under the primary checkout. It fetches the selected origin base before creating a new topic branch. Base selection is explicit `--base`, local Git configuration `a1.worktreeBase`, then the origin default branch; local-only repositories fall back to the primary branch. Existing matching worktrees keep their local edits and history. Path/branch collisions, primary checkouts, foreign repositories, and Git-locked worktrees are retained, not forced or adopted. Setup commands, dependency installation, private-clone provisioning, and repository hooks are not executed by A1.
19
+
20
+ `a1 session link-worktree`, `unlink-worktree`, and `worktrees` remain compatible aliases for attach, detach, and list. They use the same authoritative results and internal retries.
21
+
22
+ ## Working directories
23
+
24
+ After successful attachment, subsequent built-in read, bash, edit, write, grep, find, and ls calls resolve relative paths from the verified attached root. Detach returns those tools to the session's startup directory. The already-running shell that issued the attachment finishes in its original cwd; A1 does not rewrite shell commands or call process-global chdir. Explicit absolute paths retain their ordinary meaning. Project resources, settings, custom extensions, and independent terminals keep their own discovery/cwd behavior; use the returned explicit root for those integrations.
25
+
26
+ Background footer polling activates persisted claims once per session binding, then observes without rewriting healthy runtime registrations or claims. Informational listing waits for a consistent coordination snapshot rather than marking all owners unverifiable because an unrelated mutation happens to be running. Runtime shutdown releases its own claims. Crash recovery preserves durable attachment state and checks recorded process liveness before another runtime can acquire a claim.
27
+
28
+ Implementation completion and review handoff do not end the task attachment. Keep it active for review and follow-up fixes so built-in tools and footer PR discovery continue using the task checkout. Detach only when explicitly requested or switching tasks; runtime shutdown releases editing claims automatically. Repository cleanup handoff is independent and does not require runtime detach.
29
+
30
+ Claims coordinate participating A1 sessions. They are not a sandbox against arbitrary external editors, an editing lock in Git, repository cleanup ownership, or permission to merge/delete anything. Delivery and protected cleanup remain independent.
31
+
32
+ ## Shared repository guidance
33
+
34
+ Use this identical block in repositories, without adding another inventory approval gate:
35
+
36
+ > In an active A1 session, use `a1 worktree enter <branch>` or `a1 worktree attach <absolute-path>`. Work in the returned directory; successful completion is the attachment confirmation. Keep the task attached after implementation completion and review handoff so follow-up fixes retain its checkout and PR. Use `a1 worktree detach` only when explicitly requested or switching tasks; it preserves files and branches. Runtime shutdown releases claims automatically. A1 owns coordination, retries, and recovery; `a1 worktree list` is informational. Outside A1, use ordinary Git worktrees.
37
+
38
+ Install an A1 release exposing this interface before integrating a repository's instruction migration. Older installations only expose the session-context aliases; unknown commands in those older releases may return quietly without performing an operation. A migration PR is not evidence that a compatible installed release is active.
@@ -6,6 +6,21 @@ The implementation is repository tooling, not part of the installed A1 product.
6
6
 
7
7
  If the whole repository moves to another canonical path or Windows drive, a carried cleanup journal still names the old absolute paths. Read-only `status` and `preview` report `state-relocation-required` and never rewrite it. The next mutation-locked operation safely rebases the journal only when every recorded entry is completed terminal history, the repository and remote identities still match, and every historical path is beneath the old recorded worktree root. The migration is atomic and changes only repository/path fields; the requested current worktree is then captured afresh and must pass every ordinary cleanup gate. Any owned, released, partially deleting, malformed, escaped, or identity-mismatched entry blocks relocation without changing the journal or local resources.
8
8
 
9
+ ## Cleanup decisions
10
+
11
+ Use one clear request for one identified scope; do not ask the maintainer to repeat a decision already supplied. Tool confirmation flags encode that authority and are not a reason for another conversational confirmation.
12
+
13
+ | Request | Action |
14
+ | --- | --- |
15
+ | Ordinary cleanup of completed work | Use `sweep` for released candidates or exact `complete`; retain every reported blocker. |
16
+ | Delete one identified export | Follow [export decisions](#export-decisions); preservation is not mandatory. |
17
+ | Preserve one identified export | Use optional [named-export preservation](#explicit-named-export-preservation). |
18
+ | Discard a rejected change and its remote branch | Use exact confirmed `discard` only when both rejection and remote deletion are authorized. One explicit request can supply both. |
19
+ | Stop development processes, remove a disposable link, retire a redundant checkout, or enable background cleanup | Use the corresponding exact authorized operation below; generic cleanup does not imply these extra permissions. |
20
+ | Ambiguous file, conflicting owner, dirty work, unavailable evidence, or a lock | Retain the affected scope and report the actionable blocker. Ask only for a missing decision; do not repeat an unchanged attempt without a reason. |
21
+
22
+ Automatic cleanup remains conservative. Explicit file decisions do not weaken worktree/branch eligibility, ownership, content, link, process, or compare-and-delete safeguards. Use integrated tooling from primary, not unmerged task tooling against live worktrees. Detailed journals, races, and recovery belong in tooling and the sections below; user-facing reports should state the result or blocker concisely.
23
+
9
24
  ## Hand-off and sweep: the ordinary agent path
10
25
 
11
26
  The delivering agent's session usually ends before the maintainer merges, so cleanup is split into two commands that never need the same session. When the validated PR is handed to the maintainer, and again after any repair push, the owning agent parks the worktree from the primary checkout:
@@ -92,7 +107,7 @@ Agents do not manually remove generated content, call `git worktree remove`, or
92
107
 
93
108
  ## Explicit closed-unmerged discard
94
109
 
95
- Closing a PR does not itself authorize deletion. After the maintainer explicitly rejects one exact PR and separately confirms remote deletion, run the candidate-scoped command from the primary checkout:
110
+ Closing a PR does not itself authorize deletion. Require explicit rejection of the exact PR and authority to delete its remote branch; one clear request may supply both. Then run the candidate-scoped command from the primary checkout:
96
111
 
97
112
  ```bash
98
113
  node scripts/governance/local-worktree-cleanup.mjs discard \
@@ -119,11 +134,19 @@ Branch mode verifies the named same-repository PR is still closed-unmerged into
119
134
 
120
135
  A branch-scoped `branch-discard-<ref-digest>.json` journal beside the ordinary cleanup state pins the repository, exact ref, change, PR, expected head, and deletion step without changing existing worktree records. After local preflight, the command journals intent, revalidates live evidence, expected-head deletes only the remote ref, verifies remote absence, and compare-and-deletes the unchanged local ref. Absent refs support resumption. Repeated completed requests report `already-discarded` only while both refs remain absent; a recreated ref is retained as `discard-ref-recreated`. Command reports, not the worktree-only registration list, describe this branch-scoped state. Sweep and queue never invoke branch-only discard.
121
136
 
122
- ## Explicit named-export preservation
137
+ ## Export decisions
123
138
 
124
- Default bare-A1 exports now live in the persistent user directory `~/.a1/exports/`; see [session exports](features/session-exports.md). Existing exports in a worktree remain user data, not cleanup disposables. Adding a filename pattern to `.gitignore` or the disposable policy is not a preservation operation.
139
+ Default bare-A1 exports live in `~/.a1/exports/`; see [session exports](features/session-exports.md). An existing worktree export is user data, not an automatic cleanup disposable.
140
+
141
+ - **Delete:** an explicit request to delete one identified export is sufficient. Its exact path or an unambiguous previously reported blocker in the same interaction identifies the file; do not demand a copy or another preservation confirmation. Verify the candidate and ownership, regular-file identity, untracked HTML/JSONL status, and real non-link ancestors within that worktree. Recheck identity immediately before non-recursively unlinking only that file. Do not follow links, delete directories, remove tracked content, or resolve another owner's blocker by deleting their files.
142
+ - **Preserve:** when chosen, use the optional confirmed operation below. Its verified-copy and journal safeguards remain unchanged.
143
+ - **Unspecified:** a generic cleanup request does not authorize deleting unknown exports. Report the file and ask only whether to retain, preserve, or delete it. Do not add a blanket filename pattern to ignored/disposable content.
144
+
145
+ Either file decision leaves subsequent worktree and branch removal to integrated cleanup tooling with every ordinary safeguard intact. A deletion request does not authorize overriding another blocker.
146
+
147
+ ## Explicit named-export preservation
125
148
 
126
- After the maintainer explicitly chooses one named legacy export to preserve, run the integrated repository operation from primary:
149
+ This optional operation is for a maintainer who wants to keep a named legacy export. It is not a prerequisite when deletion was explicitly requested. Run it from primary:
127
150
 
128
151
  ```bash
129
152
  cd /d/Git/a1 && node scripts/governance/local-worktree-cleanup.mjs preserve-export --repo D:/Git/a1 --path D:/Git/a1/.worktrees/example-task --change example-change --pr 123 --file session.html --confirm-preserve-export
@@ -6,13 +6,39 @@ Unrelated standalone documentation remains separate: a non-draft unassociated PR
6
6
 
7
7
  Version-1 and version-2 deliveries and their existing comments, acceptance PRs, archive PRs, receipts, retries, and bounded catch-up remain supported under [Legacy delivery](#legacy-delivery). Do not silently convert an in-flight legacy delivery.
8
8
 
9
- ## Worktree context across agent environments
9
+ ## Agent operating guide
10
+
11
+ This runbook owns the delivery lifecycle. The [worktree protocol](architecture/project-structure.md#development-worktrees) owns checkout creation, identity, ownership, and runtime adapters; [local cleanup](local-worktree-cleanup.md) owns removal decisions, commands, blockers, and recovery. `AGENTS.md`, the delivery skill, and OpenSpec context are concise entry points, not separate copies of these procedures. Detailed checks stay in their owning runbook and tooling.
12
+
13
+ ### Authorization without repeated confirmation
14
+
15
+ A planning-only request authorizes planning only. Once a concrete plan has been presented, one explicit instruction approving it and requesting implementation satisfies both requirements; no separate messages or special approval phrase are required. Ask only about a genuinely missing scope or authorization decision, not an approval already given. Reconcile approved refinements in the same PR before corresponding implementation edits.
16
+
17
+ Implementation approval never grants merge permission, foreign-worktree ownership, unrelated user-file deletion, or background cleanup authority. Use the separate [exact-candidate merge procedure](#maintainer-requested-agent-merge) and [cleanup decisions](local-worktree-cleanup.md#cleanup-decisions). A named-export deletion request does not require preservation approval instead.
18
+
19
+ ### Branches and validation
20
+
21
+ Keep unrelated changes out. Use `type/short-description` branches with `feature`, `fix`, `refactor`, `docs`, `test`, `chore`, or `style`, and `type(scope): subject` commits; mark incompatible changes with `BREAKING CHANGE:`.
22
+
23
+ Before pushing, run only quick targeted checks of what changed: typecheck, the test files covering the changed code, and strict OpenSpec validation. Do not run preflight, `test:fast`, `test:full`, `test:release`, or directory-wide suites unless reproducing a reported CI failure or explicitly requested by the maintainer. Preflight is diagnostic, not CI authority. Draft PRs run no Development test suites; ready finalized candidates receive the selected exact-head validation. Use [complete-regression ordering](#complete-regression-evidence-ordering) for trusted failed-Full repairs, not broader local test runs.
10
24
 
11
- External agents use ordinary Git worktrees without an A1 installation, runtime, or session link. Follow the [development worktree protocol](architecture/project-structure.md#development-worktrees): keep primary on `develop`, run the cleanup sweep, inspect Git inventory, and verify the exact task root, common repository, branch, and state before edits. A fresh worktree created by the session establishes its provenance. An existing delivery needs continuing ownership or explicit handoff plus the exact branch, change, and PR; inventory and a clean checkout alone grant nothing.
25
+ After a push, do not watch CI in the foreground. Read and report its current result before unrelated work; do not poll for completion. Repair routine failed checks in the same branch/PR without weakening behavior, assertions, coverage, or required checks. Ask for approval only when a repair adds substantive scope. A changed candidate or target requires renewed applicable validation.
12
26
 
13
- Use A1 inventory/linking only inside an active A1 shell-tool session, and Claude Code's established worktree hooks in that environment. Missing A1 integration alone does not block an external agent. A known live owner, Git lock, conflicting cleanup owner, or unverifiable handoff still blocks reuse. Claim any released cleanup registration through the [cleanup ownership protocol](local-worktree-cleanup.md#resume-or-recover-ownership) before editing. Neither a runtime link nor a cleanup claim proves the absence of arbitrary external editors; coordination remains cooperative.
27
+ ### Generated proposals
28
+
29
+ Nightly regression repairs and Pi upgrades are ordinary implementation-bound changes. Continue the generated branch and PR. Check each generated Implementation outcome when its work is complete, including an outcome needing no code change; do not rewrite the generated items. Keep detailed report evidence in its existing comments/design; do not add commits solely to insert a final CI run ID or body edits solely to record lifecycle phase. Draft implementation runs no Development suites.
30
+
31
+ Failed-Full repair selection follows the immutable provenance checks in [complete-regression ordering](#complete-regression-evidence-ordering); labels or naming never select it. Regression repair templates retain two implementation outcomes, one acceptance outcome, and triage metadata under Automation. Pi-upgrade proposals retain four implementation outcomes and one acceptance outcome; their version delta, changelog excerpt, gate verdicts, and review items remain in sync report comments/design. Publishing recovery remains independent of PR validation. The existing post-publication `chore/release-X.Y.Z-dev` reopening exception is limited to `openspec-ci[bot]`, version-only manifests, and a note matching the published Release; it grants no implementation integration authority.
32
+
33
+ ### Handoff and reporting
34
+
35
+ Provide the absolute worktree, branch/commit, change, PR, behavior, known gaps, applicable run or inspection command, and whether editing ownership is handed over. For interactive checkout tests, build first and use `./scripts/dev` or `./scripts/dev pi`, never a direct Node launcher such as `node scripts/development/dev-launch.mjs`. Follow `AGENTS.md` for pasteable user-command formatting. End runnable implementation reports with `🧪 Manual test:` and the applicable command; a documentation-only change needs inspection, not a product build. Say when nothing is runnable instead of inventing a test.
36
+
37
+ After exact-head required validation succeeds, park the exact candidate with the primary-checkout `handoff` command, and repeat after a validated repair. It registers/releases cleanup ownership without removing anything. Do not add a lifecycle body edit, rerun successful validation, wait for merge, or start a watcher. Leave integration to a current authorized maintainer decision. CI counts are not progress, and manual validation never blocks truthful task completion or readiness.
38
+
39
+ ## Worktree context across agent environments
14
40
 
15
- Repeat context and ownership verification on resume or stream changes, preserve the delivery's branch/history/PR, and keep every command explicitly scoped to its worktree. Handoffs name the absolute worktree path, branch, change, PR, and whether editing ownership is being handed over. An editing handoff does not register, release, or authorize cleanup and grants no integration authority. The lifecycle below applies equally to all agent environments.
41
+ Follow the [development worktree protocol](architecture/project-structure.md#development-worktrees) before creating, resuming, or switching checkouts. It defines the common Git path and conditional A1/Claude Code adapters; external agents need no A1 installation or runtime link. Editing handoff, runtime association, cleanup ownership, and integration authority remain distinct.
16
42
 
17
43
  ## Version-3 lifecycle
18
44
 
@@ -8,9 +8,9 @@ Updated A1 holds a `proper-lockfile` gate, the `mutation.authority.gate` lock di
8
8
 
9
9
  The next mutation safely recovers abandoned owner/pending metadata after taking the gate. Empty, truncated, NUL-filled, or otherwise malformed metadata does not prevent this recovery. One bounded `recovery.json` records the recovery reason/time, not the original bytes or session contents. A live gate holder remains protected. Acquisition waits at most two seconds by default and honors cancellation.
10
10
 
11
- If startup registration fails temporarily, the running session retries on its 30-second refresh interval. Slow attempts are coalesced rather than queued indefinitely. Once registration succeeds, retry the explicit worktree link in the same session. Switching an agent's session replaces its publication identity, and disposal drains publication before releasing claims.
11
+ Worktree commands own bounded retries; agents do not implement a recovery preflight or confirm success through a second inventory command. If startup registration fails temporarily, the running session retries on its one-second recovery interval. Healthy registrations and claims are not rewritten by background polls. Slow recovery attempts are coalesced rather than queued indefinitely. Switching an agent's session replaces its publication identity, and disposal drains publication before releasing claims.
12
12
 
13
- Inventory remains read-only. It can conservatively show unverifiable status until a mutation has recovered abandoned state; inventory does not perform repair.
13
+ Inventory reads editing claims under a bounded consistent snapshot and does not repair or acquire them. Ordinary global coordination contention produces internal waiting or an operation-level contention diagnostic, never a blanket unverifiable-ownership result for every worktree.
14
14
 
15
15
  ## Older lock files and mixed versions
16
16
 
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@timurproko/a1",
3
- "version": "0.2.7-dev.1276",
3
+ "version": "0.2.7-dev.1286",
4
4
  "description": "Standalone single-agent terminal UI on pinned Pi",
5
5
  "type": "module",
6
6
  "privateLaunchContract": "neutral-launch-v1",
@@ -69,8 +69,8 @@
69
69
  "typecheck:bin": "tsgo -p tsconfig.bin.json"
70
70
  },
71
71
  "dependencies": {
72
- "@earendil-works/pi-coding-agent": "1.5.1",
73
- "@earendil-works/pi-tui": "1.5.1",
72
+ "@earendil-works/pi-coding-agent": "1.5.2",
73
+ "@earendil-works/pi-tui": "1.5.2",
74
74
  "@silvia-odwyer/photon-node": "0.3.4",
75
75
  "chalk": "5.6.2",
76
76
  "cross-spawn": "7.0.6",
@@ -113,7 +113,7 @@
113
113
  "@mariozechner/clipboard": "^0.3.9"
114
114
  },
115
115
  "publication": {
116
- "source": "3d3c76792f41343dee7f72854c2b60c3edd4a155",
117
- "pullRequest": 903
116
+ "source": "81969ce6924469b3081347067fd0d0190359b132",
117
+ "pullRequest": 913
118
118
  }
119
119
  }