@thebattlearena/corner 0.9.0 → 0.10.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/package.json +1 -1
- package/plugin/.claude-plugin/plugin.json +1 -1
- package/ring/agents/cornerman.md +20 -3
- package/ring/agents/wrestler.md +11 -0
- package/ring/hooks/hooks.json +20 -0
- package/ring/scripts/bout-stats-render.mjs +366 -0
- package/ring/scripts/bout-stats.mjs +360 -0
- package/ring/scripts/config.mjs +1 -1
- package/ring/scripts/contract-endpoints.mjs +163 -0
- package/ring/scripts/contract-preview.mjs +34 -14
- package/ring/scripts/fight.mjs +27 -0
- package/ring/scripts/findings.mjs +3 -1
- package/ring/scripts/format-gate.mjs +723 -0
- package/ring/scripts/format-worker.mjs +120 -0
- package/ring/scripts/front-routes.mjs +345 -0
- package/ring/scripts/judges-card.mjs +324 -3
- package/ring/scripts/lookout.mjs +22 -4
- package/ring/scripts/mask-guard.mjs +34 -1
- package/ring/scripts/page-embed.mjs +112 -0
- package/ring/scripts/play-by-play.mjs +155 -7
- package/ring/scripts/preparation-collect.mjs +177 -0
- package/ring/scripts/preparation.mjs +547 -0
- package/ring/scripts/round-bell.mjs +9 -2
- package/ring/scripts/tech-plan-log.mjs +81 -0
- package/ring/scripts/tech-plan.mjs +191 -0
- package/ring/scripts/verdicts-log.mjs +75 -0
- package/ring/scripts/verdicts.mjs +205 -0
- package/ring/skills/play-by-play/SKILL.md +235 -33
- package/ring/skills/play-by-play/templates/blocks.css +196 -0
- package/ring/skills/play-by-play/templates/chronicle.html +358 -55
- package/ring/skills/play-by-play/templates/endpoints-view.js +1153 -0
- package/ring/skills/play-by-play/templates/interview-form.js +516 -0
- package/ring/skills/play-by-play/templates/now-panel.js +719 -0
- package/ring/skills/referee/SKILL.md +136 -42
- package/ring/skills/referee/references/api-diagram.md +56 -0
- package/ring/skills/referee/references/precedents.md +11 -0
- package/ring/skills/referee/references/rulebook.md +65 -4
- package/ring/skills/referee/templates/api-diagram.html +115 -0
- package/ring/skills/referee/templates/escalation.md +7 -1
- package/ring/skills/referee/templates/round-bell-body.md +4 -0
- package/ring/skills/referee/templates/wrestler-brief.md +3 -0
- package/ring/skills/sparring/SKILL.md +10 -2
- package/ring/skills/sparring/templates/contrato.md +29 -0
- package/ring/skills/sparring/templates/rudo-brief.md +7 -0
- package/ring/skills/weigh-in/SKILL.md +6 -0
|
@@ -0,0 +1,115 @@
|
|
|
1
|
+
<!doctype html>
|
|
2
|
+
<!-- The endpoints of the contract for the judge (references/api-diagram.md). Copy to
|
|
3
|
+
<bout dir>/api-diagram.html and replace every <…>. Adapted from the architecture type of
|
|
4
|
+
diagram-design by Cathryn Lavery, MIT: references/diagram-design-LICENSE.md. No scripts: the
|
|
5
|
+
preview frames it without them. -->
|
|
6
|
+
<html lang="<judge's language, e.g. es>">
|
|
7
|
+
<head>
|
|
8
|
+
<meta charset="utf-8">
|
|
9
|
+
<meta name="viewport" content="width=device-width, initial-scale=1">
|
|
10
|
+
<title><contract title></title>
|
|
11
|
+
<link href="https://fonts.googleapis.com/css2?family=Instrument+Serif:ital@0;1&family=Geist:wght@400;500;600&family=Geist+Mono:wght@400;500;600&display=swap" rel="stylesheet">
|
|
12
|
+
<style>
|
|
13
|
+
:root { --paper:#f5f5f5; --ink:#2d3142; --muted:#4f5d75; --soft:#7a8399; --rule:rgba(45,49,66,0.12); --accent:#eb6c36; }
|
|
14
|
+
* { box-sizing:border-box; }
|
|
15
|
+
body { margin:0; background:var(--paper); color:var(--ink); font-family:'Geist',sans-serif; }
|
|
16
|
+
main { max-width:1080px; margin:0 auto; padding:32px 24px 40px; }
|
|
17
|
+
.eyebrow { font-family:'Geist Mono',monospace; font-size:12px; letter-spacing:0.14em; color:var(--muted); text-transform:uppercase; margin:0 0 8px; }
|
|
18
|
+
h1 { font-family:'Instrument Serif',serif; font-weight:400; font-size:1.75rem; margin:0 0 8px; }
|
|
19
|
+
.sub { color:var(--muted); font-size:14px; margin:0 0 24px; max-width:760px; line-height:1.5; }
|
|
20
|
+
svg { width:100%; height:auto; display:block; }
|
|
21
|
+
.card { background:#fff; border:1px solid var(--rule); border-radius:6px; padding:20px; margin-top:24px; overflow-x:auto; }
|
|
22
|
+
.card h3 { font-size:14px; margin:0 0 12px; }
|
|
23
|
+
table { border-collapse:collapse; width:100%; font-size:13px; }
|
|
24
|
+
th { text-align:left; font-family:'Geist Mono',monospace; font-size:11px; letter-spacing:0.08em; text-transform:uppercase; color:var(--soft); font-weight:500; padding:0 12px 8px 0; }
|
|
25
|
+
td { padding:8px 12px 8px 0; border-top:1px solid var(--rule); vertical-align:top; line-height:1.5; }
|
|
26
|
+
code { font-family:'Geist Mono',monospace; font-size:12px; }
|
|
27
|
+
.m { color:var(--accent); font-weight:600; }
|
|
28
|
+
ul { margin:0; padding-left:18px; font-size:13px; line-height:1.6; }
|
|
29
|
+
li { margin-bottom:6px; }
|
|
30
|
+
footer { margin-top:32px; padding-top:12px; border-top:1px solid var(--rule); font-family:'Geist Mono',monospace; font-size:12px; color:var(--soft); }
|
|
31
|
+
</style>
|
|
32
|
+
</head>
|
|
33
|
+
<body>
|
|
34
|
+
<main>
|
|
35
|
+
<p class="eyebrow">PR #<n> · <API contract></p>
|
|
36
|
+
<h1><contract title></h1>
|
|
37
|
+
<p class="sub"><one or two sentences: which endpoints change and for what, in plain words></p>
|
|
38
|
+
|
|
39
|
+
<!-- Size the viewBox to the boxes. Columns: callers (x 40), endpoints (x 300), tables (x 760).
|
|
40
|
+
Draw connectors first, then the boxes on top. -->
|
|
41
|
+
<svg viewBox="0 0 960 300" role="img" aria-labelledby="api-title api-desc">
|
|
42
|
+
<title id="api-title"><contract title></title>
|
|
43
|
+
<desc id="api-desc"><who calls what and which tables it touches, in one sentence></desc>
|
|
44
|
+
<defs>
|
|
45
|
+
<marker id="arrow" markerWidth="8" markerHeight="6" refX="7" refY="3" orient="auto">
|
|
46
|
+
<polygon points="0 0, 8 3, 0 6" fill="#4f5d75"/>
|
|
47
|
+
</marker>
|
|
48
|
+
<marker id="arrow-accent" markerWidth="8" markerHeight="6" refX="7" refY="3" orient="auto">
|
|
49
|
+
<polygon points="0 0, 8 3, 0 6" fill="#eb6c36"/>
|
|
50
|
+
</marker>
|
|
51
|
+
</defs>
|
|
52
|
+
<rect width="100%" height="100%" fill="#f5f5f5"/>
|
|
53
|
+
|
|
54
|
+
<!-- Caller → endpoint: a straight line when they share y, otherwise a rounded elbow
|
|
55
|
+
(M x1,y1 H mid-8 Q mid,y1 mid,y1+8 V y2-8 Q mid,y2 mid+8,y2 H x2). -->
|
|
56
|
+
<line x1="220" y1="96" x2="298" y2="96" stroke="#4f5d75" stroke-width="1.2" marker-end="url(#arrow)"/>
|
|
57
|
+
<!-- Endpoint → table: solid = writes, dashed = reads; the label on a paper patch 6 px above. -->
|
|
58
|
+
<path d="M 660,96 H 702 Q 710,96 710,104 V 172 Q 710,180 718,180 H 758" fill="none" stroke="#eb6c36" stroke-width="1.2" marker-end="url(#arrow-accent)"/>
|
|
59
|
+
<rect x="672" y="78" width="40" height="12" rx="2" fill="#f5f5f5"/>
|
|
60
|
+
<text x="692" y="87" fill="#7a8399" font-size="8" font-family="'Geist Mono',monospace" text-anchor="middle" letter-spacing="0.06em">writes</text>
|
|
61
|
+
<line x1="660" y1="232" x2="758" y2="232" stroke="#4f5d75" stroke-width="1" stroke-dasharray="4,3" marker-end="url(#arrow)"/>
|
|
62
|
+
<rect x="690" y="214" width="36" height="12" rx="2" fill="#f5f5f5"/>
|
|
63
|
+
<text x="708" y="223" fill="#7a8399" font-size="8" font-family="'Geist Mono',monospace" text-anchor="middle" letter-spacing="0.06em">reads</text>
|
|
64
|
+
|
|
65
|
+
<!-- Caller: grey, tag CALLER. -->
|
|
66
|
+
<rect x="40" y="64" width="180" height="64" rx="6" fill="rgba(79,93,117,0.10)" stroke="#7a8399" stroke-width="1"/>
|
|
67
|
+
<rect x="52" y="76" width="52" height="12" rx="2" fill="none" stroke="rgba(45,49,66,0.40)" stroke-width="0.8"/>
|
|
68
|
+
<text x="78" y="85" fill="#4f5d75" font-size="8" font-family="'Geist Mono',monospace" text-anchor="middle" letter-spacing="0.08em">CALLER</text>
|
|
69
|
+
<text x="52" y="112" fill="#2d3142" font-size="12" font-weight="600" font-family="'Geist',sans-serif"><screen or action></text>
|
|
70
|
+
|
|
71
|
+
<!-- New (or changed) endpoint: accent stroke and tint; method tag, path, then in / out / err. -->
|
|
72
|
+
<rect x="300" y="64" width="360" height="132" rx="6" fill="rgba(235,108,54,0.08)" stroke="#eb6c36" stroke-width="1"/>
|
|
73
|
+
<rect x="312" y="76" width="40" height="12" rx="2" fill="none" stroke="rgba(235,108,54,0.50)" stroke-width="0.8"/>
|
|
74
|
+
<text x="332" y="85" fill="#eb6c36" font-size="8" font-family="'Geist Mono',monospace" text-anchor="middle" letter-spacing="0.08em">NEW</text>
|
|
75
|
+
<text x="312" y="108" fill="#eb6c36" font-size="12" font-weight="600" font-family="'Geist Mono',monospace">POST</text>
|
|
76
|
+
<text x="352" y="108" fill="#2d3142" font-size="12" font-weight="600" font-family="'Geist Mono',monospace"><path></text>
|
|
77
|
+
<line x1="300" y1="118" x2="660" y2="118" stroke="rgba(235,108,54,0.30)" stroke-width="0.8"/>
|
|
78
|
+
<text x="312" y="138" fill="#2d3142" font-size="12" font-family="'Geist Mono',monospace">in · <param>: <type>, <body field>: <type></text>
|
|
79
|
+
<text x="312" y="158" fill="#2d3142" font-size="12" font-family="'Geist Mono',monospace">out · 201 { <field>: <type>, … }</text>
|
|
80
|
+
<text x="312" y="178" fill="#4f5d75" font-size="12" font-family="'Geist Mono',monospace">err · 404 <code> · 409 <code></text>
|
|
81
|
+
|
|
82
|
+
<!-- Existing endpoint the change reuses: grey, tag EXISTING, path only plus a note. -->
|
|
83
|
+
<rect x="300" y="212" width="360" height="56" rx="6" fill="rgba(45,49,66,0.03)" stroke="rgba(45,49,66,0.30)" stroke-width="1"/>
|
|
84
|
+
<rect x="312" y="222" width="64" height="12" rx="2" fill="none" stroke="rgba(45,49,66,0.40)" stroke-width="0.8"/>
|
|
85
|
+
<text x="344" y="231" fill="#4f5d75" font-size="8" font-family="'Geist Mono',monospace" text-anchor="middle" letter-spacing="0.08em">EXISTING</text>
|
|
86
|
+
<text x="312" y="254" fill="#4f5d75" font-size="12" font-family="'Geist Mono',monospace">GET <path></text>
|
|
87
|
+
<text x="520" y="254" fill="#7a8399" font-size="12" font-family="'Instrument Serif',serif" font-style="italic">unchanged</text>
|
|
88
|
+
|
|
89
|
+
<!-- Tables: name only; accent when the model diagram shows them new or changed. -->
|
|
90
|
+
<rect x="760" y="164" width="160" height="32" rx="6" fill="rgba(235,108,54,0.08)" stroke="#eb6c36" stroke-width="1"/>
|
|
91
|
+
<text x="772" y="185" fill="#2d3142" font-size="12" font-family="'Geist Mono',monospace"><new_table></text>
|
|
92
|
+
<rect x="760" y="216" width="160" height="32" rx="6" fill="rgba(45,49,66,0.05)" stroke="#4f5d75" stroke-width="1"/>
|
|
93
|
+
<text x="772" y="237" fill="#2d3142" font-size="12" font-family="'Geist Mono',monospace"><existing_table></text>
|
|
94
|
+
</svg>
|
|
95
|
+
|
|
96
|
+
<div class="card">
|
|
97
|
+
<h3><The contract per endpoint></h3>
|
|
98
|
+
<table>
|
|
99
|
+
<thead><tr><th>Endpoint</th><th>Request</th><th>Response</th><th>Errors</th><th>Scoping</th></tr></thead>
|
|
100
|
+
<tbody>
|
|
101
|
+
<tr><td><code><span class="m">POST</span> <path></code></td><td><params and body></td><td><status and shape></td><td><status · code · when></td><td><tenant / workspace / user></td></tr>
|
|
102
|
+
</tbody>
|
|
103
|
+
</table>
|
|
104
|
+
</div>
|
|
105
|
+
<div class="card">
|
|
106
|
+
<h3><What to validate></h3>
|
|
107
|
+
<ul>
|
|
108
|
+
<li><b><decision>:</b> <what it means and what to check></li>
|
|
109
|
+
<li><b><shortcut of the sparring>:</b> <keep, fix in this bout, or ticket></li>
|
|
110
|
+
</ul>
|
|
111
|
+
</div>
|
|
112
|
+
<footer><Sources: the spec paths on branch …, and the sparring's contrato-<repo>.md files></footer>
|
|
113
|
+
</main>
|
|
114
|
+
</body>
|
|
115
|
+
</html>
|
|
@@ -2,7 +2,13 @@
|
|
|
2
2
|
host sets delegation to "human". Under the default "referee" delegation, design doubts are
|
|
3
3
|
decided and recorded, never sent here. Numbered text, answerable as "1. b", by default;
|
|
4
4
|
AskUserQuestion only when the host repo's instructions require it. The wrestler keeps working
|
|
5
|
-
on something else meanwhile: never leave it idle waiting for an answer.
|
|
5
|
+
on something else meanwhile: never leave it idle waiting for an answer.
|
|
6
|
+
Keep each question on one numbered line with its options «(a) … · (b) …» and «I recommend
|
|
7
|
+
(x)» (or «Te recomiendo (x)»): `judges-card.mjs log <pr> escalation <file>` reads them from
|
|
8
|
+
there for the chronicle's interview, and `log <pr> answer` stamps the judge's reply.
|
|
9
|
+
Write its context too, in a file of its own, one `## Contexto <n> · <question>` section per
|
|
10
|
+
question: what each option includes, leaves out and costs. Log it with `--context <file>`;
|
|
11
|
+
the chronicle shows it under «Ver más información». -->
|
|
6
12
|
|
|
7
13
|
**Done up to `<sha>`** (<concept>, round-bell #<n>).
|
|
8
14
|
|
|
@@ -4,6 +4,9 @@
|
|
|
4
4
|
|
|
5
5
|
Assignment: <what and why, in 3 lines>. PR #<pr>, branch `<branch>`, stack base `<base>`.
|
|
6
6
|
|
|
7
|
+
Flow change (P15; write "none" when no flow changes): today <what happens>; after this PR <what
|
|
8
|
+
will happen>; who notices <role or screen>.
|
|
9
|
+
|
|
7
10
|
Worktree: `<absolute worktree path>`. Your cwd resets: every git command is `git -C <worktree> …`.
|
|
8
11
|
Start with: `git -C <worktree> fetch -q origin && git -C <worktree> checkout -B <branch> origin/<branch>`.
|
|
9
12
|
Ring scripts: `<absolute ring path>/scripts` (one-at-a-time.mjs lives there).
|
|
@@ -29,8 +29,16 @@ rest of the timebox goes to the controls that are still dead. Where time goes, a
|
|
|
29
29
|
correction. Everything that does not change the hypothesis, the proof, the scope or a hard stop,
|
|
30
30
|
you decide without asking, then and while the rudos work.
|
|
31
31
|
- **Contract first, in the first 15 minutes.** With several repos, the producer writes the contract
|
|
32
|
-
(routes, shapes, error codes) to `<sparring dir>/contrato
|
|
33
|
-
starts at once against it. The consumer never waits for the producer's code.
|
|
32
|
+
(routes, shapes, error codes) to its own `<sparring dir>/contrato-<repo>.md` before implementing,
|
|
33
|
+
and every rudo starts at once against it. The consumer never waits for the producer's code.
|
|
34
|
+
- **Every contract is written down the moment it is proposed**, with one repo too: each endpoint
|
|
35
|
+
and each data model a rudo adds or changes goes to `<sparring dir>/contrato-<repo>.md`
|
|
36
|
+
(`templates/contrato.md`) before it is implemented, with its shortcuts, and stays current when
|
|
37
|
+
the rudo changes it. **One file per repo, written only by that repo's rudo**: rudos run at the
|
|
38
|
+
same time, and two editing one file overwrite each other's entries. A rudo reads another repo's
|
|
39
|
+
file, never writes it. The sparring approves none of it: the referee bout that refactors a KO
|
|
40
|
+
opens with these bases and takes them to the judge first, because most of the code to build
|
|
41
|
+
depends on them.
|
|
34
42
|
- **Ceremony the rudo skips:** migrations in the repo (tables come from a SQL in `tools/`), OpenAPI
|
|
35
43
|
and generated types until the last push, typecheck after every edit (only before each push),
|
|
36
44
|
tests, wiki, DTOs, CQRS, ports, feature flags. Each one goes on the shortcuts list.
|
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
# Contracts proposed · {{slug}} · <repo>
|
|
2
|
+
|
|
3
|
+
<!-- One entry per endpoint or data model a rudo adds or changes, written the moment it proposes
|
|
4
|
+
it, before implementing it. Nothing here is approved: the referee bout that refactors this
|
|
5
|
+
sparring opens with these bases, draws them and takes them to the judge (§2b) before any code
|
|
6
|
+
depends on them. Keep each entry current when the rudo changes it; never delete one, mark it
|
|
7
|
+
`dropped` with why. -->
|
|
8
|
+
|
|
9
|
+
## Endpoints
|
|
10
|
+
|
|
11
|
+
### `<METHOD> <path>` · <repo> · <new | changed | dropped>
|
|
12
|
+
|
|
13
|
+
- **What it is for:** <the screen or action that calls it>.
|
|
14
|
+
- **Request:** <path and query params, body fields with type and whether required>.
|
|
15
|
+
- **Response:** <status and shape, fields with type; pagination when it lists>.
|
|
16
|
+
- **Errors:** <status · code · when>.
|
|
17
|
+
- **Scoping:** <tenant / workspace / user it is filtered by>.
|
|
18
|
+
- **Shortcut taken:** <what the sparring skipped here: no DTO, no auth check, a mock… | none>.
|
|
19
|
+
|
|
20
|
+
## Data models
|
|
21
|
+
|
|
22
|
+
### `<table or entity>` · <repo> · <new | changed | dropped>
|
|
23
|
+
|
|
24
|
+
- **Columns:** <name · type · nullable / default / unique / index>, one per line; a changed column
|
|
25
|
+
as `old → new`.
|
|
26
|
+
- **Relations:** <→ other table, cardinality, ON DELETE rule>.
|
|
27
|
+
- **Where it lives in the sparring:** <`tools/<file>.sql`, the entity path, or a JSON mock>.
|
|
28
|
+
- **Backfill of existing rows:** <none | how>.
|
|
29
|
+
- **Shortcut taken:** <a JSON column instead of a table, no index, no tenant FK… | none>.
|
|
@@ -34,6 +34,13 @@ Credentials (by NAME, never a value): <NAME, NAME | none>. Locally they live in
|
|
|
34
34
|
Real sends: <none | which channel really sends (reply, call, email) and the variable with the
|
|
35
35
|
judge's own destinations: `SPARRING_ALLOWED_<KIND>`, closed by default, the rest `not_allowlisted`>.
|
|
36
36
|
|
|
37
|
+
Contracts: every endpoint or data model you add or change, write it to
|
|
38
|
+
`<sparring dir>/contrato-<repo>.md`, your repo's own file (the other rudos write theirs at the same
|
|
39
|
+
time: read them, never write them; the template is `<absolute ring path>/skills/sparring/templates/contrato.md`) the moment you
|
|
40
|
+
propose it, before implementing it: method, path, request, response, errors and scoping; table,
|
|
41
|
+
columns, relations and where it lives. Keep it current when you change it; a dropped one is marked
|
|
42
|
+
`dropped`, never deleted. It is what the judge reviews first after a KO.
|
|
43
|
+
|
|
37
44
|
Gate: typecheck only: `<command>`, through one-at-a-time.
|
|
38
45
|
Database: additive only (new tables or columns, English names), and never against production.
|
|
39
46
|
forbidAiTrailers is <true|false>.
|
|
@@ -178,6 +178,12 @@ Do not ask about what you detected: show it and let the human correct it if they
|
|
|
178
178
|
native files under each of its paths). While a bout is active, `mask-guard` locks the gates of
|
|
179
179
|
every venue and the heavy commands of every declared venue (simulators, emulators, native
|
|
180
180
|
builds), and blocks a commit of a native file the judge did not approve.
|
|
181
|
+
- `format` is optional: `{ "tsconfig": "<path>" }` names the tsconfig sort-imports reads the
|
|
182
|
+
aliases from. Omit it when the repo's own sort-imports script passes `--tsconfig` or the root
|
|
183
|
+
has `tsconfig.json`: ring takes it from there, so the hooks sort as the repo's `sort` script
|
|
184
|
+
does. Write it when neither holds (a monorepo whose aliases live in one app's tsconfig). Tell
|
|
185
|
+
the human if the repo has no `node_modules/.bin/prettier` or `sort-imports`: ring formats with
|
|
186
|
+
what the repo installs and never downloads them.
|
|
181
187
|
- `delegation` can be omitted when it is `referee`. Write it explicitly only if the human chose
|
|
182
188
|
`human`, or if they want the choice visible in the file.
|
|
183
189
|
- `precedents` is optional: omit it to use `.claude/ring-precedents.md` when that file exists.
|