@awebai/oats 0.50.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.
- package/README.md +1 -0
- package/bin/oats.mjs +153 -51
- package/docs/capabilities.md +11 -3
- package/docs/configuration.md +134 -88
- package/docs/desktop-cli-api.md +994 -71
- package/docs/desktop-instance-start.md +56 -0
- package/docs/desktop.md +10 -7
- package/docs/execution-targets.md +230 -59
- package/docs/first-team.md +3 -1
- package/docs/harness-trust.md +50 -2
- package/docs/implementation.md +73 -8
- package/docs/integrations.md +9 -8
- package/docs/knowledge-reference/acceptance.md +1 -0
- package/docs/knowledge-reference/harvester.md +5 -3
- package/docs/knowledge-reference/model.md +5 -3
- package/docs/knowledge-theory.md +1 -1
- package/docs/knowledge.md +43 -7
- package/docs/launch-prompt-completion.md +50 -48
- package/docs/oats-local.schema.json +4 -3
- package/docs/official-catalog.md +4 -4
- package/docs/packages.md +14 -14
- package/docs/release-lane.md +15 -5
- package/docs/release-notes/v0.44.0.md +1 -1
- package/docs/release-notes/v0.51.0.md +156 -0
- package/docs/release-notes/v0.52.0.md +933 -0
- package/docs/schedules.md +91 -4
- package/docs/servers.md +21 -2
- package/docs/souls-and-instances.md +113 -21
- package/docs/tui.md +152 -0
- package/docs/workspaces.md +2 -2
- package/lib/claim.mjs +266 -0
- package/lib/core.mjs +845 -166
- package/lib/errors.mjs +170 -0
- package/lib/harness-trust-write.mjs +68 -27
- package/lib/harness-trust.mjs +34 -16
- package/lib/instance-inspect.mjs +40 -11
- package/lib/instance-lifecycle.mjs +169 -47
- package/lib/launch-preference.mjs +16 -0
- package/lib/launch-prompt-completion.mjs +7 -43
- package/lib/launch-prompt-evidence.mjs +14 -7
- package/lib/launch-prompt-fixtures/README.md +86 -152
- package/lib/launch-prompt-fixtures/dev-channel-confirmation.json +50 -0
- package/lib/launch-prompt-fixtures.mjs +122 -109
- package/lib/launch-prompt-transport.mjs +2 -56
- package/lib/launch-prompts.mjs +102 -100
- package/lib/schedule-host.mjs +154 -22
- package/lib/schedule.mjs +73 -24
- package/lib/servers.mjs +20 -4
- package/lib/session-viewer.mjs +87 -10
- package/lib/system-tools.mjs +39 -0
- package/lib/tmux-server-scope.mjs +62 -0
- package/lib/triggers.mjs +4 -4
- package/lib/workspace.mjs +5 -11
- package/lib/worktree-hooks.mjs +116 -23
- package/lib/worktree.mjs +89 -102
- package/package-catalog.json +3 -3
- package/package.json +7 -2
- package/packages/client/capability-show-contract.mjs +230 -0
- package/packages/client/capability-warnings-contract.mjs +57 -0
- package/packages/client/cli-adapter.mjs +548 -0
- package/packages/client/cli-environment.mjs +53 -0
- package/packages/client/cli-locator.mjs +253 -0
- package/packages/client/cli-probe-contract.mjs +47 -0
- package/packages/client/client-terms.mjs +60 -0
- package/packages/client/deployment-contract.mjs +68 -0
- package/packages/client/deployment-data.mjs +483 -0
- package/packages/client/deployment-facts.mjs +34 -0
- package/packages/client/deployment-label.mjs +76 -0
- package/packages/client/deployment-observer.mjs +89 -0
- package/packages/client/deployment-panel.mjs +142 -0
- package/packages/client/deployment-read-cli.mjs +53 -0
- package/packages/client/display-text.mjs +44 -0
- package/packages/client/harness-names.mjs +30 -0
- package/packages/client/inspect-contract.mjs +62 -0
- package/packages/client/instance-acts.mjs +54 -0
- package/packages/client/instance-admission.mjs +45 -0
- package/packages/client/instance-events-contract.mjs +74 -0
- package/packages/client/instance-git-contract.mjs +80 -0
- package/packages/client/instance-presentation.mjs +22 -0
- package/packages/client/instance-tree.mjs +453 -0
- package/packages/client/kernel-environment.mjs +11 -0
- package/packages/client/launch-contract.mjs +51 -0
- package/packages/client/launch-prompt-outcome.mjs +165 -0
- package/packages/client/lifecycle-cli.mjs +61 -0
- package/packages/client/lifecycle-contract.mjs +372 -0
- package/packages/client/liveness-main.mjs +10 -0
- package/packages/client/liveness.mjs +35 -0
- package/packages/client/machine-contract.mjs +123 -0
- package/packages/client/own-environment.mjs +22 -0
- package/packages/client/panel-views.mjs +286 -0
- package/packages/client/readiness-contract.mjs +172 -0
- package/packages/client/refresh-loop.mjs +52 -0
- package/packages/client/remote-address.mjs +126 -0
- package/packages/client/remote-roster.mjs +67 -0
- package/packages/client/roster-sections.mjs +80 -0
- package/packages/client/spawn-apply-cli.mjs +104 -0
- package/packages/client/spawn-apply-contract.mjs +183 -0
- package/packages/client/spawn-decision.mjs +46 -0
- package/packages/client/spawn-messages.mjs +119 -0
- package/packages/client/spawn-preview-cli.mjs +32 -0
- package/packages/client/spawn-preview-contract.mjs +314 -0
- package/packages/client/team-members.mjs +41 -0
- package/packages/client/team-rows.mjs +45 -0
- package/packages/client/terminal-contract.mjs +57 -0
- package/packages/client/tmux-status.mjs +66 -0
- package/packages/client/waiting-on-you.mjs +88 -0
- package/packages/client/workspace-admission.mjs +45 -0
- package/packages/client/workspace-cli.mjs +142 -0
- package/packages/client/workspace-views.mjs +147 -0
- package/packages/tui/README.md +46 -0
- package/packages/tui/bin/tui.mjs +7 -0
- package/packages/tui/lib/actions.mjs +29 -0
- package/packages/tui/lib/client.mjs +4 -0
- package/packages/tui/lib/main.mjs +105 -0
- package/packages/tui/lib/term/keys.mjs +323 -0
- package/packages/tui/lib/term/screen.mjs +122 -0
- package/packages/tui/lib/term/style.mjs +43 -0
- package/packages/tui/lib/term/text.mjs +49 -0
- package/packages/tui/lib/term/tty.mjs +168 -0
- package/packages/tui/lib/term/width.mjs +124 -0
- package/packages/tui/lib/views/frame.mjs +62 -0
- package/packages/tui/lib/views/help.mjs +28 -0
- package/packages/tui/package.json +8 -0
- package/skills/oats-getting-started/SKILL.md +29 -22
- package/lib/launch-prompt-fixtures/claude-2.1.289-darwin-arm64/frame-05-channel-seeded.txt +0 -35
- package/lib/launch-prompt-fixtures/claude-2.1.289-darwin-arm64/frame-06-first-after-channel.txt +0 -35
- package/lib/launch-prompt-fixtures/claude-2.1.289-darwin-arm64/frame-07-after-channel-200ms.txt +0 -35
- package/lib/launch-prompt-fixtures/claude-2.1.289-darwin-arm64/frame-08-installed-after-channel-200ms.txt +0 -35
- package/lib/launch-prompt-fixtures/claude-2.1.289-darwin-arm64/manifest.json +0 -77
- package/lib/launch-prompt-fixtures/claude-2.1.289-darwin-arm64/max-bypass-source.json +0 -88
- package/lib/launch-prompt-fixtures/structural-completion.json +0 -205
- package/lib/launch-prompt-policy.mjs +0 -87
|
@@ -1,152 +1,86 @@
|
|
|
1
|
-
# Development-channel
|
|
2
|
-
|
|
3
|
-
`
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
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 {
|
|
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
|
-
|
|
12
|
-
|
|
13
|
-
|
|
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
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
return
|
|
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
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
function
|
|
66
|
-
|
|
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
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
*
|
|
103
|
-
*
|
|
104
|
-
*/
|
|
105
|
-
export function
|
|
106
|
-
const
|
|
107
|
-
|
|
108
|
-
const
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
|
|
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
|
|
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
|
}
|