@thebattlearena/corner 0.9.1-beta.70 → 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.
Files changed (45) hide show
  1. package/package.json +1 -1
  2. package/plugin/.claude-plugin/plugin.json +1 -1
  3. package/ring/agents/cornerman.md +20 -3
  4. package/ring/agents/wrestler.md +11 -0
  5. package/ring/hooks/hooks.json +20 -0
  6. package/ring/scripts/bout-stats-render.mjs +366 -0
  7. package/ring/scripts/bout-stats.mjs +360 -0
  8. package/ring/scripts/config.mjs +1 -1
  9. package/ring/scripts/contract-endpoints.mjs +163 -0
  10. package/ring/scripts/contract-preview.mjs +34 -14
  11. package/ring/scripts/fight.mjs +27 -0
  12. package/ring/scripts/findings.mjs +3 -1
  13. package/ring/scripts/format-gate.mjs +723 -0
  14. package/ring/scripts/format-worker.mjs +120 -0
  15. package/ring/scripts/front-routes.mjs +345 -0
  16. package/ring/scripts/judges-card.mjs +324 -3
  17. package/ring/scripts/lookout.mjs +22 -4
  18. package/ring/scripts/mask-guard.mjs +34 -1
  19. package/ring/scripts/page-embed.mjs +112 -0
  20. package/ring/scripts/play-by-play.mjs +155 -7
  21. package/ring/scripts/preparation-collect.mjs +177 -0
  22. package/ring/scripts/preparation.mjs +547 -0
  23. package/ring/scripts/round-bell.mjs +9 -2
  24. package/ring/scripts/tech-plan-log.mjs +81 -0
  25. package/ring/scripts/tech-plan.mjs +191 -0
  26. package/ring/scripts/verdicts-log.mjs +75 -0
  27. package/ring/scripts/verdicts.mjs +205 -0
  28. package/ring/skills/play-by-play/SKILL.md +235 -33
  29. package/ring/skills/play-by-play/templates/blocks.css +196 -0
  30. package/ring/skills/play-by-play/templates/chronicle.html +358 -55
  31. package/ring/skills/play-by-play/templates/endpoints-view.js +1153 -0
  32. package/ring/skills/play-by-play/templates/interview-form.js +516 -0
  33. package/ring/skills/play-by-play/templates/now-panel.js +719 -0
  34. package/ring/skills/referee/SKILL.md +136 -42
  35. package/ring/skills/referee/references/api-diagram.md +56 -0
  36. package/ring/skills/referee/references/precedents.md +11 -0
  37. package/ring/skills/referee/references/rulebook.md +65 -4
  38. package/ring/skills/referee/templates/api-diagram.html +115 -0
  39. package/ring/skills/referee/templates/escalation.md +7 -1
  40. package/ring/skills/referee/templates/round-bell-body.md +4 -0
  41. package/ring/skills/referee/templates/wrestler-brief.md +3 -0
  42. package/ring/skills/sparring/SKILL.md +10 -2
  43. package/ring/skills/sparring/templates/contrato.md +29 -0
  44. package/ring/skills/sparring/templates/rudo-brief.md +7 -0
  45. package/ring/skills/weigh-in/SKILL.md +6 -0
@@ -11,6 +11,7 @@ import { join } from 'node:path';
11
11
  import { commitEvents, localDay, localTime, score } from './chronicle.mjs';
12
12
  import { repoBouts, slugFromRemote } from './config.mjs';
13
13
  import { LIVE_LOG, SPARRING_FILE, sparringsHome } from './live.mjs';
14
+ import { sparringFold } from './preparation.mjs';
14
15
  import {
15
16
  dedupe,
16
17
  feedEvents,
@@ -86,6 +87,29 @@ function option(argv, name) {
86
87
  return index === -1 ? null : argv[index + 1];
87
88
  }
88
89
 
90
+ /**
91
+ * The bout's weigh-in with what `sparring.mjs promote` made for its repo: the deliverable PR
92
+ * (mainevent → release) and the sparring's draft and worktree it came from. PURE.
93
+ */
94
+ export function withPromotion(weighIn, state, repo) {
95
+ const entry = (state.repos ?? []).find((item) => item.repo === repo);
96
+ if (!entry) return weighIn;
97
+ return {
98
+ ...weighIn,
99
+ promotion: {
100
+ ...weighIn.promotion,
101
+ repo,
102
+ mainevent: entry.mainevent ?? null,
103
+ sparring: {
104
+ branch: entry.branch,
105
+ pr: entry.pr ?? null,
106
+ url: entry.url ?? null,
107
+ worktree: entry.worktree,
108
+ },
109
+ },
110
+ };
111
+ }
112
+
89
113
  /** Every bout opened `--from-sparring` this sparring, in the sparring's repos. */
90
114
  export function boutsOfSparring(state, env = process.env) {
91
115
  return (state.repos ?? []).flatMap((entry) =>
@@ -220,12 +244,15 @@ export function collectFight(slug, argv, { collectBout, readExtra }) {
220
244
  proof: state.proof,
221
245
  verdict: state.verdict ?? null,
222
246
  repos: (state.repos ?? []).map(({ repo, pr, url }) => ({ repo, pr, url })),
247
+ fold: sparringFold(state, bouts.length),
223
248
  bouts: bouts.map((bout) => ({
224
249
  repo: bout.repo,
225
250
  pr: bout.pr,
226
251
  boutDir: bout.boutDir,
227
252
  opened: bout.opened,
228
253
  copilotOnHead: bout.copilotOnHead,
254
+ weighIn: withPromotion(bout.weighIn, state, bout.repo),
255
+ interview: bout.interview,
229
256
  })),
230
257
  falls: sliced.falls,
231
258
  rounds: sliced.rounds,
@@ -1,7 +1,8 @@
1
1
  #!/usr/bin/env node
2
2
  // The ledger of every cornerman finding of a bout, and its audit. Zero-dependency.
3
3
  //
4
- // node findings.mjs add <pr> --source range|concept|batch|final|copilot|human [--range <from>..<to>]
4
+ // node findings.mjs add <pr> --source range|concept|batch|final|copilot|human|contract [--range <from>..<to>]
5
+ // (contract: the judge's «se mejora» on an endpoint, from judges-card page-verdicts)
5
6
  // (<text> | --file <report>) one finding, or one per line of a report
6
7
  // node findings.mjs clean <pr> --range <from>..<to> the cornerman found nothing in that range
7
8
  // node findings.mjs applied <pr> F<n>[,F<m>…] <sha> the wrestler applied it in that commit
@@ -47,6 +48,7 @@ export const SOURCES = [
47
48
  'final',
48
49
  'copilot',
49
50
  'human',
51
+ 'contract',
50
52
  ];
51
53
  /** States that need nothing more from the referee before a round-bell or a push. */
52
54
  const SETTLED = ['applied', 'discarded', 'ticket', 'escalated'];