@awebai/oats 0.51.0 → 0.52.0

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 (128) hide show
  1. package/README.md +1 -0
  2. package/bin/oats.mjs +109 -37
  3. package/docs/capabilities.md +9 -2
  4. package/docs/configuration.md +134 -88
  5. package/docs/desktop-cli-api.md +927 -92
  6. package/docs/desktop-instance-start.md +56 -0
  7. package/docs/desktop.md +10 -7
  8. package/docs/execution-targets.md +144 -58
  9. package/docs/first-team.md +3 -1
  10. package/docs/harness-trust.md +50 -2
  11. package/docs/implementation.md +66 -9
  12. package/docs/integrations.md +9 -8
  13. package/docs/knowledge-reference/acceptance.md +1 -0
  14. package/docs/knowledge-reference/harvester.md +5 -3
  15. package/docs/knowledge-reference/model.md +5 -3
  16. package/docs/knowledge-theory.md +1 -1
  17. package/docs/knowledge.md +25 -2
  18. package/docs/launch-prompt-completion.md +50 -48
  19. package/docs/oats-local.schema.json +4 -3
  20. package/docs/official-catalog.md +4 -4
  21. package/docs/packages.md +14 -14
  22. package/docs/release-lane.md +15 -5
  23. package/docs/release-notes/v0.44.0.md +1 -1
  24. package/docs/release-notes/v0.52.0.md +933 -0
  25. package/docs/schedules.md +91 -4
  26. package/docs/souls-and-instances.md +95 -25
  27. package/docs/tui.md +152 -0
  28. package/docs/workspaces.md +2 -2
  29. package/lib/claim.mjs +186 -46
  30. package/lib/core.mjs +730 -185
  31. package/lib/errors.mjs +170 -0
  32. package/lib/harness-trust-write.mjs +68 -27
  33. package/lib/harness-trust.mjs +34 -16
  34. package/lib/instance-inspect.mjs +40 -11
  35. package/lib/instance-lifecycle.mjs +169 -47
  36. package/lib/launch-preference.mjs +16 -0
  37. package/lib/launch-prompt-completion.mjs +7 -43
  38. package/lib/launch-prompt-evidence.mjs +14 -7
  39. package/lib/launch-prompt-fixtures/README.md +86 -152
  40. package/lib/launch-prompt-fixtures/dev-channel-confirmation.json +50 -0
  41. package/lib/launch-prompt-fixtures.mjs +122 -109
  42. package/lib/launch-prompt-transport.mjs +2 -56
  43. package/lib/launch-prompts.mjs +102 -100
  44. package/lib/schedule-host.mjs +154 -22
  45. package/lib/schedule.mjs +73 -24
  46. package/lib/system-tools.mjs +39 -0
  47. package/lib/tmux-server-scope.mjs +62 -0
  48. package/lib/triggers.mjs +4 -4
  49. package/lib/workspace.mjs +5 -11
  50. package/lib/worktree-hooks.mjs +98 -20
  51. package/lib/worktree.mjs +83 -24
  52. package/package-catalog.json +3 -3
  53. package/package.json +7 -2
  54. package/packages/client/capability-show-contract.mjs +230 -0
  55. package/packages/client/capability-warnings-contract.mjs +57 -0
  56. package/packages/client/cli-adapter.mjs +548 -0
  57. package/packages/client/cli-environment.mjs +53 -0
  58. package/packages/client/cli-locator.mjs +253 -0
  59. package/packages/client/cli-probe-contract.mjs +47 -0
  60. package/packages/client/client-terms.mjs +60 -0
  61. package/packages/client/deployment-contract.mjs +68 -0
  62. package/packages/client/deployment-data.mjs +483 -0
  63. package/packages/client/deployment-facts.mjs +34 -0
  64. package/packages/client/deployment-label.mjs +76 -0
  65. package/packages/client/deployment-observer.mjs +89 -0
  66. package/packages/client/deployment-panel.mjs +142 -0
  67. package/packages/client/deployment-read-cli.mjs +53 -0
  68. package/packages/client/display-text.mjs +44 -0
  69. package/packages/client/harness-names.mjs +30 -0
  70. package/packages/client/inspect-contract.mjs +62 -0
  71. package/packages/client/instance-acts.mjs +54 -0
  72. package/packages/client/instance-admission.mjs +45 -0
  73. package/packages/client/instance-events-contract.mjs +74 -0
  74. package/packages/client/instance-git-contract.mjs +80 -0
  75. package/packages/client/instance-presentation.mjs +22 -0
  76. package/packages/client/instance-tree.mjs +453 -0
  77. package/packages/client/kernel-environment.mjs +11 -0
  78. package/packages/client/launch-contract.mjs +51 -0
  79. package/packages/client/launch-prompt-outcome.mjs +165 -0
  80. package/packages/client/lifecycle-cli.mjs +61 -0
  81. package/packages/client/lifecycle-contract.mjs +372 -0
  82. package/packages/client/liveness-main.mjs +10 -0
  83. package/packages/client/liveness.mjs +35 -0
  84. package/packages/client/machine-contract.mjs +123 -0
  85. package/packages/client/own-environment.mjs +22 -0
  86. package/packages/client/panel-views.mjs +286 -0
  87. package/packages/client/readiness-contract.mjs +172 -0
  88. package/packages/client/refresh-loop.mjs +52 -0
  89. package/packages/client/remote-address.mjs +126 -0
  90. package/packages/client/remote-roster.mjs +67 -0
  91. package/packages/client/roster-sections.mjs +80 -0
  92. package/packages/client/spawn-apply-cli.mjs +104 -0
  93. package/packages/client/spawn-apply-contract.mjs +183 -0
  94. package/packages/client/spawn-decision.mjs +46 -0
  95. package/packages/client/spawn-messages.mjs +119 -0
  96. package/packages/client/spawn-preview-cli.mjs +32 -0
  97. package/packages/client/spawn-preview-contract.mjs +314 -0
  98. package/packages/client/team-members.mjs +41 -0
  99. package/packages/client/team-rows.mjs +45 -0
  100. package/packages/client/terminal-contract.mjs +57 -0
  101. package/packages/client/tmux-status.mjs +66 -0
  102. package/packages/client/waiting-on-you.mjs +88 -0
  103. package/packages/client/workspace-admission.mjs +45 -0
  104. package/packages/client/workspace-cli.mjs +142 -0
  105. package/packages/client/workspace-views.mjs +147 -0
  106. package/packages/tui/README.md +46 -0
  107. package/packages/tui/bin/tui.mjs +7 -0
  108. package/packages/tui/lib/actions.mjs +29 -0
  109. package/packages/tui/lib/client.mjs +4 -0
  110. package/packages/tui/lib/main.mjs +105 -0
  111. package/packages/tui/lib/term/keys.mjs +323 -0
  112. package/packages/tui/lib/term/screen.mjs +122 -0
  113. package/packages/tui/lib/term/style.mjs +43 -0
  114. package/packages/tui/lib/term/text.mjs +49 -0
  115. package/packages/tui/lib/term/tty.mjs +168 -0
  116. package/packages/tui/lib/term/width.mjs +124 -0
  117. package/packages/tui/lib/views/frame.mjs +62 -0
  118. package/packages/tui/lib/views/help.mjs +28 -0
  119. package/packages/tui/package.json +8 -0
  120. package/skills/oats-getting-started/SKILL.md +29 -22
  121. package/lib/launch-prompt-fixtures/claude-2.1.289-darwin-arm64/frame-05-channel-seeded.txt +0 -35
  122. package/lib/launch-prompt-fixtures/claude-2.1.289-darwin-arm64/frame-06-first-after-channel.txt +0 -35
  123. package/lib/launch-prompt-fixtures/claude-2.1.289-darwin-arm64/frame-07-after-channel-200ms.txt +0 -35
  124. package/lib/launch-prompt-fixtures/claude-2.1.289-darwin-arm64/frame-08-installed-after-channel-200ms.txt +0 -35
  125. package/lib/launch-prompt-fixtures/claude-2.1.289-darwin-arm64/manifest.json +0 -77
  126. package/lib/launch-prompt-fixtures/claude-2.1.289-darwin-arm64/max-bypass-source.json +0 -88
  127. package/lib/launch-prompt-fixtures/structural-completion.json +0 -205
  128. package/lib/launch-prompt-policy.mjs +0 -87
@@ -1,152 +1,86 @@
1
- # Development-channel launch fixture qualification
2
-
3
- `launch-prompt-fixtures.mjs` qualifies the actual selected Claude executable by
4
- reading its SHA256, without executing it. The qualified executable identity is
5
- checked again before terminal actions. A harness name or reported version is
6
- insufficient.
7
-
8
- The accepted Claude 2.1.289 fixture is specific to darwin-arm64, binary SHA256
9
- `03d66745e3bb69ec727d66023696f3820bc0a00a8a5ba725eb6706d0c67cbe69`, and
10
- 110 columns by 35 rows. Captures preserve visible bytes, including the final
11
- newline. The private transport pins only the newly launched owned window to this
12
- geometry, and restores its previous geometry and sizing policy on every closure.
13
-
14
- The fixture directory contains only the channel prompt, its blank transition,
15
- the two known normal banners, and their hashes/provenance. It contains no harness binary,
16
- extracted proprietary modules, configuration, or credentials.
17
-
18
- The sole supported prompt requires the exact single selected argument
19
- `--dangerously-load-development-channels plugin:aweb-channel@awebai-marketplace`.
20
- Approved-channel flags, multiple channels, and contradictory arguments do not
21
- qualify. Explicit per-home `awebDevelopmentChannel: true` consent is required;
22
- the default is off. The controller can send only one fixed Enter per launch.
23
- There is no navigation or generic answer-sequence API.
24
-
25
- Folder trust and all other prompts are unexpected: the controller records a
26
- blocked outcome and sends no key. Captured folder-trust screens live only in
27
- `test/fixtures/launch-prompts/` as negative test evidence.
28
-
29
- Normal-output completion has a separate accepted finite policy: all surrounding
30
- bytes must equal one of the captured normal banners, except for its bounded
31
- directory line and the source-derived header/footer variants described below. Candidates are the exact home, a home-directory-relative `~` spelling,
32
- and `~/…/` followed by nonempty whole-component suffixes within the user home.
33
- Every complete line must fit 110 columns. Only conservative ASCII path components
34
- without traversal or empty segments qualify. These variants can only terminate
35
- observation; none can authorize a key or assert harness/channel readiness.
36
-
37
- Synthetic controller fixtures exercise state-machine behavior; they are not
38
- production rendering evidence.
39
-
40
- The installed-plugin capture (`frame-08-installed-after-channel-200ms.txt`)
41
- qualifies aweb-channel 1.7.11 with Opus 5.5 / API Usage Billing / auto mode /
42
- medium effort. Its manifest records the capture owner's provenance: native
43
- plugin installation in isolated config/cache, dummy credentials, denied runtime
44
- network and real-home access, seeded onboarding/trust/feature flag, one Enter,
45
- stable bytes at 200ms/1s/3s, and verified private-server cleanup. The prompt and
46
- blank transition were byte-identical to the earlier captures. No configuration,
47
- credentials or extracted source is included. No task or real-account/channel
48
- connection was tested. Apart from the source-derived variants below, other
49
- model/billing/effort/permission variants are not exact-frame candidates; a submitted answer can be followed by a retained blocked result.
50
-
51
- ## Source-derived subscription billing variants
52
-
53
- **SOURCE-DERIVED / SYNTHETIC, not observed subscription captures:** the adapter
54
- also constructs complete empty-frame variants for `Claude Max`, `Claude Pro`,
55
- `Claude Team` and `Claude Enterprise`. It substitutes only the billing atom in
56
- row 2 of each accepted API frame. Opus 5.5, auto mode, medium effort, separators,
57
- empty input, notices and all remaining rows stay exact. The existing bounded
58
- home-row policy is unchanged. These variants cannot authorize input.
59
-
60
- Provenance is the same pinned 2.1.289 darwin-arm64 executable SHA256 above,
61
- rechecked by read-only inspection. In that binary, `Knr` at the region containing
62
- byte offset 182366506 falls back to the four subscription labels (or
63
- `Claude API` by default). Before that fallback it may return
64
- `Claude ${planDisplayName}` when the account value and gates permit it. Those
65
- custom display names are not qualified unless their complete bytes equal an
66
- explicitly accepted label; subscription membership alone does not qualify a
67
- banner. The welcome-data
68
- region containing offset 197387574 selects that billing value independently;
69
- `Hgr` at offset 197387656 splits model/billing only when their display widths
70
- plus the three-character separator exceed the available width. These four
71
- short labels fit the accepted Opus 5.5 header at 110 columns. The test generates
72
- these explicitly synthetic derivatives and checks the real qualification and
73
- controller path with a test-local executable hash substitution. No binary or
74
- proprietary extracted module is included.
75
-
76
- The reported Max journey is different evidence: its later retained pane has
77
- SHA256 `9eb587ab3ac7f97b746169619e02e3c8dd7df2c9069ff4368b6f0858c0964c68`,
78
- 1597 bytes and 51 newline rows. It shows task activity and bypass-permissions
79
- mode. Its file mtime is 2026-10-07T14:31:54.028296Z (not an independently recorded
80
- capture time); it follows the submitted Enter at
81
- 14:31:45.365Z and block at 14:31:45.476Z. Its geometry, executable digest and
82
- plugin version were not independently recorded; no earlier raw frame exists.
83
- It is not padded, cropped or claimed as a qualified 110x35 first frame. See the
84
- [published operator evidence](https://github.com/awebai/oats/issues/754#issuecomment-6040215059).
85
- The billing-only extension does not recognize that later task-filled screen.
86
-
87
- ## Source-derived empty Max/bypass/medium variants
88
-
89
- **SOURCE-DERIVED / SYNTHETIC:** only the two existing empty banners with
90
- `Claude Max` additionally qualify the bypass-permissions footer. The pinned
91
- source ranges and hashes, exact changed row indices, sample home and complete
92
- candidate digests are in
93
- [the derivation manifest](claude-2.1.289-darwin-arm64/max-bypass-source.json).
94
- No proprietary extracted modules or private task text are included.
95
-
96
- The permission-mode table uses the same `⏵⏵` symbol for auto and bypass; only
97
- colour differs, which plain captures omit. `kx` renders that symbol, the mode
98
- indicator and ` on`; both modes take `dHe`'s same non-default branch with the
99
- same hint. Thus the left text changes from `auto mode on` to
100
- `bypass permissions on`, adding nine columns. The footer container has width
101
- 110, horizontal padding 2 and a right status child with `marginLeft:auto`.
102
- The alignment gap shrinks from 37 to 28 spaces; the effort glyph remains at
103
- zero-based column 90 and the complete row remains 108 columns. The independent
104
- `y8` effort rendering stays exactly `◐ medium · /effort`. All other bytes are
105
- unchanged, except the already qualified header atom and finite home line.
106
-
107
- The source supports this bounded transformation, not arbitrary renderer states.
108
- Within these exact families, the displayed medium status is mandatory; other
109
- content does not match an exact candidate. The separate post-answer structural
110
- policy below can recognize additional bounded states. The #712 observed child screens corroborate the 62-column left footer
111
- text, but have task/update rows and no effort status there; they are not these
112
- fixtures. Full-frame comparison and all Enter guards remain unchanged.
113
-
114
- Four later private operator captures motivated this work. Their SHA-256 values
115
- are retained here as provenance only:
116
-
117
- | Evidence | Bytes / newline rows | SHA-256 |
118
- | --- | --- | --- |
119
- | Journey start | 1597 / 51 | `9eb587ab3ac7f97b746169619e02e3c8dd7df2c9069ff4368b6f0858c0964c68` |
120
- | Journey restart | 2449 / 51 | `c21cc6ac90487a18828ea2375243c642df2d6959b50a339a187132ec26dc213a` |
121
- | Pre-rehearsal spawn | 3604 / 87 | `368170ecf1155e45f92a9c394972bf5a2ff0d56d2e03501f3d88615d0d2fab67` |
122
- | Pre-rehearsal restart | 3180 / 87 | `88352f740e3e8f51f3613a057d7fe8aa41ae26efe20fb0ce24c7ac025fa70d9c` |
123
-
124
- All follow controller geometry restoration; actual later-capture geometry,
125
- executable hash and plugin version were not independently recorded. File mtime
126
- is not capture time, and restoration dimensions are not capture dimensions.
127
- No first post-answer frame survives. None is cropped, reflowed or published as
128
- a raw 110x35 replay. These four captures remain provenance only, not qualified structural input.
129
- The separate controller-compared regression and structural policy below do not
130
- turn them into qualified captures or establish general Max success.
131
-
132
- ## Post-answer structural completion
133
-
134
- The [complete table](../../docs/launch-prompt-completion.md) defines the six modes,
135
- five efforts, finite hints, exact region geometry and 21 marker forms.
136
- [Source provenance](structural-completion.json) pins all 25 byte ranges against
137
- the same executable hash. This is the non-Jt footer layout; remote feature flags
138
- can change shape without binary drift. Unknown dialogs retaining a recognized
139
- composer/footer can evade the marker set: the accepted risk concerns reporting
140
- only, never another input action or a readiness claim.
141
-
142
- The observed regression is a SANITIZED DERIVATIVE of the actual compared
143
- 110x35 frame retained by the earlier controller after its one Enter. Only
144
- zero-based home row 2 becomes `/fixture/home`; the manifest records separate
145
- original/derivative byte counts and hashes. Outside that row, independent review
146
- found only native constants and the launcher's literal `@TASK.md` reference, no
147
- task body, account-personal or routing data. Four additional rows distinguish
148
- this captured in-progress state from the empty source-derived family. Its
149
- spinner verb is chosen per turn (or configured), its glyph animates and later
150
- suffixes change. No exact spinner matcher or recurrence claim follows. The
151
- empty footer derivation remains separately qualified; its arithmetic was not
152
- disproved by observing a different startup state.
1
+ # Development-channel confirmation tolerance list
2
+
3
+ `dev-channel-confirmation.json` is the list of Claude development-channel
4
+ confirmation wordings the launcher may confirm. `launch-prompt-fixtures.mjs`
5
+ loads and validates it; the controller (`launch-prompts.mjs`) sends its one
6
+ Enter only while the normalized screen EQUALS one `confirmation` entry's `text`.
7
+ It also holds the notice Claude shows when it ignores the development-channel
8
+ flag (`flag-ignored` entries), which ends a start with no key.
9
+
10
+ ## Normalization, and only this
11
+
12
+ 1. Split the captured screen into rows.
13
+ 2. Drop rows made only of box-drawing characters (U+2500–U+257F) and whitespace.
14
+ 3. Join the rest with single spaces, collapsing every whitespace run.
15
+ 4. Trim.
16
+
17
+ This absorbs wrapping at any pane width, indentation and padding. Nothing else
18
+ is normalized: no case folding, no character removal, no pattern. Equality is
19
+ not a contains test, so anything else on the screen, a second prompt stacked
20
+ with it, another or a second channel, or the options in another order, is no
21
+ match. A pane too narrow for Claude to wrap at word boundaries (about 40
22
+ columns for this prompt) breaks words and is no match either.
23
+
24
+ ## The notice block of a `flag-ignored` entry
25
+
26
+ When Claude ignores `--dangerously-load-development-channels` (channels are not
27
+ available for the account), it shows no confirmation and starts the session,
28
+ with a notice in its notices area. A `flag-ignored` entry is matched against a
29
+ **notice block**, never the whole screen:
30
+
31
+ 1. Split the captured screen into rows.
32
+ 2. A notice block is a maximal run of consecutive rows that each begin with `▎`
33
+ (U+258E) in the first column.
34
+ 3. Drop the `▎` from each row of the block, then normalize the block as above.
35
+
36
+ The entry matches when one notice block EQUALS its `text`. The controller
37
+ accepts it only on a screen with no question marker
38
+ (`lib/launch-prompt-completion.mjs`): a notice beside a question is a miss. Another plugin,
39
+ another wording, an extra row in the block (another notice stacked against it),
40
+ the text without the bar, or the text inside a longer row is no match. A notice
41
+ Claude keeps behind `N more notice hidden` is not on the screen, so it is no
42
+ match: that start blocks as an unknown screen.
43
+
44
+ ## Entries
45
+
46
+ Each entry has `id`, `kind` (`confirmation` or `flag-ignored`), `text` (the
47
+ normalized confirmation, or the normalized notice block) and `provenance` (one
48
+ row per capture: `claudeVersion`, `platform`, `capturedAt`, `source`).
49
+ A `confirmation` entry also has `selected` (the option line that carries `❯`);
50
+ a `flag-ignored` entry has `input: "none"`: it takes no input, ever.
51
+ Loading refuses a `confirmation` entry whose `❯` does not occur exactly once
52
+ immediately before `1. `, or whose `selected` is not that line; a `flag-ignored`
53
+ entry without `input: "none"`, with any `❯` or a `selected`, or that does not name
54
+ `--dangerously-load-development-channels` once; and any entry whose text does not
55
+ name exactly one channel, `plugin:aweb-channel@awebai-marketplace`. A hand edit
56
+ that moves the selection fails the tests.
57
+
58
+ One entry today, `aweb-dev-channel-confirmation-1`: Claude 2.1.289 and 2.1.296
59
+ on darwin-arm64 and 2.1.296 on linux-arm64 render the same text. The raw
60
+ captures and their provenance are in `test/fixtures/launch-prompts/`
61
+ (`dev-channel-provenance.json`), each tested against the entry. The entry's
62
+ 2.1.288 linux-x64 row is reported coverage, not a committed capture: the
63
+ oats#917 release review (5481510495) matched its own frames, which it keeps.
64
+
65
+ One `flag-ignored` entry, `aweb-dev-channel-flag-ignored-1`: Claude 2.1.296 on
66
+ darwin-arm64, captured in the oats#917 live run
67
+ (`claude-2.1.296-darwin-arm64-flag-ignored-80x24.txt`, the notice visible; the
68
+ same run's `…-flag-ignored-hidden-80x24.txt` is the notice hidden, negative
69
+ evidence).
70
+
71
+ ## Adding a wording
72
+
73
+ A new Claude wording is a new entry, in a reviewed change, with the raw
74
+ capture (unedited `tmux capture-pane -p`, before any key; for a notice, of the
75
+ started session) and its provenance
76
+ committed under `test/fixtures/launch-prompts/` and a test that it matches.
77
+ Capture it the way the existing ones were: a private tmux socket, a throwaway
78
+ `CLAUDE_CONFIG_DIR` seeded only with completed onboarding, a dummy-key
79
+ approval, the offline channel gate (`cachedGrowthBookFeatures.tengu_harbor`)
80
+ and trust for an empty throwaway directory; a dummy key, no network after the
81
+ install, no key sent. The version string is the only kind of variation entries
82
+ may carry, and only where a captured wording contains one. Never widen an entry
83
+ into a pattern.
84
+
85
+ Folder-trust prompts are never confirmed. The captured trust screens in
86
+ `test/fixtures/launch-prompts/` are negative test evidence.
@@ -0,0 +1,50 @@
1
+ {
2
+ "entries": [
3
+ {
4
+ "id": "aweb-dev-channel-confirmation-1",
5
+ "kind": "confirmation",
6
+ "text": "WARNING: Loading development channels --dangerously-load-development-channels is for local channel development only. Do not use this option to run channels you have downloaded off the internet. Please use --channels to run a list of approved channels. Channels: plugin:aweb-channel@awebai-marketplace ❯ 1. I am using this for local development 2. Exit Enter to confirm · Esc to cancel",
7
+ "selected": "❯ 1. I am using this for local development",
8
+ "provenance": [
9
+ {
10
+ "claudeVersion": "2.1.289",
11
+ "platform": "darwin-arm64",
12
+ "capturedAt": "2026-10-07T03:52:47Z",
13
+ "source": "test/fixtures/launch-prompts/claude-2.1.289-darwin-arm64-110.txt (oats#708 private throwaway capture)"
14
+ },
15
+ {
16
+ "claudeVersion": "2.1.296",
17
+ "platform": "darwin-arm64",
18
+ "capturedAt": "2026-10-10T18:35:17Z",
19
+ "source": "test/fixtures/launch-prompts/claude-2.1.296-darwin-arm64-194.txt (oats#886 comment 6100871837)"
20
+ },
21
+ {
22
+ "claudeVersion": "2.1.296",
23
+ "platform": "linux-arm64",
24
+ "capturedAt": "2026-10-10T23:26:08.284Z",
25
+ "source": "test/fixtures/launch-prompts/claude-2.1.296-linux-arm64-*.txt (oats#886 A6 capture: 194x50, 110x35, 80x35, 60x35)"
26
+ },
27
+ {
28
+ "claudeVersion": "2.1.288",
29
+ "platform": "linux-x64",
30
+ "capturedAt": "2026-10-11T01:40:21Z",
31
+ "source": "oats#917 review 5481510495 (https://github.com/awebai/oats/pull/917#pullrequestreview-5481510495): a real Claude with the flag in a private pane at 194x50 and 80x24, no key sent; matchDevChannelEntry equals this entry at both sizes; frames kept by the reviewer; capturedAt is the review's submission time"
32
+ }
33
+ ]
34
+ },
35
+ {
36
+ "id": "aweb-dev-channel-flag-ignored-1",
37
+ "kind": "flag-ignored",
38
+ "input": "none",
39
+ "text": "--dangerously-load-development-channels ignored (plugin:aweb-channel@awebai-marketplace) Channels are not currently available",
40
+ "provenance": [
41
+ {
42
+ "claudeVersion": "2.1.296",
43
+ "platform": "darwin-arm64",
44
+ "capturedAt": "2026-10-11T08:56:47Z",
45
+ "source": "test/fixtures/launch-prompts/claude-2.1.296-darwin-arm64-flag-ignored-80x24.txt (oats#917 live run at 74946384, root 9df0182b)"
46
+ }
47
+ ]
48
+ }
49
+ ]
50
+ }
@@ -1,44 +1,11 @@
1
- import { constants, openSync, closeSync, readSync, fstatSync, lstatSync, realpathSync, readFileSync } from "node:fs";
2
- import { createHash } from "node:crypto";
3
- import { homedir } from "node:os";
4
- import { classifyClaudeLaunchCompletion } from "./launch-prompt-completion.mjs";
1
+ import { readFileSync, realpathSync } from "node:fs";
5
2
 
6
- const ROOT = new URL("./launch-prompt-fixtures/claude-2.1.289-darwin-arm64/", import.meta.url);
7
- const MANIFEST = JSON.parse(readFileSync(new URL("manifest.json", ROOT), "utf8"));
8
3
  const PLUGIN = "plugin:aweb-channel@awebai-marketplace";
9
4
  const DEVELOPMENT = "--dangerously-load-development-channels";
10
-
11
- function executableDigest(path) {
12
- let fd;
13
- try {
14
- const resolved = realpathSync(path);
15
- fd = openSync(resolved, constants.O_RDONLY | (constants.O_NOFOLLOW ?? 0) | (constants.O_NONBLOCK ?? 0));
16
- const before = fstatSync(fd);
17
- if (!before.isFile() || !(before.mode & 0o111)) return null;
18
- const hash = createHash("sha256"), buffer = Buffer.alloc(1024 * 1024);
19
- let offset = 0;
20
- // Bound to the original file size; a growing file cannot make qualification
21
- // run indefinitely. Reject any change observed while reading it.
22
- while (offset < before.size) {
23
- const count = readSync(fd, buffer, 0, Math.min(buffer.length, before.size - offset), offset);
24
- if (!count) return null;
25
- hash.update(buffer.subarray(0, count));
26
- offset += count;
27
- }
28
- const after = fstatSync(fd);
29
- const current = lstatSync(resolved);
30
- if (!current.isFile() || current.dev !== before.dev || current.ino !== before.ino || current.size !== before.size || current.mtimeMs !== before.mtimeMs || current.ctimeMs !== before.ctimeMs) return null;
31
- if (before.dev !== after.dev || before.ino !== after.ino || before.size !== after.size || before.mtimeMs !== after.mtimeMs || before.ctimeMs !== after.ctimeMs || realpathSync(path) !== resolved) return null;
32
- return { digest: hash.digest("hex"), validate() {
33
- try {
34
- const current = lstatSync(resolved);
35
- return current.isFile() && realpathSync(path) === resolved
36
- && ["dev", "ino", "size", "mode", "mtimeMs", "ctimeMs"].every(key => current[key] === before[key]);
37
- } catch { return false; }
38
- } };
39
- } catch { return null; }
40
- finally { if (fd !== undefined) closeSync(fd); }
41
- }
5
+ const SELECTION = "❯";
6
+ // Claude's notices sit in a block of rows that each begin with this bar.
7
+ const NOTICE_BAR = "▎";
8
+ const SNIPPET = 40;
42
9
 
43
10
  function channelEligible(argv) {
44
11
  if (!Array.isArray(argv) || argv.some(a => typeof a !== "string")) return false;
@@ -51,81 +18,127 @@ function channelEligible(argv) {
51
18
  return argv.filter(a => a.startsWith("plugin:")).length === 1;
52
19
  }
53
20
 
54
- function captured(name) {
55
- const text = readFileSync(new URL(name, ROOT), "utf8");
56
- const expected = MANIFEST.frames[name];
57
- if (!expected || Buffer.byteLength(text) !== expected.bytes || createHash("sha256").update(text).digest("hex") !== expected.sha256) throw new Error("fixture integrity");
58
- return text;
21
+ /** The launcher confirms Claude's development-channel prompt exactly when it
22
+ * starts Claude with the single aweb development-channel argument: the argv is
23
+ * the decision, there is no other consent. argv excludes the executable. */
24
+ export function launchPromptEngages({ harness, argv }) {
25
+ return harness === "claude" && channelEligible(argv);
59
26
  }
60
27
 
61
- // Accepted as a completion-only finite policy, not a general claim about
62
- // Claude's path renderer. Apart from the source-derived header/footer below,
63
- // all surrounding bytes remain the captured frame.
64
- // Nothing produced here can match a prompt or authorize an input action.
65
- function completedFrames(home) {
66
- if (typeof home !== "string" || !/^\/[A-Za-z0-9_./-]+$/.test(home)) return [];
67
- const components = home.slice(1).split("/");
68
- if (components.some(part => !part || part === "." || part === "..")) return [];
69
- const paths = new Set([home]);
70
- const userHome = homedir();
71
- if (home === userHome) paths.add("~");
72
- else if (home.startsWith(userHome + "/")) {
73
- paths.add("~" + home.slice(userHome.length));
74
- const relative = home.slice(userHome.length + 1).split("/");
75
- for (let index = 0; index < relative.length; index++) paths.add("~/…/" + relative.slice(index).join("/"));
76
- }
77
- const banners = ["frame-07-after-channel-200ms.txt", "frame-08-installed-after-channel-200ms.txt"];
78
- const prefix = " ▝▝ ▝▝ ";
79
- // Source-derived billing atoms change only this header row. The complete
80
- // empty input/status frame remains exact; these are not account captures.
81
- // See launch-prompt-fixtures/README.md for the pinned source provenance.
82
- const billings = ["API Usage Billing", "Claude Max", "Claude Pro", "Claude Team", "Claude Enterprise"];
83
- return banners.flatMap(name => [...paths].filter(path => prefix.length + path.length <= MANIFEST.geometry.width).flatMap(path => billings.flatMap(billing => {
84
- const variant = captured(name).split("\n");
85
- variant[1] = "▝▜██████▀ Opus 5.5 · " + billing;
86
- variant[2] = prefix + path;
87
- const auto = variant.join("\n");
88
- if (billing !== "Claude Max") return [auto];
89
- // Source-qualified whole-frame variant, not normalization of pane output:
90
- // the longer non-default mode label consumes nine columns of the gap.
91
- const autoFooter = " ⏵⏵ auto mode on (shift+tab to cycle) · ← for agents" + " ".repeat(37) + "◐ medium · /effort";
92
- const footer = name === banners[0] ? 11 : 10;
93
- if (variant[footer] !== autoFooter) throw new Error("fixture footer integrity");
94
- variant[footer] = " ⏵⏵ bypass permissions on (shift+tab to cycle) · ← for agents" + " ".repeat(28) + "◐ medium · /effort";
95
- return [auto, variant.join("\n")];
96
- })));
28
+ /** The enumerated tolerance, and only this: drop rows made only of box-drawing
29
+ * characters (U+2500–U+257F) and whitespace, join the rest with single spaces
30
+ * collapsing every whitespace run, trim. This absorbs wrapping at any pane
31
+ * width, indentation and padding. No case folding, removal or pattern. */
32
+ export function normalizeScreen(text) {
33
+ return String(text).split("\n").filter(row => !/^[\s─-╿]*$/u.test(row)).join(" ").replace(/\s+/gu, " ").trim();
97
34
  }
98
35
 
99
- /** Read-only qualification: no version command or harness invocation. argv is
100
- * the actual selected harness argv (excluding its executable). A reported
101
- * version, name, or environment alone is never sufficient to enable a matcher.
102
- * The channel frame is path-independent. Completion uses a finite accepted
103
- * directory-display family that cannot authorize keys.
104
- */
105
- export function qualifyLaunchPromptFixtures({ home, harness, executablePath, argv = [], platform = process.platform, arch = process.arch }) {
106
- const name = typeof harness === "string" ? harness : harness?.name;
107
- const pin = `${platform}-${arch}`;
108
- const result = { harness: { name, platform: pin, developmentChannelEligible: false }, fixtures: [] };
109
- if (name !== "claude" || pin !== MANIFEST.platform) return result;
110
- const executable = executableDigest(executablePath);
111
- if (executable?.digest !== MANIFEST.binarySha256) return result;
112
- result.validateExecutable = executable.validate;
113
- result.harness.version = MANIFEST.version;
114
- result.geometry = { ...MANIFEST.geometry };
115
- result.harness.developmentChannelEligible = channelEligible(argv);
116
- const base = { home, harness: name, version: MANIFEST.version, platform: pin };
117
- const frame = (text, kind, after, rest = {}) => ({ text, kind, after, ...MANIFEST.geometry, ...rest });
118
- try {
119
- if (result.harness.developmentChannelEligible) {
120
- result.fixtures.push({ ...base, id: "claude-2.1.289-darwin-arm64-development-channel", frames: [
121
- frame(captured("frame-05-channel-seeded.txt"), "prompt", [], { class: "awebDevelopmentChannel" }),
122
- ...[[], ["awebDevelopmentChannel"]].flatMap(after => completedFrames(home).map(text => frame(text, "completed", after))),
123
- ] });
124
- result.classifyCompletion = classifyClaudeLaunchCompletion;
36
+ const count = (text, part) => text.split(part).length - 1;
37
+
38
+ /** Reject an entry whose text could confirm anything but the affirmative option
39
+ * for the one aweb channel: one selection marker, immediately before `1.`.
40
+ * A `flag-ignored` entry is the notice Claude shows when it ignores the flag:
41
+ * it names the flag and the one channel, and carries no option or selection. */
42
+ export function validateDevChannelEntries(entries) {
43
+ const bad = (entry, why) => { throw new Error(`dev-channel tolerance entry ${JSON.stringify(entry?.id ?? null)}: ${why}`); };
44
+ if (!Array.isArray(entries) || !entries.length) bad(null, "the list must be a non-empty array");
45
+ const ids = new Set();
46
+ for (const entry of entries) {
47
+ if (typeof entry?.id !== "string" || !entry.id || ids.has(entry.id)) bad(entry, "needs a unique id");
48
+ ids.add(entry.id);
49
+ if (!["confirmation", "flag-ignored"].includes(entry.kind)) bad(entry, "kind must be confirmation or flag-ignored");
50
+ if (typeof entry.text !== "string" || !entry.text || normalizeScreen(entry.text) !== entry.text) bad(entry, "text must be non-empty and already normalized");
51
+ if (entry.kind === "confirmation") {
52
+ if (count(entry.text, SELECTION) !== 1 || !entry.text.includes(`${SELECTION} 1. `)) bad(entry, `${SELECTION} must occur exactly once, immediately before option 1.`);
53
+ if (typeof entry.selected !== "string" || !entry.selected.startsWith(`${SELECTION} 1. `) || !entry.text.includes(entry.selected)) bad(entry, `selected must be the ${SELECTION} 1. option line within text`);
54
+ } else {
55
+ if (entry.input !== "none") bad(entry, "a flag-ignored notice takes no input: input must be \"none\"");
56
+ if (entry.text.includes(SELECTION) || Object.hasOwn(entry, "selected")) bad(entry, `a flag-ignored notice has no ${SELECTION} and no selected option`);
57
+ if (count(entry.text, DEVELOPMENT) !== 1) bad(entry, `text must name ${DEVELOPMENT} once`);
58
+ }
59
+ if (count(entry.text, "plugin:") !== 1 || count(entry.text, PLUGIN) !== 1) bad(entry, `text must name exactly one channel, ${PLUGIN}`);
60
+ if (!Array.isArray(entry.provenance) || !entry.provenance.length
61
+ || entry.provenance.some(p => ["claudeVersion", "platform", "capturedAt", "source"].some(k => typeof p?.[k] !== "string" || !p[k]))) {
62
+ bad(entry, "provenance must list captures, each with claudeVersion, platform, capturedAt and source");
125
63
  }
126
- } catch {
127
- result.fixtures = [];
128
- delete result.classifyCompletion;
129
64
  }
130
- return result;
65
+ return deepFreeze(entries);
66
+ }
67
+ function deepFreeze(value) {
68
+ if (value && typeof value === "object") { for (const v of Object.values(value)) deepFreeze(v); Object.freeze(value); }
69
+ return value;
70
+ }
71
+
72
+ /** The shipped tolerance list, by kind. A new Claude wording is a new entry with
73
+ * its captured provenance, in a reviewed change; see launch-prompt-fixtures/README.md. */
74
+ const SHIPPED = validateDevChannelEntries(
75
+ JSON.parse(readFileSync(new URL("./launch-prompt-fixtures/dev-channel-confirmation.json", import.meta.url), "utf8")).entries);
76
+ export const DEV_CHANNEL_ENTRIES = Object.freeze(SHIPPED.filter(entry => entry.kind === "confirmation"));
77
+ export const FLAG_IGNORED_ENTRIES = Object.freeze(SHIPPED.filter(entry => entry.kind === "flag-ignored"));
78
+
79
+ /** The confirmation entry whose text the normalized screen EQUALS, or null. Never a contains test. */
80
+ export function matchDevChannelEntry(text, entries = DEV_CHANNEL_ENTRIES) {
81
+ const screen = normalizeScreen(text);
82
+ return entries.find(entry => entry.kind === "confirmation" && entry.text === screen) ?? null;
83
+ }
84
+
85
+ /** The screen's notice blocks: each maximal run of rows that begin with the
86
+ * notice bar, with the bar dropped from each row, normalized. */
87
+ function noticeBlocks(text) {
88
+ const blocks = [];
89
+ let rows = null;
90
+ for (const row of String(text).split("\n")) {
91
+ if (row.startsWith(NOTICE_BAR)) (rows ??= []).push(row.slice(NOTICE_BAR.length));
92
+ else if (rows) { blocks.push(normalizeScreen(rows.join("\n"))); rows = null; }
93
+ }
94
+ if (rows) blocks.push(normalizeScreen(rows.join("\n")));
95
+ return blocks;
96
+ }
97
+
98
+ /** The flag-ignored entry one notice block of the screen EQUALS, or null: equality
99
+ * of a delimited block, never a contains test on the screen. */
100
+ export function matchFlagIgnoredEntry(text, entries = FLAG_IGNORED_ENTRIES) {
101
+ const blocks = noticeBlocks(text);
102
+ return entries.find(entry => entry.kind === "flag-ignored" && blocks.includes(entry.text)) ?? null;
103
+ }
104
+
105
+ // Claude's running-session banner, as every captured session screen starts
106
+ // (2.1.289 and 2.1.296): `Claude Code v<semver>`, after the logo's row. The logo
107
+ // animates, so its row is any run of block elements (U+2580–U+259F) and spaces.
108
+ const SESSION_BANNER = /^[▀-▟ ]*Claude Code v\d+\.\d+\.\d+(?: |$)/u;
109
+
110
+ /** What a blocked start that showed Claude's running-session banner adds to its
111
+ * error and readiness remedy: the notice saying Claude ignored the flag may be hidden. */
112
+ export const CLAUDE_SESSION_HINT = "Claude may have reported that channels are not currently available and ignored the development-channel flag, its notice hidden behind another one: look at the pane. If the session is running, restart the instance, and the notice will then show. Check first for a telemetry opt-out in the launch environment (DISABLE_TELEMETRY, DO_NOT_TRACK or CLAUDE_CODE_DISABLE_NONESSENTIAL_TRAFFIC), then whether this Claude account offers channels; otherwise change the messaging provider's delivery (its readiness warning says where the setting is). See docs/configuration.md#the-development-channel-confirmation.";
113
+
114
+ /** Whether the normalized screen starts with Claude's running-session banner: a
115
+ * session is up, so no prompt is in front of it. Only a hint for a blocked start,
116
+ * never input authority. */
117
+ export function showsClaudeSession(text) {
118
+ return SESSION_BANNER.test(normalizeScreen(text));
119
+ }
120
+
121
+ /** What a non-matching screen differed in, against the entry with the longest
122
+ * common prefix: bounded snippets of the normalized texts, never the screen. */
123
+ export function devChannelDifference(text, entries = DEV_CHANNEL_ENTRIES) {
124
+ const screen = normalizeScreen(text);
125
+ let best, index = -1;
126
+ for (const entry of entries) {
127
+ let i = 0;
128
+ while (i < entry.text.length && i < screen.length && entry.text[i] === screen[i]) i++;
129
+ if (i > index) { best = entry; index = i; }
130
+ }
131
+ return { nearest: best.id, firstDifference: { index, expected: best.text.slice(index, index + SNIPPET), found: screen.slice(index, index + SNIPPET) } };
132
+ }
133
+
134
+ /** Claude's version for the audit, read without executing the harness: the
135
+ * first plain-semver segment, from the end, of the executable's real path
136
+ * (`…/claude-code@latest/2.1.296/claude`, `…/claude/versions/2.1.296`).
137
+ * Informational only; it never gates. */
138
+ export function claudeVersionOf(executablePath) {
139
+ try {
140
+ const segment = realpathSync(executablePath).split("/").reverse().find(part => /^\d+\.\d+\.\d+$/.test(part));
141
+ if (segment) return { claudeVersion: segment, claudeVersionSource: "executable-path" };
142
+ } catch { /* unresolvable path: unknown */ }
143
+ return { claudeVersion: "unknown", claudeVersionSource: "unknown" };
131
144
  }