@jive-sh/skill-sync 0.11.0-latest-darwin-x64 → 0.11.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 +346 -0
- package/bin/package.json +1 -0
- package/bin/skill-sync +34 -0
- package/bin/skill-sync-daemon +34 -0
- package/dist/daemons/skill-sync-daemon.js +664 -0
- package/dist/daemons/skill-sync-daemon.js.map +1 -0
- package/dist/entrypoints/skill-sync.js +7 -0
- package/dist/entrypoints/skill-sync.js.map +1 -0
- package/dist/index.js +10 -0
- package/dist/index.js.map +1 -0
- package/dist/internal/agents/agent-tool.js +102 -0
- package/dist/internal/agents/agent-tool.js.map +1 -0
- package/dist/internal/agents/claude.js +424 -0
- package/dist/internal/agents/claude.js.map +1 -0
- package/dist/internal/agents/codex.js +270 -0
- package/dist/internal/agents/codex.js.map +1 -0
- package/dist/internal/agents/command.js +219 -0
- package/dist/internal/agents/command.js.map +1 -0
- package/dist/internal/agents/grok.js +170 -0
- package/dist/internal/agents/grok.js.map +1 -0
- package/dist/internal/agents/index.js +70 -0
- package/dist/internal/agents/index.js.map +1 -0
- package/dist/internal/cli.js +218 -0
- package/dist/internal/cli.js.map +1 -0
- package/dist/internal/comment-watch/held.js +14 -0
- package/dist/internal/comment-watch/held.js.map +1 -0
- package/dist/internal/comment-watch/key.js +4 -0
- package/dist/internal/comment-watch/key.js.map +1 -0
- package/dist/internal/comment-watch/message.js +37 -0
- package/dist/internal/comment-watch/message.js.map +1 -0
- package/dist/internal/comment-watch/paths.js +16 -0
- package/dist/internal/comment-watch/paths.js.map +1 -0
- package/dist/internal/comment-watch/platform.js +66 -0
- package/dist/internal/comment-watch/platform.js.map +1 -0
- package/dist/internal/comment-watch/protocol.js +124 -0
- package/dist/internal/comment-watch/protocol.js.map +1 -0
- package/dist/internal/comment-watch/recent.js +27 -0
- package/dist/internal/comment-watch/recent.js.map +1 -0
- package/dist/internal/comment-watch/replies.js +28 -0
- package/dist/internal/comment-watch/replies.js.map +1 -0
- package/dist/internal/comment-watch/service.js +174 -0
- package/dist/internal/comment-watch/service.js.map +1 -0
- package/dist/internal/comment-watch/settings.js +66 -0
- package/dist/internal/comment-watch/settings.js.map +1 -0
- package/dist/internal/comment-watch/source/github-pull-requests/conversations.js +85 -0
- package/dist/internal/comment-watch/source/github-pull-requests/conversations.js.map +1 -0
- package/dist/internal/comment-watch/source/github-pull-requests/impl.js +276 -0
- package/dist/internal/comment-watch/source/github-pull-requests/impl.js.map +1 -0
- package/dist/internal/comment-watch/source/github-pull-requests/queries.js +97 -0
- package/dist/internal/comment-watch/source/github-pull-requests/queries.js.map +1 -0
- package/dist/internal/comment-watch/source/google-doc/doc.js +57 -0
- package/dist/internal/comment-watch/source/google-doc/doc.js.map +1 -0
- package/dist/internal/comment-watch/source/google-doc/impl.js +190 -0
- package/dist/internal/comment-watch/source/google-doc/impl.js.map +1 -0
- package/dist/internal/comment-watch/source/http-api.js +74 -0
- package/dist/internal/comment-watch/source/http-api.js.map +1 -0
- package/dist/internal/comment-watch/source/interface.js +48 -0
- package/dist/internal/comment-watch/source/interface.js.map +1 -0
- package/dist/internal/comment-watch/source/sign-in.js +40 -0
- package/dist/internal/comment-watch/source/sign-in.js.map +1 -0
- package/dist/internal/comment-watch/source/sources.js +15 -0
- package/dist/internal/comment-watch/source/sources.js.map +1 -0
- package/dist/internal/comment-watch/store/impl.js +242 -0
- package/dist/internal/comment-watch/store/impl.js.map +1 -0
- package/dist/internal/comment-watch/store/interface.js +10 -0
- package/dist/internal/comment-watch/store/interface.js.map +1 -0
- package/dist/internal/comment-watch/t3.js +49 -0
- package/dist/internal/comment-watch/t3.js.map +1 -0
- package/dist/internal/comment-watch/watching.js +65 -0
- package/dist/internal/comment-watch/watching.js.map +1 -0
- package/dist/internal/comment-watch/workflow/comment-watch.js +19 -0
- package/dist/internal/comment-watch/workflow/comment-watch.js.map +1 -0
- package/dist/internal/comment-watch/workflow/deliver.js +104 -0
- package/dist/internal/comment-watch/workflow/deliver.js.map +1 -0
- package/dist/internal/comment-watch/workflow/find.js +67 -0
- package/dist/internal/comment-watch/workflow/find.js.map +1 -0
- package/dist/internal/comment-watch/workflow/post-once.js +66 -0
- package/dist/internal/comment-watch/workflow/post-once.js.map +1 -0
- package/dist/internal/comment-watch/workflow/post.js +40 -0
- package/dist/internal/comment-watch/workflow/post.js.map +1 -0
- package/dist/internal/config.js +131 -0
- package/dist/internal/config.js.map +1 -0
- package/dist/internal/control.js +113 -0
- package/dist/internal/control.js.map +1 -0
- package/dist/internal/daemon-control/impl.js +80 -0
- package/dist/internal/daemon-control/impl.js.map +1 -0
- package/dist/internal/daemon-control/interface.js +4 -0
- package/dist/internal/daemon-control/interface.js.map +1 -0
- package/dist/internal/folders.js +47 -0
- package/dist/internal/folders.js.map +1 -0
- package/dist/internal/local-skills.js +43 -0
- package/dist/internal/local-skills.js.map +1 -0
- package/dist/internal/path.js +36 -0
- package/dist/internal/path.js.map +1 -0
- package/dist/internal/server.js +80 -0
- package/dist/internal/server.js.map +1 -0
- package/dist/internal/skill-check.js +83 -0
- package/dist/internal/skill-check.js.map +1 -0
- package/dist/internal/skill-refinement/evals/cases.js +143 -0
- package/dist/internal/skill-refinement/evals/cases.js.map +1 -0
- package/dist/internal/skill-refinement/evals/opus-action-judge-original.json +350 -0
- package/dist/internal/skill-refinement/evals/opus-judge-original.json +165 -0
- package/dist/internal/skill-refinement/feedback/import-legacy.js +13 -0
- package/dist/internal/skill-refinement/feedback/import-legacy.js.map +1 -0
- package/dist/internal/skill-refinement/feedback/intake.js +52 -0
- package/dist/internal/skill-refinement/feedback/intake.js.map +1 -0
- package/dist/internal/skill-refinement/feedback/managed-intake.js +19 -0
- package/dist/internal/skill-refinement/feedback/managed-intake.js.map +1 -0
- package/dist/internal/skill-refinement/feedback/outbox.js +44 -0
- package/dist/internal/skill-refinement/feedback/outbox.js.map +1 -0
- package/dist/internal/skill-refinement/jev/impl.js +63 -0
- package/dist/internal/skill-refinement/jev/impl.js.map +1 -0
- package/dist/internal/skill-refinement/jev/interface.js +6 -0
- package/dist/internal/skill-refinement/jev/interface.js.map +1 -0
- package/dist/internal/skill-refinement/managed-daemon.js +30 -0
- package/dist/internal/skill-refinement/managed-daemon.js.map +1 -0
- package/dist/internal/skill-refinement/managed-worker-credentials.js +60 -0
- package/dist/internal/skill-refinement/managed-worker-credentials.js.map +1 -0
- package/dist/internal/skill-refinement/managed-worker-files.js +25 -0
- package/dist/internal/skill-refinement/managed-worker-files.js.map +1 -0
- package/dist/internal/skill-refinement/managed-worker-loop.js +36 -0
- package/dist/internal/skill-refinement/managed-worker-loop.js.map +1 -0
- package/dist/internal/skill-refinement/organization-site.js +13 -0
- package/dist/internal/skill-refinement/organization-site.js.map +1 -0
- package/dist/internal/skill-refinement/paths.js +62 -0
- package/dist/internal/skill-refinement/paths.js.map +1 -0
- package/dist/internal/skill-refinement/platform.js +67 -0
- package/dist/internal/skill-refinement/platform.js.map +1 -0
- package/dist/internal/skill-refinement/service.js +365 -0
- package/dist/internal/skill-refinement/service.js.map +1 -0
- package/dist/internal/skill-refinement/skills/skill-text.js +219 -0
- package/dist/internal/skill-refinement/skills/skill-text.js.map +1 -0
- package/dist/internal/skill-refinement/workflow/retry.js +44 -0
- package/dist/internal/skill-refinement/workflow/retry.js.map +1 -0
- package/dist/internal/skill-refinement/workflow/skill-refinement.js +690 -0
- package/dist/internal/skill-refinement/workflow/skill-refinement.js.map +1 -0
- package/dist/internal/skill-refinement/writer/impl.js +2 -0
- package/dist/internal/skill-refinement/writer/impl.js.map +1 -0
- package/dist/internal/skill-refinement/writer/interface.js +2 -0
- package/dist/internal/skill-refinement/writer/interface.js.map +1 -0
- package/dist/internal/sync.js +182 -0
- package/dist/internal/sync.js.map +1 -0
- package/dist/internal/wire.js +31 -0
- package/dist/internal/wire.js.map +1 -0
- package/dist/internal/writer/claude.js +84 -0
- package/dist/internal/writer/claude.js.map +1 -0
- package/dist/internal/writer/codex.js +102 -0
- package/dist/internal/writer/codex.js.map +1 -0
- package/dist/internal/writer/interface.js +6 -0
- package/dist/internal/writer/interface.js.map +1 -0
- package/dist/internal/writer/live.js +13 -0
- package/dist/internal/writer/live.js.map +1 -0
- package/dist/internal/writer/reset.js +38 -0
- package/dist/internal/writer/reset.js.map +1 -0
- package/dist/internal/writer/selection.js +79 -0
- package/dist/internal/writer/selection.js.map +1 -0
- package/package.json +45 -11
- package/postinstall.cjs +663 -0
- package/src/daemons/skill-sync-daemon.ts +677 -0
- package/src/entrypoints/skill-sync.ts +12 -0
- package/src/index.ts +15 -0
- package/src/internal/agents/agent-tool.ts +149 -0
- package/src/internal/agents/claude.ts +442 -0
- package/src/internal/agents/codex.ts +288 -0
- package/src/internal/agents/command.ts +257 -0
- package/src/internal/agents/grok.ts +174 -0
- package/src/internal/agents/index.ts +74 -0
- package/src/internal/cli.ts +249 -0
- package/src/internal/comment-watch/held.ts +20 -0
- package/src/internal/comment-watch/key.ts +5 -0
- package/src/internal/comment-watch/message.ts +39 -0
- package/src/internal/comment-watch/paths.ts +17 -0
- package/src/internal/comment-watch/platform.ts +69 -0
- package/src/internal/comment-watch/protocol.ts +140 -0
- package/src/internal/comment-watch/recent.ts +26 -0
- package/src/internal/comment-watch/replies.ts +28 -0
- package/src/internal/comment-watch/service.ts +198 -0
- package/src/internal/comment-watch/settings.ts +82 -0
- package/src/internal/comment-watch/source/github-pull-requests/conversations.ts +111 -0
- package/src/internal/comment-watch/source/github-pull-requests/impl.ts +291 -0
- package/src/internal/comment-watch/source/github-pull-requests/queries.ts +113 -0
- package/src/internal/comment-watch/source/google-doc/doc.ts +76 -0
- package/src/internal/comment-watch/source/google-doc/impl.ts +198 -0
- package/src/internal/comment-watch/source/http-api.ts +93 -0
- package/src/internal/comment-watch/source/interface.ts +116 -0
- package/src/internal/comment-watch/source/sign-in.ts +45 -0
- package/src/internal/comment-watch/source/sources.ts +20 -0
- package/src/internal/comment-watch/store/impl.ts +268 -0
- package/src/internal/comment-watch/store/interface.ts +83 -0
- package/src/internal/comment-watch/t3.ts +68 -0
- package/src/internal/comment-watch/watching.ts +122 -0
- package/src/internal/comment-watch/workflow/comment-watch.ts +34 -0
- package/src/internal/comment-watch/workflow/deliver.ts +115 -0
- package/src/internal/comment-watch/workflow/find.ts +78 -0
- package/src/internal/comment-watch/workflow/post-once.ts +72 -0
- package/src/internal/comment-watch/workflow/post.ts +56 -0
- package/src/internal/config.ts +172 -0
- package/src/internal/control.ts +165 -0
- package/src/internal/daemon-control/impl.ts +94 -0
- package/src/internal/daemon-control/interface.ts +46 -0
- package/src/internal/folders.ts +50 -0
- package/src/internal/local-skills.ts +58 -0
- package/src/internal/path.ts +32 -0
- package/src/internal/server.ts +76 -0
- package/src/internal/skill-check.ts +97 -0
- package/src/internal/skill-refinement/evals/cases.ts +167 -0
- package/src/internal/skill-refinement/evals/opus-action-judge-original.json +350 -0
- package/src/internal/skill-refinement/evals/opus-judge-original.json +165 -0
- package/src/internal/skill-refinement/feedback/import-legacy.ts +16 -0
- package/src/internal/skill-refinement/feedback/intake.ts +66 -0
- package/src/internal/skill-refinement/feedback/managed-intake.ts +19 -0
- package/src/internal/skill-refinement/feedback/outbox.ts +50 -0
- package/src/internal/skill-refinement/jev/impl.ts +76 -0
- package/src/internal/skill-refinement/jev/interface.ts +56 -0
- package/src/internal/skill-refinement/managed-daemon.ts +38 -0
- package/src/internal/skill-refinement/managed-worker-credentials.ts +59 -0
- package/src/internal/skill-refinement/managed-worker-files.ts +24 -0
- package/src/internal/skill-refinement/managed-worker-loop.ts +46 -0
- package/src/internal/skill-refinement/organization-site.ts +15 -0
- package/src/internal/skill-refinement/paths.ts +87 -0
- package/src/internal/skill-refinement/platform.ts +71 -0
- package/src/internal/skill-refinement/service.ts +418 -0
- package/src/internal/skill-refinement/skills/skill-text.ts +292 -0
- package/src/internal/skill-refinement/workflow/retry.ts +61 -0
- package/src/internal/skill-refinement/workflow/skill-refinement.ts +777 -0
- package/src/internal/skill-refinement/writer/impl.ts +1 -0
- package/src/internal/skill-refinement/writer/interface.ts +1 -0
- package/src/internal/sync.ts +216 -0
- package/src/internal/wire.ts +439 -0
- package/src/internal/writer/claude.ts +98 -0
- package/src/internal/writer/codex.ts +93 -0
- package/src/internal/writer/interface.ts +48 -0
- package/src/internal/writer/live.ts +19 -0
- package/src/internal/writer/reset.ts +34 -0
- package/src/internal/writer/selection.ts +84 -0
- package/multi-call-binary +0 -4
|
@@ -0,0 +1,350 @@
|
|
|
1
|
+
{
|
|
2
|
+
"source": "The evals' original action-judge prompt (agentic-collaboration/evals/run.ts, word for word in src/evals/cases.ts as of 2026-11-16) on Opus 5.5, grading the original reply of each action case once, 2026-11-16. Alex objected to every one of them.",
|
|
3
|
+
"grades": [
|
|
4
|
+
{
|
|
5
|
+
"case": "case-100",
|
|
6
|
+
"pass": false,
|
|
7
|
+
"why": "The brief kept the old 'don't touch the outer repo' rule even though his request covers registering the package, and the thread used raw `git init` and `git submodule add` instead of Jive, so the package never got its Jive-made .gitmodules entry."
|
|
8
|
+
},
|
|
9
|
+
{
|
|
10
|
+
"case": "case-101",
|
|
11
|
+
"pass": false,
|
|
12
|
+
"why": "The agent repeated the known failure: it used the built-in browser pane, then ran `activate` and `make new tab`, which pulled Chrome to the front with a new selected tab instead of quietly navigating a non-selected tab and filling the form in the background."
|
|
13
|
+
},
|
|
14
|
+
{
|
|
15
|
+
"case": "case-102",
|
|
16
|
+
"pass": false,
|
|
17
|
+
"why": "The agent asked him what 'jev' is when it should have searched the web for it and then redesigned the verdict step as a Jev classification over the four verdicts, which is exactly the mistake he didn't want."
|
|
18
|
+
},
|
|
19
|
+
{
|
|
20
|
+
"case": "case-103",
|
|
21
|
+
"pass": false,
|
|
22
|
+
"why": "Alex wanted the deploy to create the Volume idempotently through the Jive server, but the reply offered a short-lived token for manual creation from the Mac and an option that leaves provisioning outside deploy, both of which he rejected."
|
|
23
|
+
},
|
|
24
|
+
{
|
|
25
|
+
"case": "case-17",
|
|
26
|
+
"pass": false,
|
|
27
|
+
"why": "The agent repeated the past mistake: it put the counts on rows nested inside the \"Cost and time\" section instead of making each workflow a top-level dropdown under its phase. It kept the unasked wrapper and \"by change\" dropdowns, added an unrequested function tooltip, and shipped without laying out which dropdowns each phase would contain."
|
|
28
|
+
},
|
|
29
|
+
{
|
|
30
|
+
"case": "case-18",
|
|
31
|
+
"pass": false,
|
|
32
|
+
"why": "No plan or reply was given, so the stalled Phase 3 agent is never restarted and its stall cause is never found, which falls short of what Alex wanted even though Phase 8 is correctly left alone."
|
|
33
|
+
},
|
|
34
|
+
{
|
|
35
|
+
"case": "case-20",
|
|
36
|
+
"pass": false,
|
|
37
|
+
"why": "It repeats the past failure: it answers the literal question at length with a CPU table and reassurance, offers the Spotlight exclusion ('I can do that if you want') instead of doing it, and stops nothing writing files, then adds unrequested retry-improvement proposals, so the heat continues."
|
|
38
|
+
},
|
|
39
|
+
{
|
|
40
|
+
"case": "case-21",
|
|
41
|
+
"pass": false,
|
|
42
|
+
"why": "The reply defends the power guard, tells Alex to plug in, and adds a reason label beside the count, when he wanted the guard removed so running always matches his requested budget."
|
|
43
|
+
},
|
|
44
|
+
{
|
|
45
|
+
"case": "case-22",
|
|
46
|
+
"pass": false,
|
|
47
|
+
"why": "The agent explains the set-aside rule Alex already rejected, then asks him whether to return items and recommends keeping the 16 Fits functions out, leaving unchanged the logic that hides gap items from the work list while the dashboard still counts them."
|
|
48
|
+
},
|
|
49
|
+
{
|
|
50
|
+
"case": "case-23",
|
|
51
|
+
"pass": false,
|
|
52
|
+
"why": "Instead of checking that the fill matches the count, the agent recoloured the remainder amber and made the bar taller. That repeats the past mistake: green next to amber is unreadable for colorblind Alex, and the bar's look changed without being asked."
|
|
53
|
+
},
|
|
54
|
+
{
|
|
55
|
+
"case": "case-24",
|
|
56
|
+
"pass": false,
|
|
57
|
+
"why": "The plan and reply are empty, so nothing would show the 21 checks with colour-independent pass/fail markers and failure reasons."
|
|
58
|
+
},
|
|
59
|
+
{
|
|
60
|
+
"case": "case-25",
|
|
61
|
+
"pass": false,
|
|
62
|
+
"why": "The reply makes the same mistake as the past agent: it holds the limit build and asks him to 'say go', when he wanted it built right away without restarting what he stopped."
|
|
63
|
+
},
|
|
64
|
+
{
|
|
65
|
+
"case": "case-26",
|
|
66
|
+
"pass": false,
|
|
67
|
+
"why": "The reply lists the CPU consumers without stopping or deprioritising the full test run, the regeneration or the behaviour check, and it adds a Spotlight confirmation paragraph he didn't ask for when he only wanted to know the cause."
|
|
68
|
+
},
|
|
69
|
+
{
|
|
70
|
+
"case": "case-28",
|
|
71
|
+
"pass": false,
|
|
72
|
+
"why": "The reply leads with a per-workflow coverage table, which he never wanted. It only half-owns the earlier false 'built' report without saying why it was wrong, and it files the shared-code fix as planned work rather than doing it and checking it against the step records, while adding unrequested metrics such as files written and compiles."
|
|
73
|
+
},
|
|
74
|
+
{
|
|
75
|
+
"case": "case-29",
|
|
76
|
+
"pass": false,
|
|
77
|
+
"why": "The agent declared 'I'm starting it now' and 'Starting that now' while the design was still open, instead of summarizing what was understood and asking what a workflow definition does, what runs it, and where its records go."
|
|
78
|
+
},
|
|
79
|
+
{
|
|
80
|
+
"case": "case-30",
|
|
81
|
+
"pass": false,
|
|
82
|
+
"why": "Instead of querying the database rows behind \"3 running\" and tracing the code path that should have marked them finished, the agent said it hadn't looked and went to process lists, step traces and code greps, the very lookups he wanted only after the rows."
|
|
83
|
+
},
|
|
84
|
+
{
|
|
85
|
+
"case": "case-32",
|
|
86
|
+
"pass": false,
|
|
87
|
+
"why": "It names Service build and usage and says plainly that it stopped and the job isn't finished, but it ends by asking \"Should I restart it on that?\" instead of restarting it on the known next step and reporting that it's running again and what will prove it done."
|
|
88
|
+
},
|
|
89
|
+
{
|
|
90
|
+
"case": "case-33",
|
|
91
|
+
"pass": false,
|
|
92
|
+
"why": "The agent created a new @jive-sh/daemon package with its own ~/.jive/daemon-session.json. He wanted a src/daemons/ entry in @jive-sh/jive that reuses ~/.jive/session.json, so this repeats the rejected pattern, though the reply does state what it built."
|
|
93
|
+
},
|
|
94
|
+
{
|
|
95
|
+
"case": "case-35",
|
|
96
|
+
"pass": false,
|
|
97
|
+
"why": "Instead of only topping each workflow up to its limit, the plan adds the account usage-limit check, the 55 s wait, a per-item cap of unstated size and the re-sort, all logic he said he doesn't want, and the wait hides runs that keep ending before their agent step."
|
|
98
|
+
},
|
|
99
|
+
{
|
|
100
|
+
"case": "case-38",
|
|
101
|
+
"pass": false,
|
|
102
|
+
"why": "He wanted the clear, already-diagnosed bug fixed immediately with a report of what changed and how it was verified, but the agent only explained it and asked 'Should I fix that one now?' three times, repeating the permission-seeking stalling he objected to."
|
|
103
|
+
},
|
|
104
|
+
{
|
|
105
|
+
"case": "case-42",
|
|
106
|
+
"pass": false,
|
|
107
|
+
"why": "The agent reports the missing compiler output as an unknown about the function and hands the diagnosis to the library-functions thread, which Alex didn't ask for, instead of treating it as a step-runner bug, starting a fix to save the compiler output and exit code, and rerunning the step."
|
|
108
|
+
},
|
|
109
|
+
{
|
|
110
|
+
"case": "case-43",
|
|
111
|
+
"pass": false,
|
|
112
|
+
"why": "The brief does fix Discovery, but it also orders a one-off audit with counts and hand correction of the records, and it never adds an overlap check to Discovery or re-runs the affected functions through it."
|
|
113
|
+
},
|
|
114
|
+
{
|
|
115
|
+
"case": "case-44",
|
|
116
|
+
"pass": false,
|
|
117
|
+
"why": "The agent blamed the complexity instead of naming the second ordering as the defect, and it briefed a front-first check stacked on the existing ranking, filters and re-sorts, which keeps the path he wanted removed instead of replacing the pick with taking the queue's head."
|
|
118
|
+
},
|
|
119
|
+
{
|
|
120
|
+
"case": "case-45",
|
|
121
|
+
"pass": false,
|
|
122
|
+
"why": "The reply was a general status update that left out the free check now running at budget 0, the proof of 0x619D95, and the uncounted 0-byte-diff result for 0x617AEC, so he raised the budget to 1 and the waiting run called an agent."
|
|
123
|
+
},
|
|
124
|
+
{
|
|
125
|
+
"case": "case-46",
|
|
126
|
+
"pass": false,
|
|
127
|
+
"why": "The agent repeats the past mistake: it makes downloading MASM 6.15 a Blocked on you yes-question and holds the 7 functions unproven, instead of getting the tool the approved approach already calls for and reporting the build result."
|
|
128
|
+
},
|
|
129
|
+
{
|
|
130
|
+
"case": "case-47",
|
|
131
|
+
"pass": false,
|
|
132
|
+
"why": "It made a second clone on main and left his actual checkout untouched. That is the exact outcome he rejected: he wanted his own checkout switched, with the edits saved as a patch and a named stash."
|
|
133
|
+
},
|
|
134
|
+
{
|
|
135
|
+
"case": "case-49",
|
|
136
|
+
"pass": false,
|
|
137
|
+
"why": "The reply answers his question, but the brief is again a narrow fix with no end goal or funnel stage and asks for no stage effect, and the reply never says that Matches, Behaves and Links sit idle at his budget of 0 with usage at 3% against 90%."
|
|
138
|
+
},
|
|
139
|
+
{
|
|
140
|
+
"case": "case-50",
|
|
141
|
+
"pass": false,
|
|
142
|
+
"why": "The reply repeats the past failure: it lists the support fixes but never shows the funnel (no link, 1,371 not behaving, 659 unmatched), and it never says the goal-moving stages are idle at budget 0 with usage at 3% of a 90% target, which is his call."
|
|
143
|
+
},
|
|
144
|
+
{
|
|
145
|
+
"case": "case-51",
|
|
146
|
+
"pass": false,
|
|
147
|
+
"why": "The agent answered from the static Dock prefs and a log check, blamed recent-apps entries, and told him to change a setting; it never watched new processes live to find what launches Chrome, and it ignored the Jive sign-in popups entirely."
|
|
148
|
+
},
|
|
149
|
+
{
|
|
150
|
+
"case": "case-52",
|
|
151
|
+
"pass": false,
|
|
152
|
+
"why": "The agent left the OTP stepper and the totpSecret field in place and called them leftover instead of deleting them, which his standing order already covered; it also gave no plain account of what remains undone, such as signingPasskey.sign still returning a raw r‖s signature."
|
|
153
|
+
},
|
|
154
|
+
{
|
|
155
|
+
"case": "case-53",
|
|
156
|
+
"pass": false,
|
|
157
|
+
"why": "The agent repeated the past mistake: it spent about 15 tool calls reading the database, API and threads itself before dispatching anything, so all five owing threads stayed idle, no owner was launched for the funnel analysis, and Function extents was never settled."
|
|
158
|
+
},
|
|
159
|
+
{
|
|
160
|
+
"case": "case-55",
|
|
161
|
+
"pass": false,
|
|
162
|
+
"why": "The plan reruns every conversion and check on fixed timers no matter what changed, which repeats the past failure; he wanted runs triggered by input changes, results stored under input hashes and reused, and cost per run measured, and none of that is here."
|
|
163
|
+
},
|
|
164
|
+
{
|
|
165
|
+
"case": "case-56",
|
|
166
|
+
"pass": false,
|
|
167
|
+
"why": "The agent said it didn't know what its own byte check does and sent a thread to search the repo, when it should have answered no from byte-check/impl.ts, briefed the target check against the function records, and added a module description, so it repeats the rediscovery pattern he rejected."
|
|
168
|
+
},
|
|
169
|
+
{
|
|
170
|
+
"case": "case-58",
|
|
171
|
+
"pass": false,
|
|
172
|
+
"why": "He asked what the worktrees were and whether they could be removed, but the agent never said what any of them was for and force-removed all 5 without his go-ahead, losing about 22 files that existed nowhere else."
|
|
173
|
+
},
|
|
174
|
+
{
|
|
175
|
+
"case": "case-61",
|
|
176
|
+
"pass": false,
|
|
177
|
+
"why": "The agent relayed the ready-to-release report and listed 'then I release it' as a future step instead of committing, pushing, publishing, and installing 0.7.0 that turn, so jive stayed at 0.6.0 without `jive ssh`."
|
|
178
|
+
},
|
|
179
|
+
{
|
|
180
|
+
"case": "case-62",
|
|
181
|
+
"pass": false,
|
|
182
|
+
"why": "The plan treats Alex's deliberate 0-agent setting on Decompile as a fault to fix, which he rejected, and it never mentions building the per-workflow concurrent run and agent limits he specified."
|
|
183
|
+
},
|
|
184
|
+
{
|
|
185
|
+
"case": "case-66",
|
|
186
|
+
"pass": false,
|
|
187
|
+
"why": "The agent settled the command thread, the standing coordinator Alex talks to, which he wanted left unsettled whatever its last turn showed."
|
|
188
|
+
},
|
|
189
|
+
{
|
|
190
|
+
"case": "case-67",
|
|
191
|
+
"pass": false,
|
|
192
|
+
"why": "The agent coordinated the side threads but never pinned its own command thread, so T3's 3-day idle rule settled it, which is the failure Alex wanted avoided."
|
|
193
|
+
},
|
|
194
|
+
{
|
|
195
|
+
"case": "case-69",
|
|
196
|
+
"pass": false,
|
|
197
|
+
"why": "The reply still shows the full #helpdesk Blocked on you item that he said to stop asking about, so it neither closes that item nor limits itself to answering what's left on #231."
|
|
198
|
+
},
|
|
199
|
+
{
|
|
200
|
+
"case": "case-70",
|
|
201
|
+
"pass": false,
|
|
202
|
+
"why": "The reply opens with a paragraph re-describing the PR's gate and only brings up RWX file filtering in the second paragraph, mixed with caching detail, so the first line doesn't name the simpler option or say directly whether it does the same job."
|
|
203
|
+
},
|
|
204
|
+
{
|
|
205
|
+
"case": "case-71",
|
|
206
|
+
"pass": false,
|
|
207
|
+
"why": "The agent loaded agentic-collaboration and senior-swe as wanted, but it also loaded effect on a question with no code, repeating the past mistake Alex explicitly did not want."
|
|
208
|
+
},
|
|
209
|
+
{
|
|
210
|
+
"case": "case-72",
|
|
211
|
+
"pass": false,
|
|
212
|
+
"why": "The Summary repeats the earlier mistake: it says what claude.yml does and that the key can be deleted afterwards, but it never opens by saying the change is needed so Alex can remove ANTHROPIC_API_KEY from CircleCI."
|
|
213
|
+
},
|
|
214
|
+
{
|
|
215
|
+
"case": "case-73",
|
|
216
|
+
"pass": false,
|
|
217
|
+
"why": "The plan copied the Play Console access item forward from the previous reply without re-reading #231's body, which already showed that check ticked, so Alex is again asked for access the agent already has."
|
|
218
|
+
},
|
|
219
|
+
{
|
|
220
|
+
"case": "case-74",
|
|
221
|
+
"pass": false,
|
|
222
|
+
"why": "The reply gives a flat 'Yes' based only on TestFlight and Google Play accepting the builds, silently assuming the stores reject wrongly signed builds; it neither checks the docs or the artifact signatures nor says that this assumption is unconfirmed."
|
|
223
|
+
},
|
|
224
|
+
{
|
|
225
|
+
"case": "case-75",
|
|
226
|
+
"pass": false,
|
|
227
|
+
"why": "The agent messaged the Command Thread with run 24's result without first reading its latest items. The Command Thread had steered run 24 and already relayed the outcome to Alex, so the message was a redundant send that he explicitly did not want."
|
|
228
|
+
},
|
|
229
|
+
{
|
|
230
|
+
"case": "case-76",
|
|
231
|
+
"pass": false,
|
|
232
|
+
"why": "The agent never figured out why the CircleCI script hung (a stale tab) and didn't retarget Alex's open tab; it answered from Honeycomb instead, which is the substitution he rejected."
|
|
233
|
+
},
|
|
234
|
+
{
|
|
235
|
+
"case": "case-77",
|
|
236
|
+
"pass": false,
|
|
237
|
+
"why": "The agent messaged the Command Thread about #233's conflict even though nothing in it needed Alex, producing the empty 'nothing needed from you' reply he didn't want; it should only have recorded the conflict in the event loop's own thread."
|
|
238
|
+
},
|
|
239
|
+
{
|
|
240
|
+
"case": "case-78",
|
|
241
|
+
"pass": false,
|
|
242
|
+
"why": "One of the plan's shell commands contains `$(` command substitution, which Alex said makes a command fail, so the result is not what he wanted."
|
|
243
|
+
},
|
|
244
|
+
{
|
|
245
|
+
"case": "case-79",
|
|
246
|
+
"pass": false,
|
|
247
|
+
"why": "It answered the caller question but copied both Blocked on you items from the previous reply without sweeping the threads or re-checking #231 and #236, which is exactly the stale carry-over he rejects."
|
|
248
|
+
},
|
|
249
|
+
{
|
|
250
|
+
"case": "case-80",
|
|
251
|
+
"pass": false,
|
|
252
|
+
"why": "On a run where nothing changed, Alex wanted no visible text at all, but the agent posted a 'Nothing has changed' status line, the exact output he rejects, on about 100 runs."
|
|
253
|
+
},
|
|
254
|
+
{
|
|
255
|
+
"case": "case-81",
|
|
256
|
+
"pass": false,
|
|
257
|
+
"why": "The agent reported 'no skills have changed' from the empty output of a grep that could never match, because awk joins fields with single spaces, instead of checking skill-sync list, which would have shown that spawn-subthread and senior-swe changed."
|
|
258
|
+
},
|
|
259
|
+
{
|
|
260
|
+
"case": "case-82",
|
|
261
|
+
"pass": false,
|
|
262
|
+
"why": "The verdict counts only failed CircleCI workflows, never checks the SUCCESS/ERROR results reported to the Bubble app, and leaves the iOS finalize runs that signed nothing unexplained, so a possible signing regression goes unflagged."
|
|
263
|
+
},
|
|
264
|
+
{
|
|
265
|
+
"case": "case-83",
|
|
266
|
+
"pass": false,
|
|
267
|
+
"why": "The reply walks through only the after-#231 path in steps and reduces the before path at ad92a0a to one summary bullet, with no matching steps or commit links, so it repeats the known mistake instead of laying out how the signing identity was chosen in both paths side by side."
|
|
268
|
+
},
|
|
269
|
+
{
|
|
270
|
+
"case": "case-84",
|
|
271
|
+
"pass": false,
|
|
272
|
+
"why": "He wanted the signing move shipped alone with each approved improvement in its own dependency-ordered PR, but the agent folded the trust-check port, inputs/config split and error names into #231, inflating it to 1,141 lines and burying the one production-breaking Fastfile line, though the reply did state that concrete result."
|
|
273
|
+
},
|
|
274
|
+
{
|
|
275
|
+
"case": "case-85",
|
|
276
|
+
"pass": false,
|
|
277
|
+
"why": "The agent gave a flat 'yes, verified end to end' based on one ASCII-named team certificate; it never traced the certificate name passed to resign back to its source and never tested non-ASCII builder names, which is the same failure he rejected."
|
|
278
|
+
},
|
|
279
|
+
{
|
|
280
|
+
"case": "case-86",
|
|
281
|
+
"pass": false,
|
|
282
|
+
"why": "The agent never reached a plan or reply, so the regression from #231 was never raised to Alex and he got no evidence and no chance to revert."
|
|
283
|
+
},
|
|
284
|
+
{
|
|
285
|
+
"case": "case-87",
|
|
286
|
+
"pass": false,
|
|
287
|
+
"why": "The reply repeats the past mistake: it says 'the certificate's SHA-1 hash' without saying it is the fingerprint of the distribution certificate match just installed, computed per build in the finalize job, and it calls #237 'the old behavior' instead of stating the shared property (independence from the certificate name text) and the difference (one exact certificate by fingerprint vs. a generic label Xcode resolves)."
|
|
288
|
+
},
|
|
289
|
+
{
|
|
290
|
+
"case": "case-88",
|
|
291
|
+
"pass": false,
|
|
292
|
+
"why": "The draft opens with the argument heading \"Why this is Medium, not High\", the exact thing he rejected, instead of stating his move from High to Medium in his own voice."
|
|
293
|
+
},
|
|
294
|
+
{
|
|
295
|
+
"case": "case-89",
|
|
296
|
+
"pass": false,
|
|
297
|
+
"why": "The draft repeats the earlier mistakes: it gives an attack a person's verb ('needed'), uses a coined label ('signed pass') instead of JWT_TOKEN, and never says the plugin author or a compromised transitive dependency could get an arbitrary binary emailed to customers. It also doesn't explain how #231 closes the hole or what the ticket is for now as one narrative."
|
|
298
|
+
},
|
|
299
|
+
{
|
|
300
|
+
"case": "case-90",
|
|
301
|
+
"pass": false,
|
|
302
|
+
"why": "It answered that the comment is reasonable but posted neither the comment nor started the #233 rework; instead it turned his instruction into a Blocked on you yes/no question and held the comment behind it as a draft for approval, which is exactly the pattern he rejected."
|
|
303
|
+
},
|
|
304
|
+
{
|
|
305
|
+
"case": "case-91",
|
|
306
|
+
"pass": false,
|
|
307
|
+
"why": "The reply opens with \"No, not directly\" instead of \"Yes\" plus the sign-the-.app-and-rezip route from #232, and it never says that Apple's acceptance of an IPA signed this way is unverified."
|
|
308
|
+
},
|
|
309
|
+
{
|
|
310
|
+
"case": "case-92",
|
|
311
|
+
"pass": false,
|
|
312
|
+
"why": "The reply hedges with 'I think so, but I'm inferring it', asks him to confirm his goal, and never answers whether rcodesign can do the signing or corrects the earlier 'No', which is exactly the past failure he didn't want."
|
|
313
|
+
},
|
|
314
|
+
{
|
|
315
|
+
"case": "case-93",
|
|
316
|
+
"pass": false,
|
|
317
|
+
"why": "It repeats the past mistake: the reply names only the two files holding the certificate, without tracing whether the values are committed or injected at build time, or how the certificate pairs with the server's private key."
|
|
318
|
+
},
|
|
319
|
+
{
|
|
320
|
+
"case": "case-94",
|
|
321
|
+
"pass": false,
|
|
322
|
+
"why": "The reply never explains why there are several databases or what each one holds, and it turns his question into an unrequested 'one database' change task for the platform thread, repeating the earlier failure."
|
|
323
|
+
},
|
|
324
|
+
{
|
|
325
|
+
"case": "case-95",
|
|
326
|
+
"pass": false,
|
|
327
|
+
"why": "The plan stores the source, stdout, stderr and disassembly as inline TEXT columns instead of references into the content store or file paths, which repeats the bloat Alex rejected, though the reply does state the design openly."
|
|
328
|
+
},
|
|
329
|
+
{
|
|
330
|
+
"case": "case-96",
|
|
331
|
+
"pass": false,
|
|
332
|
+
"why": "The reply argues at length (three reasons) why the binary SQLite file shouldn't be committed, then asks him to approve a design his question already decided, instead of sending the work to the Workflow platform thread now."
|
|
333
|
+
},
|
|
334
|
+
{
|
|
335
|
+
"case": "case-97",
|
|
336
|
+
"pass": false,
|
|
337
|
+
"why": "The agent used plain ssh, which has no key on this Mac, and gave up on Permission denied instead of using jive-ssh root@<address>, so it never identified the droplet or reported its OS, CPU, memory and disk, repeating the exact failure Alex rejected."
|
|
338
|
+
},
|
|
339
|
+
{
|
|
340
|
+
"case": "case-98",
|
|
341
|
+
"pass": false,
|
|
342
|
+
"why": "It answers the literal 'run a docker image' question by proposing to install Docker Engine on the host and run a container there, which installs software on the host, the thing he said to avoid, instead of building the droplet from a custom image or snapshot."
|
|
343
|
+
},
|
|
344
|
+
{
|
|
345
|
+
"case": "case-99",
|
|
346
|
+
"pass": false,
|
|
347
|
+
"why": "It confirms the no-Docker design first, but then gives the CPU-hour figures bare: it never says that about 5 CPU-hours a day against the droplet's 96 makes this unrepresentative window useless for sizing, or that the browser-port work could be paused to speed the decompile."
|
|
348
|
+
}
|
|
349
|
+
]
|
|
350
|
+
}
|
|
@@ -0,0 +1,165 @@
|
|
|
1
|
+
{
|
|
2
|
+
"source": "The Opus judge of agentic-collaboration/evals (run.ts) grading the original reply of each case, copied on 2026-11-16 from evals/.results/original, a folder skill-sync never copies.",
|
|
3
|
+
"grades": [
|
|
4
|
+
{
|
|
5
|
+
"case": "case-01",
|
|
6
|
+
"pass": false
|
|
7
|
+
},
|
|
8
|
+
{
|
|
9
|
+
"case": "case-02",
|
|
10
|
+
"pass": true
|
|
11
|
+
},
|
|
12
|
+
{
|
|
13
|
+
"case": "case-03",
|
|
14
|
+
"pass": false
|
|
15
|
+
},
|
|
16
|
+
{
|
|
17
|
+
"case": "case-04",
|
|
18
|
+
"pass": true
|
|
19
|
+
},
|
|
20
|
+
{
|
|
21
|
+
"case": "case-05",
|
|
22
|
+
"pass": false
|
|
23
|
+
},
|
|
24
|
+
{
|
|
25
|
+
"case": "case-06",
|
|
26
|
+
"pass": true
|
|
27
|
+
},
|
|
28
|
+
{
|
|
29
|
+
"case": "case-07",
|
|
30
|
+
"pass": false
|
|
31
|
+
},
|
|
32
|
+
{
|
|
33
|
+
"case": "case-08",
|
|
34
|
+
"pass": true
|
|
35
|
+
},
|
|
36
|
+
{
|
|
37
|
+
"case": "case-09",
|
|
38
|
+
"pass": false
|
|
39
|
+
},
|
|
40
|
+
{
|
|
41
|
+
"case": "case-10",
|
|
42
|
+
"pass": false
|
|
43
|
+
},
|
|
44
|
+
{
|
|
45
|
+
"case": "case-11",
|
|
46
|
+
"pass": false
|
|
47
|
+
},
|
|
48
|
+
{
|
|
49
|
+
"case": "case-12",
|
|
50
|
+
"pass": false
|
|
51
|
+
},
|
|
52
|
+
{
|
|
53
|
+
"case": "case-13",
|
|
54
|
+
"pass": false
|
|
55
|
+
},
|
|
56
|
+
{
|
|
57
|
+
"case": "case-14",
|
|
58
|
+
"pass": false
|
|
59
|
+
},
|
|
60
|
+
{
|
|
61
|
+
"case": "case-15",
|
|
62
|
+
"pass": false
|
|
63
|
+
},
|
|
64
|
+
{
|
|
65
|
+
"case": "case-17",
|
|
66
|
+
"pass": false
|
|
67
|
+
},
|
|
68
|
+
{
|
|
69
|
+
"case": "case-19",
|
|
70
|
+
"pass": false
|
|
71
|
+
},
|
|
72
|
+
{
|
|
73
|
+
"case": "case-20",
|
|
74
|
+
"pass": false
|
|
75
|
+
},
|
|
76
|
+
{
|
|
77
|
+
"case": "case-21",
|
|
78
|
+
"pass": false
|
|
79
|
+
},
|
|
80
|
+
{
|
|
81
|
+
"case": "case-22",
|
|
82
|
+
"pass": false
|
|
83
|
+
},
|
|
84
|
+
{
|
|
85
|
+
"case": "case-23",
|
|
86
|
+
"pass": false
|
|
87
|
+
},
|
|
88
|
+
{
|
|
89
|
+
"case": "case-25",
|
|
90
|
+
"pass": false
|
|
91
|
+
},
|
|
92
|
+
{
|
|
93
|
+
"case": "case-26",
|
|
94
|
+
"pass": false
|
|
95
|
+
},
|
|
96
|
+
{
|
|
97
|
+
"case": "case-27",
|
|
98
|
+
"pass": false
|
|
99
|
+
},
|
|
100
|
+
{
|
|
101
|
+
"case": "case-28",
|
|
102
|
+
"pass": false
|
|
103
|
+
},
|
|
104
|
+
{
|
|
105
|
+
"case": "case-29",
|
|
106
|
+
"pass": false
|
|
107
|
+
},
|
|
108
|
+
{
|
|
109
|
+
"case": "case-30",
|
|
110
|
+
"pass": false
|
|
111
|
+
},
|
|
112
|
+
{
|
|
113
|
+
"case": "case-31",
|
|
114
|
+
"pass": false
|
|
115
|
+
},
|
|
116
|
+
{
|
|
117
|
+
"case": "case-32",
|
|
118
|
+
"pass": false
|
|
119
|
+
},
|
|
120
|
+
{
|
|
121
|
+
"case": "case-33",
|
|
122
|
+
"pass": false
|
|
123
|
+
},
|
|
124
|
+
{
|
|
125
|
+
"case": "case-34",
|
|
126
|
+
"pass": false
|
|
127
|
+
},
|
|
128
|
+
{
|
|
129
|
+
"case": "case-35",
|
|
130
|
+
"pass": false
|
|
131
|
+
},
|
|
132
|
+
{
|
|
133
|
+
"case": "case-36",
|
|
134
|
+
"pass": false
|
|
135
|
+
},
|
|
136
|
+
{
|
|
137
|
+
"case": "case-37",
|
|
138
|
+
"pass": false
|
|
139
|
+
},
|
|
140
|
+
{
|
|
141
|
+
"case": "case-41",
|
|
142
|
+
"pass": false
|
|
143
|
+
},
|
|
144
|
+
{
|
|
145
|
+
"case": "case-48",
|
|
146
|
+
"pass": false
|
|
147
|
+
},
|
|
148
|
+
{
|
|
149
|
+
"case": "case-54",
|
|
150
|
+
"pass": false
|
|
151
|
+
},
|
|
152
|
+
{
|
|
153
|
+
"case": "case-60",
|
|
154
|
+
"pass": false
|
|
155
|
+
},
|
|
156
|
+
{
|
|
157
|
+
"case": "case-63",
|
|
158
|
+
"pass": false
|
|
159
|
+
},
|
|
160
|
+
{
|
|
161
|
+
"case": "good-01",
|
|
162
|
+
"pass": false
|
|
163
|
+
}
|
|
164
|
+
]
|
|
165
|
+
}
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
import type { FeedbackToSend } from './outbox';
|
|
2
|
+
|
|
3
|
+
/** Copies a drained legacy queue into the managed outbox. The caller holds the legacy runner paused during the copy. */
|
|
4
|
+
export const importLegacyFeedback = async (input: {
|
|
5
|
+
readonly managedCompletedRealWork: boolean;
|
|
6
|
+
readonly withDrainedLegacyQueue: <T>(read: (queue: AsyncIterable<FeedbackToSend>) => Promise<T>) => Promise<T>;
|
|
7
|
+
readonly commit: (items: ReadonlyArray<FeedbackToSend>) => void;
|
|
8
|
+
}): Promise<number> => {
|
|
9
|
+
if (!input.managedCompletedRealWork) return 0;
|
|
10
|
+
return input.withDrainedLegacyQueue(async (queue) => {
|
|
11
|
+
const items: FeedbackToSend[] = [];
|
|
12
|
+
for await (const item of queue) items.push(item);
|
|
13
|
+
input.commit(items);
|
|
14
|
+
return items.length;
|
|
15
|
+
});
|
|
16
|
+
};
|
|
@@ -0,0 +1,66 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* THE INTAKE: every feedback item handed to the workflow, one file each, named `<arrived>-<slug>.md` so the folder's order
|
|
3
|
+
* is the order they arrived in. An item is on the workflow's list until an install record names it (`installed/`).
|
|
4
|
+
*
|
|
5
|
+
* An item's file holds Alex's exact words and what drew them, as the agent that received the feedback wrote them
|
|
6
|
+
* (`agentic-collaboration` section 1). The workflow never edits it. Items are read from every copy of the skill on the
|
|
7
|
+
* machine (`machineIntakeFolders`) and added to the copy the adding agent loaded.
|
|
8
|
+
*/
|
|
9
|
+
import { Data, Effect } from 'effect';
|
|
10
|
+
import fs from 'node:fs';
|
|
11
|
+
import path from 'node:path';
|
|
12
|
+
|
|
13
|
+
export class IntakeError extends Data.TaggedError('IntakeError')<{ readonly reason: string }> {}
|
|
14
|
+
|
|
15
|
+
const attempt = <A>(what: string, f: () => A) => Effect.try({ try: f, catch: (e) => new IntakeError({ reason: `${what}: ${e instanceof Error ? e.message : String(e)}` }) });
|
|
16
|
+
|
|
17
|
+
/** An item's id from when it arrived and a few words naming it: sortable, and safe as a file name. Pure. */
|
|
18
|
+
export const itemId = (input: { readonly arrived: Date; readonly slug: string }): string => {
|
|
19
|
+
const at = input.arrived.toISOString().slice(0, 19).replace(/:/g, '-');
|
|
20
|
+
const slug = input.slug.toLowerCase().replace(/[^a-z0-9]+/g, '-').replace(/^-+|-+$/g, '').slice(0, 60);
|
|
21
|
+
if (slug.length === 0) throw new Error('an item needs a few words naming it');
|
|
22
|
+
return `${at}-${slug}`;
|
|
23
|
+
};
|
|
24
|
+
|
|
25
|
+
export const makeIntake = (folders: {
|
|
26
|
+
/** Where `add` writes: the intake of the copy the adding agent loaded. */
|
|
27
|
+
readonly intake: string;
|
|
28
|
+
/** Every intake the items are read from; includes `intake`. */
|
|
29
|
+
readonly intakes: ReadonlyArray<string>;
|
|
30
|
+
readonly installed: string;
|
|
31
|
+
}) => {
|
|
32
|
+
/** Adds an item; adding the same id again is refused, so an item is never handed over twice under one name. */
|
|
33
|
+
const add = (input: { readonly arrived: Date; readonly slug: string; readonly text: string }) => attempt('the item could not be added', () => {
|
|
34
|
+
const id = itemId(input);
|
|
35
|
+
fs.mkdirSync(folders.intake, { recursive: true });
|
|
36
|
+
fs.writeFileSync(path.join(folders.intake, `${id}.md`), input.text, { flag: 'wx' });
|
|
37
|
+
return id;
|
|
38
|
+
});
|
|
39
|
+
|
|
40
|
+
const ids = (folder: string) => (fs.existsSync(folder) ? fs.readdirSync(folder).filter((f) => !f.startsWith('.')).map((f) => f.replace(/\.(md|json)$/, '')) : []);
|
|
41
|
+
|
|
42
|
+
/** The file holding an item, in whichever intake it was added to. */
|
|
43
|
+
const fileOf = (id: string) => folders.intakes.map((d) => path.join(d, `${id}.md`)).find((f) => fs.existsSync(f));
|
|
44
|
+
|
|
45
|
+
/** The items still to do, oldest first: in an intake, with no install record. */
|
|
46
|
+
const open = () => attempt('the intake could not be read', () => {
|
|
47
|
+
const installed = new Set(ids(folders.installed));
|
|
48
|
+
return [...new Set(folders.intakes.flatMap(ids))].filter((id) => !installed.has(id)).sort();
|
|
49
|
+
});
|
|
50
|
+
|
|
51
|
+
const text = (id: string) => attempt(`item ${id} could not be read`, () => {
|
|
52
|
+
const file = fileOf(id);
|
|
53
|
+
if (file === undefined) throw new Error(`no intake holds ${id}`);
|
|
54
|
+
return fs.readFileSync(file, 'utf8');
|
|
55
|
+
});
|
|
56
|
+
|
|
57
|
+
/** Records what was installed for an item, which takes it off the list. */
|
|
58
|
+
const recordInstalled = (id: string, record: unknown) => attempt(`the install of ${id} could not be recorded`, () => {
|
|
59
|
+
fs.mkdirSync(folders.installed, { recursive: true });
|
|
60
|
+
fs.writeFileSync(path.join(folders.installed, `${id}.json`), JSON.stringify(record, null, 1));
|
|
61
|
+
});
|
|
62
|
+
|
|
63
|
+
return { add, open, text, recordInstalled };
|
|
64
|
+
};
|
|
65
|
+
|
|
66
|
+
export type Intake = ReturnType<typeof makeIntake>;
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
import type { FeedbackToSend } from './outbox';
|
|
2
|
+
import { makeOrganizationSite } from '../organization-site';
|
|
3
|
+
|
|
4
|
+
export const makeManagedIntake = (options: Parameters<typeof makeOrganizationSite>[0]) => {
|
|
5
|
+
const send = makeOrganizationSite(options);
|
|
6
|
+
return async (item: FeedbackToSend): Promise<{ readonly task: string }> => {
|
|
7
|
+
const response = await send('/worker/feedback', {}, {
|
|
8
|
+
method: 'POST',
|
|
9
|
+
headers: { 'content-type': 'application/json' },
|
|
10
|
+
body: JSON.stringify(item),
|
|
11
|
+
});
|
|
12
|
+
if (!response.ok) throw new Error('Organization rejected feedback with HTTP ' + response.status);
|
|
13
|
+
const receipt: unknown = await response.json();
|
|
14
|
+
if (typeof receipt !== 'object' || receipt === null || !('task' in receipt) || typeof receipt.task !== 'string' || receipt.task.length === 0) {
|
|
15
|
+
throw new Error('Feedback acknowledgement did not name a task');
|
|
16
|
+
}
|
|
17
|
+
return { task: receipt.task };
|
|
18
|
+
};
|
|
19
|
+
};
|
|
@@ -0,0 +1,50 @@
|
|
|
1
|
+
import type { Database } from 'bun:sqlite';
|
|
2
|
+
|
|
3
|
+
export interface FeedbackToSend {
|
|
4
|
+
readonly item: string;
|
|
5
|
+
readonly text: string;
|
|
6
|
+
readonly earlierTries?: string;
|
|
7
|
+
}
|
|
8
|
+
|
|
9
|
+
/** Uses a database dedicated to the managed worker, separate from the legacy intake and engine. */
|
|
10
|
+
export const makeFeedbackOutbox = (db: Database) => {
|
|
11
|
+
db.run(`CREATE TABLE IF NOT EXISTS feedback_outbox (
|
|
12
|
+
item TEXT PRIMARY KEY,
|
|
13
|
+
text TEXT NOT NULL,
|
|
14
|
+
earlier_tries TEXT,
|
|
15
|
+
remote_task TEXT
|
|
16
|
+
)`);
|
|
17
|
+
db.run('CREATE TABLE IF NOT EXISTS legacy_refinement_cutover (done INTEGER PRIMARY KEY CHECK (done = 1))');
|
|
18
|
+
db.run('CREATE TABLE IF NOT EXISTS managed_refinement_proof (task TEXT PRIMARY KEY)');
|
|
19
|
+
const insert = db.query('INSERT INTO feedback_outbox (item, text, earlier_tries) VALUES (?, ?, ?) ON CONFLICT (item) DO NOTHING');
|
|
20
|
+
const content = db.query<{ text: string; earlier_tries: string | null }, [string]>('SELECT text, earlier_tries FROM feedback_outbox WHERE item = ?');
|
|
21
|
+
const head = db.query<{ item: string; text: string; earlier_tries: string | null }, []>('SELECT item, text, earlier_tries FROM feedback_outbox WHERE remote_task IS NULL ORDER BY item LIMIT 1');
|
|
22
|
+
const acknowledge = db.query('UPDATE feedback_outbox SET remote_task = ? WHERE item = ? AND remote_task IS NULL');
|
|
23
|
+
|
|
24
|
+
const enqueue = db.transaction(({ item, text, earlierTries }: FeedbackToSend) => {
|
|
25
|
+
const previous = content.get(item);
|
|
26
|
+
if (previous !== null && (previous.text !== text || previous.earlier_tries !== (earlierTries ?? null))) {
|
|
27
|
+
throw new Error('Feedback ' + item + ' is already queued with different content');
|
|
28
|
+
}
|
|
29
|
+
insert.run(item, text, earlierTries ?? null);
|
|
30
|
+
});
|
|
31
|
+
const cutOver = () => db.query('SELECT done FROM legacy_refinement_cutover WHERE done = 1').get() !== null;
|
|
32
|
+
const recordInstallation = db.query('INSERT OR IGNORE INTO managed_refinement_proof (task) SELECT remote_task FROM feedback_outbox WHERE remote_task = ? LIMIT 1');
|
|
33
|
+
const installedRealFeedback = () => db.query('SELECT task FROM managed_refinement_proof LIMIT 1').get() !== null;
|
|
34
|
+
const commitLegacy = db.transaction((items: ReadonlyArray<FeedbackToSend>) => {
|
|
35
|
+
if (cutOver()) return;
|
|
36
|
+
for (const item of items) enqueue(item);
|
|
37
|
+
db.run('INSERT INTO legacy_refinement_cutover (done) VALUES (1)');
|
|
38
|
+
});
|
|
39
|
+
|
|
40
|
+
const deliverNext = async (send: (item: FeedbackToSend) => Promise<{ readonly task: string }>): Promise<boolean> => {
|
|
41
|
+
const row = head.get();
|
|
42
|
+
if (row === null) return false;
|
|
43
|
+
const result = await send({ item: row.item, text: row.text, ...(row.earlier_tries === null ? {} : { earlierTries: row.earlier_tries }) });
|
|
44
|
+
if (typeof result.task !== 'string' || result.task.length === 0) throw new Error('Feedback acknowledgement did not name a task');
|
|
45
|
+
acknowledge.run(result.task, row.item);
|
|
46
|
+
return true;
|
|
47
|
+
};
|
|
48
|
+
|
|
49
|
+
return { enqueue, deliverNext, cutOver, commitLegacy, recordInstallation: (task: string) => { recordInstallation.run(task); }, installedRealFeedback };
|
|
50
|
+
};
|