@brutalsystems/muster 0.1.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/CANONICAL_ID.md +168 -0
- package/CONTRACT_PROVENANCE.md +53 -0
- package/LICENSE +21 -0
- package/README.md +200 -0
- package/TINCAN_LICENSE +21 -0
- package/dist/claude-policy.js +51 -0
- package/dist/codex-policy.js +40 -0
- package/dist/codex-rpc.js +116 -0
- package/dist/config.js +31 -0
- package/dist/guard.js +106 -0
- package/dist/hosts/bootstrap.js +29 -0
- package/dist/hosts/index.js +12 -0
- package/dist/hosts/macos-terminal.js +21 -0
- package/dist/hosts/pty.js +73 -0
- package/dist/hosts/tmux.js +115 -0
- package/dist/hosts/types.js +1 -0
- package/dist/identity/claude.js +64 -0
- package/dist/identity/codex.js +53 -0
- package/dist/identity/processes.js +73 -0
- package/dist/log.js +19 -0
- package/dist/muster.js +189 -0
- package/dist/naming.js +68 -0
- package/dist/reach/claude.js +18 -0
- package/dist/reach/codex.js +25 -0
- package/dist/registry.js +105 -0
- package/dist/run.js +424 -0
- package/dist/task-worker.js +65 -0
- package/dist/types.js +1 -0
- package/package.json +66 -0
- package/scripts/prepare-pty.mjs +19 -0
- package/test/fixtures/canonical-id.json +161 -0
|
@@ -0,0 +1,161 @@
|
|
|
1
|
+
{
|
|
2
|
+
"$comment": "FROZEN. Describes @brutalsystems/tincan address behaviour as shipped. Adding cases is fine; changing an expected value means the address format changed - see CANONICAL_ID.md, 'Changing this format'.",
|
|
3
|
+
"tincan_version": "0.1.0",
|
|
4
|
+
"spec": "CANONICAL_ID.md",
|
|
5
|
+
|
|
6
|
+
"slugify": [
|
|
7
|
+
{ "case": "spaces and case are folded", "input": "Auth Refactor", "output": "auth-refactor" },
|
|
8
|
+
{ "case": "runs of punctuation collapse to one dash", "input": "auth/refactor (v2)", "output": "auth-refactor-v2" },
|
|
9
|
+
{ "case": "leading and trailing separators are stripped", "input": " --Auth-- ", "output": "auth" },
|
|
10
|
+
{ "case": "non-ascii is not transliterated, it is a separator", "input": "café ☕ time", "output": "caf-time" },
|
|
11
|
+
{ "case": "digits survive", "input": "123", "output": "123" },
|
|
12
|
+
{ "case": "all-caps folds", "input": "ALLCAPS", "output": "allcaps" },
|
|
13
|
+
{ "case": "a name of only punctuation slugifies to empty", "input": "???", "output": "" },
|
|
14
|
+
{ "case": "empty in, empty out", "input": "", "output": "" }
|
|
15
|
+
],
|
|
16
|
+
|
|
17
|
+
"suffix": [
|
|
18
|
+
{ "case": "codex thread id (uuidv7): last three hex", "input": "01a0b9b4-a33e-7ab1-80a0-bb715504a0fb", "output": "0fb" },
|
|
19
|
+
{ "case": "claude session id (uuidv4): last three hex", "input": "5af69d42-2214-41d9-b13f-9c3177eb60ce", "output": "0ce" },
|
|
20
|
+
{ "case": "uppercase hex is lowercased", "input": "...ABC", "output": "abc" },
|
|
21
|
+
{ "case": "non-hex characters are stripped before slicing", "input": "z-9", "output": "9" },
|
|
22
|
+
{ "case": "no hex at all yields an empty suffix", "input": "zzzz", "output": "" },
|
|
23
|
+
{ "case": "empty in, empty out", "input": "", "output": "" }
|
|
24
|
+
],
|
|
25
|
+
|
|
26
|
+
"assign": [
|
|
27
|
+
{
|
|
28
|
+
"case": "no collision: display is the bare slug, canonical id is always qualified",
|
|
29
|
+
"peers": [ { "runtime": "codex", "rawName": "Auth refactor", "uuid": "00000000-0000-0000-0000-0000000007f3" } ],
|
|
30
|
+
"expect": [ { "display": "auth-refactor", "canonicalId": "codex:auth-refactor.7f3" } ]
|
|
31
|
+
},
|
|
32
|
+
{
|
|
33
|
+
"case": "claude peers are qualified with their runtime",
|
|
34
|
+
"peers": [ { "runtime": "claude-code", "rawName": "cohort-api", "uuid": "5af69d42-2214-41d9-b13f-9c3177eb60ce" } ],
|
|
35
|
+
"expect": [ { "display": "cohort-api", "canonicalId": "claude-code:cohort-api.0ce" } ]
|
|
36
|
+
},
|
|
37
|
+
{
|
|
38
|
+
"case": "collision: every colliding peer is suffixed, and only those",
|
|
39
|
+
"peers": [
|
|
40
|
+
{ "runtime": "codex", "rawName": "Review phase 1 handoff", "uuid": "00000000-0000-0000-0000-000000000aaa" },
|
|
41
|
+
{ "runtime": "codex", "rawName": "Review phase-1 handoff", "uuid": "00000000-0000-0000-0000-000000000bbb" },
|
|
42
|
+
{ "runtime": "codex", "rawName": "Something else", "uuid": "00000000-0000-0000-0000-000000000ccc" }
|
|
43
|
+
],
|
|
44
|
+
"expect": [
|
|
45
|
+
{ "display": "review-phase-1-handoff.aaa", "canonicalId": "codex:review-phase-1-handoff.aaa" },
|
|
46
|
+
{ "display": "review-phase-1-handoff.bbb", "canonicalId": "codex:review-phase-1-handoff.bbb" },
|
|
47
|
+
{ "display": "something-else", "canonicalId": "codex:something-else.ccc" }
|
|
48
|
+
]
|
|
49
|
+
},
|
|
50
|
+
{
|
|
51
|
+
"case": "an unnamed thread always carries its suffix, even alone",
|
|
52
|
+
"peers": [ { "runtime": "codex", "rawName": null, "uuid": "00000000-0000-0000-0000-0000000007f3" } ],
|
|
53
|
+
"expect": [ { "display": "thread.7f3", "canonicalId": "codex:thread.7f3" } ]
|
|
54
|
+
},
|
|
55
|
+
{
|
|
56
|
+
"case": "KNOWN DEFECT: a name that slugifies to empty displays bare, unlike an unnamed thread",
|
|
57
|
+
"peers": [ { "runtime": "codex", "rawName": "???", "uuid": "00000000-0000-0000-0000-000000000def" } ],
|
|
58
|
+
"expect": [ { "display": "thread", "canonicalId": "codex:thread.def" } ]
|
|
59
|
+
},
|
|
60
|
+
{
|
|
61
|
+
"case": "unnamed and slugifies-to-empty collide on 'thread', so both are suffixed",
|
|
62
|
+
"peers": [
|
|
63
|
+
{ "runtime": "codex", "rawName": null, "uuid": "00000000-0000-0000-0000-000000000aaa" },
|
|
64
|
+
{ "runtime": "codex", "rawName": "???", "uuid": "00000000-0000-0000-0000-000000000bbb" }
|
|
65
|
+
],
|
|
66
|
+
"expect": [
|
|
67
|
+
{ "display": "thread.aaa", "canonicalId": "codex:thread.aaa" },
|
|
68
|
+
{ "display": "thread.bbb", "canonicalId": "codex:thread.bbb" }
|
|
69
|
+
]
|
|
70
|
+
},
|
|
71
|
+
{
|
|
72
|
+
"case": "KNOWN DEFECT: canonical_id is not unique when slug and suffix both collide",
|
|
73
|
+
"peers": [
|
|
74
|
+
{ "runtime": "codex", "rawName": "Auth refactor", "uuid": "11111111-0000-0000-0000-000000000abc" },
|
|
75
|
+
{ "runtime": "codex", "rawName": "auth-refactor", "uuid": "22222222-0000-0000-0000-000000000abc" }
|
|
76
|
+
],
|
|
77
|
+
"expect": [
|
|
78
|
+
{ "display": "auth-refactor.abc", "canonicalId": "codex:auth-refactor.abc" },
|
|
79
|
+
{ "display": "auth-refactor.abc", "canonicalId": "codex:auth-refactor.abc" }
|
|
80
|
+
]
|
|
81
|
+
}
|
|
82
|
+
],
|
|
83
|
+
|
|
84
|
+
"resolve": [
|
|
85
|
+
{
|
|
86
|
+
"case": "exact display name",
|
|
87
|
+
"peers": [ { "runtime": "codex", "rawName": "Auth refactor", "uuid": "00000000-0000-0000-0000-0000000007f3" } ],
|
|
88
|
+
"input": "auth-refactor",
|
|
89
|
+
"expect": { "ok": true, "canonicalId": "codex:auth-refactor.7f3" }
|
|
90
|
+
},
|
|
91
|
+
{
|
|
92
|
+
"case": "qualified form, accepted even with no collision",
|
|
93
|
+
"peers": [ { "runtime": "codex", "rawName": "Auth refactor", "uuid": "00000000-0000-0000-0000-0000000007f3" } ],
|
|
94
|
+
"input": "auth-refactor.7f3",
|
|
95
|
+
"expect": { "ok": true, "canonicalId": "codex:auth-refactor.7f3" }
|
|
96
|
+
},
|
|
97
|
+
{
|
|
98
|
+
"case": "fully qualified canonical id is accepted as input",
|
|
99
|
+
"peers": [ { "runtime": "codex", "rawName": "Auth refactor", "uuid": "00000000-0000-0000-0000-0000000007f3" } ],
|
|
100
|
+
"input": "codex:auth-refactor.7f3",
|
|
101
|
+
"expect": { "ok": true, "canonicalId": "codex:auth-refactor.7f3" }
|
|
102
|
+
},
|
|
103
|
+
{
|
|
104
|
+
"case": "case-insensitive, and input is trimmed",
|
|
105
|
+
"peers": [ { "runtime": "codex", "rawName": "Auth refactor", "uuid": "00000000-0000-0000-0000-0000000007f3" } ],
|
|
106
|
+
"input": " AUTH-REFACTOR.7F3 ",
|
|
107
|
+
"expect": { "ok": true, "canonicalId": "codex:auth-refactor.7f3" }
|
|
108
|
+
},
|
|
109
|
+
{
|
|
110
|
+
"case": "unambiguous prefix resolves",
|
|
111
|
+
"peers": [
|
|
112
|
+
{ "runtime": "codex", "rawName": "Auth refactor", "uuid": "00000000-0000-0000-0000-0000000007f3" },
|
|
113
|
+
{ "runtime": "codex", "rawName": "Billing sync", "uuid": "00000000-0000-0000-0000-000000000b12" }
|
|
114
|
+
],
|
|
115
|
+
"input": "auth",
|
|
116
|
+
"expect": { "ok": true, "canonicalId": "codex:auth-refactor.7f3" }
|
|
117
|
+
},
|
|
118
|
+
{
|
|
119
|
+
"case": "ambiguous prefix is refused, listing every candidate in qualified form",
|
|
120
|
+
"peers": [
|
|
121
|
+
{ "runtime": "codex", "rawName": "Billing sync", "uuid": "00000000-0000-0000-0000-000000000b12" },
|
|
122
|
+
{ "runtime": "codex", "rawName": "Billing report", "uuid": "00000000-0000-0000-0000-000000000b34" }
|
|
123
|
+
],
|
|
124
|
+
"input": "billing",
|
|
125
|
+
"expect": { "ok": false, "reason": "ambiguous", "candidates": ["billing-report.b34", "billing-sync.b12"] }
|
|
126
|
+
},
|
|
127
|
+
{
|
|
128
|
+
"case": "unknown name is refused, and candidates list every peer in display form",
|
|
129
|
+
"peers": [
|
|
130
|
+
{ "runtime": "codex", "rawName": "Auth refactor", "uuid": "00000000-0000-0000-0000-0000000007f3" },
|
|
131
|
+
{ "runtime": "codex", "rawName": "Billing sync", "uuid": "00000000-0000-0000-0000-000000000b12" }
|
|
132
|
+
],
|
|
133
|
+
"input": "zzz",
|
|
134
|
+
"expect": { "ok": false, "reason": "unknown", "candidates": ["auth-refactor", "billing-sync"] }
|
|
135
|
+
},
|
|
136
|
+
{
|
|
137
|
+
"case": "KNOWN DEFECT: colliding canonical ids refuse with two identical candidates",
|
|
138
|
+
"peers": [
|
|
139
|
+
{ "runtime": "codex", "rawName": "Auth refactor", "uuid": "11111111-0000-0000-0000-000000000abc" },
|
|
140
|
+
{ "runtime": "codex", "rawName": "auth-refactor", "uuid": "22222222-0000-0000-0000-000000000abc" }
|
|
141
|
+
],
|
|
142
|
+
"input": "codex:auth-refactor.abc",
|
|
143
|
+
"expect": { "ok": false, "reason": "ambiguous", "candidates": ["auth-refactor.abc", "auth-refactor.abc"] }
|
|
144
|
+
},
|
|
145
|
+
{
|
|
146
|
+
"case": "empty input is a prefix of everything: ambiguous when more than one peer",
|
|
147
|
+
"peers": [
|
|
148
|
+
{ "runtime": "codex", "rawName": "Auth refactor", "uuid": "00000000-0000-0000-0000-0000000007f3" },
|
|
149
|
+
{ "runtime": "codex", "rawName": "Billing sync", "uuid": "00000000-0000-0000-0000-000000000b12" }
|
|
150
|
+
],
|
|
151
|
+
"input": "",
|
|
152
|
+
"expect": { "ok": false, "reason": "ambiguous", "candidates": ["auth-refactor.7f3", "billing-sync.b12"] }
|
|
153
|
+
},
|
|
154
|
+
{
|
|
155
|
+
"case": "KNOWN DEFECT: empty input resolves to the only peer when there is exactly one",
|
|
156
|
+
"peers": [ { "runtime": "codex", "rawName": "Auth refactor", "uuid": "00000000-0000-0000-0000-0000000007f3" } ],
|
|
157
|
+
"input": "",
|
|
158
|
+
"expect": { "ok": true, "canonicalId": "codex:auth-refactor.7f3" }
|
|
159
|
+
}
|
|
160
|
+
]
|
|
161
|
+
}
|