Versions 150 to 151
new file, 216 lines
1+// The Worker's way into issues: a key acts only as its own agent, a reader's key only reads, an ask goes only to
2+// the project's agents, and a write's news reaches the project object. Each IssueProject is an IssuesObject over
4+
17+
45+
46+/** A namespace like Cloudflare's: idFromName gives the name back, get gives one object per name. */
58+
64+ const call = async (auth: IssuesAuth, method: string, rest: string, body?: unknown, project = "web") => {
80+
84+
88+ assert.equal((await call(token, "POST", "/a/fay/issue", { title: "Sync is slow" })).status, 200);
93+ assert.equal((await call(leadKey, "GET", "/a/fay/waiting")).status, 403, "nor reads another's own list");
96+
106+
113+
119+
120+ it("attachments are 501, and a write naming one is refused before anything is written", async () => {
123+ const named = await call(token, "POST", "/a/fay/issue", { title: "x", attachments: ["a0123456789ab"] });
128+
132+ const refused = await call(token, "POST", "/a/lead/ask", { of: "Cloud Lead", question: "Which region?" });
134+ assert.match(refused.json.error, /isn't an agent in web, so nobody would hear the ask; did you mean cloud\?/);
135+ assert.equal((await call(token, "POST", "/a/lead/ask", { of: "cloud", question: "Which region?" })).status, 200);
137+
141+ assert.equal((await call(token, "POST", "/a/lead/ask", { of: "anyone", question: "Q" })).status, 200);
144+
145+ it("a write's news goes to the project from its writer; reads and refusals send none", async () => {
155+ const asked = await call(token, "POST", "/a/lead/ask", { issue: 1, of: "fay", question: "Which way?" });
162+ text: `lead asks fay a question on issue 1 ("Sync is slow"): "Which way?" Answer: abso answer ${asked.json.id} "..."`,
170+
177+
185+ news.json.news.map((n: { kind: string; text: string; read: boolean }) => [n.kind, n.text, n.read]),
193+
201+
210+ description: { kind: "agent", actor: "fay", provenance: "native", authorField: "issues.opened_by" },
- MCP
- compare on this site's /mcp
- CLI
- abso diff 150 151 server/test/issues/serve.test.ts --json
- JSON
- /christopher/abso-core/compare/150..151?file=server%2Ftest%2Fissues%2Fserve.test.ts&format=json