@voxslopuli/openagentsy 0.0.0-stage → 0.2.1

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 (168) hide show
  1. package/LICENSE +674 -0
  2. package/README.md +21 -2
  3. package/dist/adapter-dependency.test.d.ts +2 -0
  4. package/dist/adapter-dependency.test.d.ts.map +1 -0
  5. package/dist/adapter-dependency.test.js +51 -0
  6. package/dist/adapter-dependency.test.js.map +1 -0
  7. package/dist/commands/approve.d.ts +63 -0
  8. package/dist/commands/approve.d.ts.map +1 -0
  9. package/dist/commands/approve.js +218 -0
  10. package/dist/commands/approve.js.map +1 -0
  11. package/dist/commands/approve.test.d.ts +2 -0
  12. package/dist/commands/approve.test.d.ts.map +1 -0
  13. package/dist/commands/approve.test.js +219 -0
  14. package/dist/commands/approve.test.js.map +1 -0
  15. package/dist/commands/audit.d.ts +74 -0
  16. package/dist/commands/audit.d.ts.map +1 -0
  17. package/dist/commands/audit.js +230 -0
  18. package/dist/commands/audit.js.map +1 -0
  19. package/dist/commands/audit.test.d.ts +2 -0
  20. package/dist/commands/audit.test.d.ts.map +1 -0
  21. package/dist/commands/audit.test.js +194 -0
  22. package/dist/commands/audit.test.js.map +1 -0
  23. package/dist/commands/board.d.ts +33 -0
  24. package/dist/commands/board.d.ts.map +1 -0
  25. package/dist/commands/board.js +65 -0
  26. package/dist/commands/board.js.map +1 -0
  27. package/dist/commands/build.d.ts +17 -0
  28. package/dist/commands/build.d.ts.map +1 -0
  29. package/dist/commands/build.js +145 -0
  30. package/dist/commands/build.js.map +1 -0
  31. package/dist/commands/conformance.d.ts +31 -0
  32. package/dist/commands/conformance.d.ts.map +1 -0
  33. package/dist/commands/conformance.js +57 -0
  34. package/dist/commands/conformance.js.map +1 -0
  35. package/dist/commands/conformance.test.d.ts +2 -0
  36. package/dist/commands/conformance.test.d.ts.map +1 -0
  37. package/dist/commands/conformance.test.js +74 -0
  38. package/dist/commands/conformance.test.js.map +1 -0
  39. package/dist/commands/doctor.d.ts +132 -0
  40. package/dist/commands/doctor.d.ts.map +1 -0
  41. package/dist/commands/doctor.js +768 -0
  42. package/dist/commands/doctor.js.map +1 -0
  43. package/dist/commands/doctor.test.d.ts +2 -0
  44. package/dist/commands/doctor.test.d.ts.map +1 -0
  45. package/dist/commands/doctor.test.js +329 -0
  46. package/dist/commands/doctor.test.js.map +1 -0
  47. package/dist/commands/ledger.d.ts +109 -0
  48. package/dist/commands/ledger.d.ts.map +1 -0
  49. package/dist/commands/ledger.js +286 -0
  50. package/dist/commands/ledger.js.map +1 -0
  51. package/dist/commands/ledger.test.d.ts +2 -0
  52. package/dist/commands/ledger.test.d.ts.map +1 -0
  53. package/dist/commands/ledger.test.js +238 -0
  54. package/dist/commands/ledger.test.js.map +1 -0
  55. package/dist/commands/lessons.d.ts +73 -0
  56. package/dist/commands/lessons.d.ts.map +1 -0
  57. package/dist/commands/lessons.js +97 -0
  58. package/dist/commands/lessons.js.map +1 -0
  59. package/dist/commands/lessons.test.d.ts +2 -0
  60. package/dist/commands/lessons.test.d.ts.map +1 -0
  61. package/dist/commands/lessons.test.js +146 -0
  62. package/dist/commands/lessons.test.js.map +1 -0
  63. package/dist/commands/models.d.ts +49 -0
  64. package/dist/commands/models.d.ts.map +1 -0
  65. package/dist/commands/models.js +125 -0
  66. package/dist/commands/models.js.map +1 -0
  67. package/dist/commands/report.d.ts +57 -0
  68. package/dist/commands/report.d.ts.map +1 -0
  69. package/dist/commands/report.js +164 -0
  70. package/dist/commands/report.js.map +1 -0
  71. package/dist/commands/report.test.d.ts +2 -0
  72. package/dist/commands/report.test.d.ts.map +1 -0
  73. package/dist/commands/report.test.js +294 -0
  74. package/dist/commands/report.test.js.map +1 -0
  75. package/dist/commands/scope.d.ts +34 -0
  76. package/dist/commands/scope.d.ts.map +1 -0
  77. package/dist/commands/scope.js +78 -0
  78. package/dist/commands/scope.js.map +1 -0
  79. package/dist/commands/scope.test.d.ts +2 -0
  80. package/dist/commands/scope.test.d.ts.map +1 -0
  81. package/dist/commands/scope.test.js +98 -0
  82. package/dist/commands/scope.test.js.map +1 -0
  83. package/dist/commands/setup.d.ts +31 -0
  84. package/dist/commands/setup.d.ts.map +1 -0
  85. package/dist/commands/setup.js +93 -0
  86. package/dist/commands/setup.js.map +1 -0
  87. package/dist/commands/waivers.d.ts +47 -0
  88. package/dist/commands/waivers.d.ts.map +1 -0
  89. package/dist/commands/waivers.js +68 -0
  90. package/dist/commands/waivers.js.map +1 -0
  91. package/dist/commands/waivers.test.d.ts +2 -0
  92. package/dist/commands/waivers.test.d.ts.map +1 -0
  93. package/dist/commands/waivers.test.js +64 -0
  94. package/dist/commands/waivers.test.js.map +1 -0
  95. package/dist/generate/agent.d.ts +19 -0
  96. package/dist/generate/agent.d.ts.map +1 -0
  97. package/dist/generate/agent.js +35 -0
  98. package/dist/generate/agent.js.map +1 -0
  99. package/dist/generate/agent.test.d.ts +2 -0
  100. package/dist/generate/agent.test.d.ts.map +1 -0
  101. package/dist/generate/agent.test.js +245 -0
  102. package/dist/generate/agent.test.js.map +1 -0
  103. package/dist/generate/commands.d.ts +15 -0
  104. package/dist/generate/commands.d.ts.map +1 -0
  105. package/dist/generate/commands.js +59 -0
  106. package/dist/generate/commands.js.map +1 -0
  107. package/dist/generate/lock.d.ts +18 -0
  108. package/dist/generate/lock.d.ts.map +1 -0
  109. package/dist/generate/lock.js +26 -0
  110. package/dist/generate/lock.js.map +1 -0
  111. package/dist/generate/prompt.d.ts +11 -0
  112. package/dist/generate/prompt.d.ts.map +1 -0
  113. package/dist/generate/prompt.js +114 -0
  114. package/dist/generate/prompt.js.map +1 -0
  115. package/dist/generate/prompt.test.d.ts +2 -0
  116. package/dist/generate/prompt.test.d.ts.map +1 -0
  117. package/dist/generate/prompt.test.js +59 -0
  118. package/dist/generate/prompt.test.js.map +1 -0
  119. package/dist/index.d.ts +40 -0
  120. package/dist/index.d.ts.map +1 -0
  121. package/dist/index.js +448 -0
  122. package/dist/index.js.map +1 -0
  123. package/dist/index.test.d.ts +2 -0
  124. package/dist/index.test.d.ts.map +1 -0
  125. package/dist/index.test.js +237 -0
  126. package/dist/index.test.js.map +1 -0
  127. package/dist/opencode.d.ts +29 -0
  128. package/dist/opencode.d.ts.map +1 -0
  129. package/dist/opencode.js +125 -0
  130. package/dist/opencode.js.map +1 -0
  131. package/dist/plugin-bundle.test.d.ts +2 -0
  132. package/dist/plugin-bundle.test.d.ts.map +1 -0
  133. package/dist/plugin-bundle.test.js +43 -0
  134. package/dist/plugin-bundle.test.js.map +1 -0
  135. package/dist/plugin.d.ts +11 -0
  136. package/dist/plugin.d.ts.map +1 -0
  137. package/dist/plugin.js +46 -0
  138. package/dist/plugin.js.map +1 -0
  139. package/dist/quality-skills.test.d.ts +2 -0
  140. package/dist/quality-skills.test.d.ts.map +1 -0
  141. package/dist/quality-skills.test.js +141 -0
  142. package/dist/quality-skills.test.js.map +1 -0
  143. package/dist/report/footprint.d.ts +12 -0
  144. package/dist/report/footprint.d.ts.map +1 -0
  145. package/dist/report/footprint.js +121 -0
  146. package/dist/report/footprint.js.map +1 -0
  147. package/dist/report/ledger.d.ts +27 -0
  148. package/dist/report/ledger.d.ts.map +1 -0
  149. package/dist/report/ledger.js +197 -0
  150. package/dist/report/ledger.js.map +1 -0
  151. package/dist/report/oversight.d.ts +21 -0
  152. package/dist/report/oversight.d.ts.map +1 -0
  153. package/dist/report/oversight.js +146 -0
  154. package/dist/report/oversight.js.map +1 -0
  155. package/dist/report/policy-firing.test.d.ts +2 -0
  156. package/dist/report/policy-firing.test.d.ts.map +1 -0
  157. package/dist/report/policy-firing.test.js +68 -0
  158. package/dist/report/policy-firing.test.js.map +1 -0
  159. package/dist/report/scope.d.ts +64 -0
  160. package/dist/report/scope.d.ts.map +1 -0
  161. package/dist/report/scope.js +146 -0
  162. package/dist/report/scope.js.map +1 -0
  163. package/dist/who.d.ts +9 -0
  164. package/dist/who.d.ts.map +1 -0
  165. package/dist/who.js +11 -0
  166. package/dist/who.js.map +1 -0
  167. package/package.json +55 -4
  168. package/plugin/openagentsy.js +39478 -0
@@ -0,0 +1,164 @@
1
+ import { buildConformanceReport, ethicalReportJson, renderEthicalReport, } from '@openagentsy/core';
2
+ import { loadWaiverLookup } from '@openagentsy/hooks/quality/waivers';
3
+ import { acceptGate, readFindings } from '@openagentsy/quality';
4
+ import { ledgerFacts } from '../report/ledger.js';
5
+ import { oversightFacts, scopedFindings } from '../report/oversight.js';
6
+ import { parseScope } from '../report/scope.js';
7
+ /**
8
+ * The facts of a project with nothing in it.
9
+ *
10
+ * A command that cannot build a scope has no report to render, and the
11
+ * problem it reports is the whole of its output.
12
+ */
13
+ function emptyFacts(scope) {
14
+ return {
15
+ scope,
16
+ cost: {
17
+ present: false,
18
+ messages: 0,
19
+ tokens: 0,
20
+ roles: [],
21
+ reportedUsd: null,
22
+ estimatedUsd: null,
23
+ unpricedModels: 0,
24
+ unpricedMessages: 0,
25
+ },
26
+ footprint: {
27
+ present: false,
28
+ energyKwh: null,
29
+ waterL: null,
30
+ co2Kg: null,
31
+ method: null,
32
+ dominantUncertainty: null,
33
+ grid: null,
34
+ undisclosedProviders: 0,
35
+ },
36
+ waste: { present: false, tokens: 0, percentage: 0, byKind: [] },
37
+ value: {
38
+ present: false,
39
+ tasksCompleted: 0,
40
+ tasksScrapped: 0,
41
+ commits: 0,
42
+ prsMerged: 0,
43
+ tokensPerTask: null,
44
+ tokensPerCommit: null,
45
+ offloadMessages: 0,
46
+ offloadTokens: 0,
47
+ offloadUsd: null,
48
+ offloadCloudUsd: null,
49
+ offloadSavedUsd: null,
50
+ },
51
+ oversight: {
52
+ records: 0,
53
+ lessons: 0,
54
+ memory: 0,
55
+ waivers: 0,
56
+ auditEntries: 0,
57
+ openFloor: 0,
58
+ openFloorFindings: [],
59
+ mismatches: { known: false, reason: 'no package compares the board with a report' },
60
+ redactions: { known: false, reason: 'no package keeps a counter' },
61
+ },
62
+ conformance: {
63
+ total: 0,
64
+ observed: 0,
65
+ provenStatic: 0,
66
+ unverified: 0,
67
+ unverifiedIds: [],
68
+ pluginOrderWarnings: [],
69
+ },
70
+ policies: { present: false, firings: 0, top: [], neverFired: [] },
71
+ };
72
+ }
73
+ /**
74
+ * The conformance of the project, as the report shows it.
75
+ *
76
+ * The counts and the unverified capabilities are the conformance report of
77
+ * §11, and the unverified ones are named: a guess about the host must not
78
+ * read as a tested fact.
79
+ */
80
+ async function conformanceFacts(roots) {
81
+ const report = await buildConformanceReport({
82
+ workspace: roots.workspace,
83
+ stateRoot: roots.stateRoot,
84
+ });
85
+ return {
86
+ total: report.counts.total,
87
+ observed: report.counts.observed,
88
+ provenStatic: report.counts.proven_static,
89
+ unverified: report.counts.unverified,
90
+ unverifiedIds: report.capabilities
91
+ .filter((capability) => capability.state === 'unverified')
92
+ .map((capability) => capability.id),
93
+ pluginOrderWarnings: report.pluginOrderWarnings.map((warning) => ({
94
+ plugin: warning.plugin,
95
+ detail: warning.detail,
96
+ })),
97
+ };
98
+ }
99
+ /**
100
+ * The report.
101
+ *
102
+ * The scope names the rows the ledger is read for, the board records the
103
+ * oversight counts, and the findings store the gate. Nothing is written.
104
+ */
105
+ export async function runEthicalReport(roots, options = {}) {
106
+ const parsed = parseScope(options);
107
+ if (!parsed.ok) {
108
+ return { facts: emptyFacts({ kind: 'project' }), exitCode: 2, problem: parsed.error };
109
+ }
110
+ const scope = parsed.scope;
111
+ const findings = await readFindings(roots.stateRoot);
112
+ const ledger = await ledgerFacts(roots.stateRoot, scope);
113
+ const oversight = await oversightFacts(roots.stateRoot, scope, findings);
114
+ const conformance = await conformanceFacts(roots);
115
+ // The gate decides, not the report: the rule is the quality package's,
116
+ // and the report asks it whether a ship of this work would be accepted.
117
+ const waivers = await loadWaiverLookup(roots.stateRoot);
118
+ const gate = acceptGate({
119
+ raw: { verdict: 'ship' },
120
+ findings: scopedFindings(findings, scope),
121
+ waivers,
122
+ });
123
+ const facts = {
124
+ scope,
125
+ cost: ledger.cost,
126
+ footprint: ledger.footprint,
127
+ waste: ledger.waste,
128
+ value: ledger.value,
129
+ oversight,
130
+ conformance,
131
+ policies: ledger.policies,
132
+ };
133
+ const refusing = !gate.accepted;
134
+ return {
135
+ facts,
136
+ exitCode: options.check === true && refusing ? 1 : 0,
137
+ ...(refusing
138
+ ? { refusal: `the gate refuses the ship: ${gate.openFloor.length} floor findings are open` }
139
+ : {}),
140
+ };
141
+ }
142
+ /**
143
+ * The report, as plain text.
144
+ *
145
+ * The text carries no colour, and a refusal is said in words rather than in
146
+ * an exit code alone, so a reader of the output knows what happened.
147
+ */
148
+ export function formatEthicalReport(report) {
149
+ if (report.problem !== undefined)
150
+ return `${report.problem}\n`;
151
+ const text = renderEthicalReport(report.facts);
152
+ if (report.refusal === undefined)
153
+ return text;
154
+ return `${text}\n${report.refusal}\n`;
155
+ }
156
+ /**
157
+ * The report, as JSON.
158
+ *
159
+ * The same facts the text is rendered from, so the two can never disagree.
160
+ */
161
+ export function ethicalReportAsJson(report) {
162
+ return `${JSON.stringify(ethicalReportJson(report.facts), null, 2)}\n`;
163
+ }
164
+ //# sourceMappingURL=report.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"report.js","sourceRoot":"","sources":["../../src/commands/report.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,sBAAsB,EAEtB,iBAAiB,EAGjB,mBAAmB,GACpB,MAAM,mBAAmB,CAAC;AAC3B,OAAO,EAAE,gBAAgB,EAAE,MAAM,oCAAoC,CAAC;AACtE,OAAO,EAAE,UAAU,EAAE,YAAY,EAAqB,MAAM,sBAAsB,CAAC;AACnF,OAAO,EAAE,WAAW,EAAE,MAAM,qBAAqB,CAAC;AAClD,OAAO,EAAE,cAAc,EAAE,cAAc,EAAE,MAAM,wBAAwB,CAAC;AACxE,OAAO,EAAE,UAAU,EAAE,MAAM,oBAAoB,CAAC;AAwChD;;;;;GAKG;AACH,SAAS,UAAU,CAAC,KAA2B;IAC7C,OAAO;QACL,KAAK;QACL,IAAI,EAAE;YACJ,OAAO,E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C,CAAC,CAAC;QACpD,GAAG,CAAC,QAAQ;YACV,CAAC,CAAC,EAAE,OAAO,EAAE,8BAA8B,IAAI,CAAC,SAAS,CAAC,MAAM,0BAA0B,EAAE;YAC5F,CAAC,CAAC,EAAE,CAAC;KACR,CAAC;AACJ,CAAC;AAED;;;;;GAKG;AACH,MAAM,UAAU,mBAAmB,CAAC,MAAqB;IACvD,IAAI,MAAM,CAAC,OAAO,KAAK,SAAS;QAAE,OAAO,GAAG,MAAM,CAAC,OAAO,IAAI,CAAC;IAC/D,MAAM,IAAI,GAAG,mBAAmB,CAAC,MAAM,CAAC,KAAK,CAAC,CAAC;IAC/C,IAAI,MAAM,CAAC,OAAO,KAAK,SAAS;QAAE,OAAO,IAAI,CAAC;IAC9C,OAAO,GAAG,IAAI,KAAK,MAAM,CAAC,OAAO,IAAI,CAAC;AACxC,CAAC;AAED;;;;GAIG;AACH,MAAM,UAAU,mBAAmB,CAAC,MAAqB;IACvD,OAAO,GAAG,IAAI,CAAC,SAAS,CAAC,iBAAiB,CAAC,MAAM,CAAC,KAAK,CAAC,EAAE,IAAI,EAAE,CAAC,CAAC,IAAI,CAAC;AACzE,CAAC"}
@@ -0,0 +1,2 @@
1
+ export {};
2
+ //# sourceMappingURL=report.test.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"report.test.d.ts","sourceRoot":"","sources":["../../src/commands/report.test.ts"],"names":[],"mappings":""}
@@ -0,0 +1,294 @@
1
+ import { mkdir, mkdtemp, writeFile } from 'node:fs/promises';
2
+ import { tmpdir } from 'node:os';
3
+ import { join } from 'node:path';
4
+ import { closeDatabase, createRecord, migrate, openDatabase, } from '@openagentsy/core';
5
+ import { closeLedger, openLedger, recordFootprint } from '@openagentsy/ledger';
6
+ import { describe, expect, it } from 'vitest';
7
+ import { formatEthicalReport, runEthicalReport } from './report.js';
8
+ /**
9
+ * A project with a run in it.
10
+ *
11
+ * The fixture is the whole state of a project: a ledger with usage, waste,
12
+ * outcomes and a footprint, a board with records, the lessons, the waivers,
13
+ * the audit log, the findings of a check and the evidence of a live
14
+ * observation. Every number the report prints is read out of one of them.
15
+ */
16
+ /** The state of a project, as the report reads it. */
17
+ async function scratch() {
18
+ const root = await mkdtemp(join(tmpdir(), 'openagentsy-report-'));
19
+ await seedLedger(root);
20
+ await seedBoard(root);
21
+ await seedStores(root);
22
+ return { workspace: root, stateRoot: root };
23
+ }
24
+ /** The moment the fixture was written. */
25
+ const NOW = new Date().toISOString();
26
+ /** The usage insert, with the columns the report reads. */
27
+ const USAGE_INSERT = `INSERT INTO usage
28
+ (message_id, session_id, root_session_id, role, provider, model,
29
+ input, output, reasoning, cache_read, cache_write,
30
+ cost_reported, cost_estimated, task_id, ts)
31
+ VALUES (?,?,?,?,?,?,?,?,?,?,?,?,?,?,?)`;
32
+ /** The footprint of one message, as the estimator produced it. */
33
+ const IMPACT = {
34
+ energyWh: [2100, 4800],
35
+ waterL: [210, 980],
36
+ co2Kg: [0.9, 2.1],
37
+ warmingC: [3.1e-17, 7.3e-17],
38
+ dominantUncertainty: 'model-size',
39
+ notes: ['output tokens only (EcoLogits method)'],
40
+ };
41
+ /** The ledger of the fixture. */
42
+ async function seedLedger(root) {
43
+ const db = openLedger(root);
44
+ try {
45
+ const usage = db.query(USAGE_INSERT);
46
+ usage.run('msg-1', 'ses_1', 'ses_1', 'builder', 'anthropic', 'claude-x', 100_000, 200_000, 50_000, 0, 10_000, 0.42, null, '2e-4a', NOW);
47
+ usage.run('msg-2', 'ses_1', 'ses_1', 'lead', 'anthropic', 'claude-x', 50_000, 10_000, 0, 0, 0, null, 0.01, '2e-4a', NOW);
48
+ usage.run('msg-3', 'ses_2', 'ses_2', 'reviewer', 'ollama', 'qwen3:8b', 10_000, 5_000, 0, 0, 0, null, null, 'other-bean', NOW);
49
+ const waste = db.query('INSERT INTO waste (root_session_id, message_id, kind, tokens, detail, ts) VALUES (?,?,?,?,?,?)');
50
+ waste.run('ses_1', 'msg-1', 'retry', 100_000, 'the same call twice', NOW);
51
+ waste.run('ses_1', 'msg-1', 'tool_error_loop', 50_000, 'the tool failed', NOW);
52
+ const outcome = db.query('INSERT INTO outcome (root_session_id, task_id, commit_sha, kind, ts) VALUES (?,?,?,?,?)');
53
+ outcome.run('ses_1', '2e-4a', 'abc123', 'task_completed', NOW);
54
+ outcome.run('ses_1', '2e-4a', null, 'task_scrapped', NOW);
55
+ outcome.run('ses_1', '2e-4a', 'abc123', 'commit', NOW);
56
+ recordFootprint(db, 'msg-1', IMPACT);
57
+ seedPolicyFirings(db);
58
+ }
59
+ finally {
60
+ closeLedger(db);
61
+ }
62
+ }
63
+ /**
64
+ * The policy firings of the fixture.
65
+ *
66
+ * The rows are the ones §21.3 holds: the policy id, the version it carried
67
+ * when it fired, the session and the outcome.
68
+ */
69
+ function seedPolicyFirings(db) {
70
+ const insert = db.query(`INSERT INTO policy_firing
71
+ (id, session_id, policy_id, policy_version, layer, action, severity, reason, origin, ts)
72
+ VALUES (?,?,?,?,?,?,?,?,?,?)`);
73
+ insert.run('f1', 'ses_1', 'oa.anti-sycophancy', '1.0.0', 4, 'flag', 'warn', null, 'first-party', NOW);
74
+ insert.run('f2', 'ses_1', 'oa.anti-sycophancy', '1.0.0', 4, 'flag', 'warn', null, 'first-party', NOW);
75
+ insert.run('f3', 'ses_1', 'oa.anti-sycophancy', '1.0.0', 4, 'block', null, 'high risk', 'first-party', NOW);
76
+ insert.run('f4', 'ses_1', 'oa.agi-framing', '1.0.0', 4, 'flag', 'info', null, 'first-party', NOW);
77
+ insert.run('f5', 'ses_1', 'oa.policy.stack', '1.0.0', 2, 'allow', null, 'stack-assembled', 'first-party', NOW);
78
+ }
79
+ /** The board of the fixture. */
80
+ async function seedBoard(root) {
81
+ const path = join(root, '.openagentsy', 'board.sqlite');
82
+ await mkdir(join(root, '.openagentsy'), { recursive: true });
83
+ const db = openDatabase(path);
84
+ try {
85
+ migrate(db);
86
+ createRecord(db, {
87
+ bean: '2e-4a',
88
+ kind: 'status',
89
+ from: 'oa-builder',
90
+ action: 'The ethical report',
91
+ state: 'the report is written',
92
+ confidence: 'verified',
93
+ });
94
+ createRecord(db, {
95
+ bean: 'memory',
96
+ kind: 'finding',
97
+ from: 'oa-archivist',
98
+ action: 'A candidate memory',
99
+ state: 'candidate',
100
+ confidence: 'inferred',
101
+ });
102
+ createRecord(db, {
103
+ bean: 'other-bean',
104
+ kind: 'status',
105
+ from: 'oa-builder',
106
+ action: 'Something else',
107
+ state: 'done',
108
+ confidence: 'verified',
109
+ });
110
+ }
111
+ finally {
112
+ closeDatabase(db);
113
+ }
114
+ }
115
+ /** The stores of the fixture: the lessons, the waivers, the audit and the findings. */
116
+ async function seedStores(root) {
117
+ const state = join(root, '.openagentsy');
118
+ await mkdir(join(state, 'lessons'), { recursive: true });
119
+ await mkdir(join(state, 'quality'), { recursive: true });
120
+ await writeFile(join(state, 'lessons', 'oa-lesson-abcd1234.json'), `${JSON.stringify({
121
+ id: 'oa-lesson-abcd1234',
122
+ state: 'candidate',
123
+ summary: 'A call that was made twice',
124
+ occurrences: 2,
125
+ packet: {},
126
+ history: [],
127
+ kind: 'retry',
128
+ detail: 'the same call twice',
129
+ sessions: ['ses_1'],
130
+ created_at: NOW,
131
+ updated_at: NOW,
132
+ }, null, 2)}\n`, 'utf8');
133
+ await writeFile(join(state, 'quality', 'waivers.json'), `${JSON.stringify({
134
+ version: 1,
135
+ waivers: [
136
+ {
137
+ ruleId: 'css/no-transition-all',
138
+ path: 'src/app.css',
139
+ reason: 'the transition is deliberate here',
140
+ decidedBy: 'daniel',
141
+ ts: NOW,
142
+ },
143
+ ],
144
+ }, null, 2)}\n`, 'utf8');
145
+ await writeFile(join(state, 'quality', 'findings.json'), `${JSON.stringify({
146
+ version: 1,
147
+ tasks: {
148
+ '2e-4a': [
149
+ {
150
+ ruleId: 'a11y/no-aria-label',
151
+ source: 'hallmark:floor-1',
152
+ tier: 'floor',
153
+ file: 'src/app.html',
154
+ line: 4,
155
+ message: 'A control has no name.',
156
+ fix: 'Name the control',
157
+ },
158
+ {
159
+ ruleId: 'css/no-transition-all',
160
+ source: 'hallmark:floor-2',
161
+ tier: 'reflex',
162
+ file: 'src/app.css',
163
+ line: 12,
164
+ message: 'A transition of all moves every property.',
165
+ fix: 'Name the properties to transition instead of all',
166
+ },
167
+ ],
168
+ },
169
+ }, null, 2)}\n`, 'utf8');
170
+ const audit = [
171
+ {
172
+ ts: NOW,
173
+ policyId: 'oa.record.post',
174
+ policyVersion: 'v1',
175
+ actor: 'oa-builder',
176
+ action: 'post',
177
+ resource: '2e-4a',
178
+ effect: 'allow',
179
+ },
180
+ {
181
+ ts: NOW,
182
+ policyId: 'oa.lease.grant',
183
+ policyVersion: 'v1',
184
+ actor: 'oa-lead',
185
+ action: 'grant',
186
+ resource: 'packages/cli/**',
187
+ effect: 'allow',
188
+ },
189
+ ];
190
+ await writeFile(join(state, 'audit.jsonl'), `${audit.map((entry) => JSON.stringify(entry)).join('\n')}\n`, 'utf8');
191
+ await writeFile(join(state, 'conformance.json'), `${JSON.stringify({
192
+ version: 1,
193
+ capabilities: {
194
+ 'message-token-fields': {
195
+ observations: [
196
+ {
197
+ capabilityId: 'message-token-fields',
198
+ eventType: 'message.tokens',
199
+ at: NOW,
200
+ kind: 'live',
201
+ note: 'the token fields were read off a live message',
202
+ source: { ref: 'session ses_1', date: '2026-10-28' },
203
+ },
204
+ ],
205
+ },
206
+ },
207
+ }, null, 2)}\n`, 'utf8');
208
+ }
209
+ describe('the ethical report', () => {
210
+ it('renders every section from a seeded project', async () => {
211
+ const roots = await scratch();
212
+ const report = await runEthicalReport(roots);
213
+ const text = formatEthicalReport(report);
214
+ expect(text).toContain('Cost and footprint');
215
+ expect(text).toContain('tokens by role: builder 360k · lead 60k · reviewer 15k');
216
+ expect(text).toContain('spend: $0.42 reported · $0.01 estimated · 1 model unpriced');
217
+ expect(text).toContain('electricity 2.1–4.8 kWh');
218
+ expect(text).toContain('water 210–980 L');
219
+ expect(text).toContain('carbon 0.9–2.1 kg CO2');
220
+ expect(text).toContain('method ecologits-0.11.3');
221
+ expect(text).toContain('Waste');
222
+ expect(text).toContain('34% of tokens went to retries, undos and reverted code');
223
+ expect(text).toContain('Value');
224
+ expect(text).toContain('1 task completed · 1 scrapped task');
225
+ expect(text).toContain('tokens per completed task: 420k');
226
+ expect(text).toContain('Oversight');
227
+ expect(text).toContain('1 lesson to review · 1 memory to triage · 1 waiver recorded');
228
+ expect(text).toContain('open floor findings: 1');
229
+ expect(text).toContain('Conformance');
230
+ expect(text).toContain('unverified:');
231
+ });
232
+ it('shows the policies with the most firings', async () => {
233
+ const roots = await scratch();
234
+ const text = formatEthicalReport(await runEthicalReport(roots));
235
+ expect(text).toContain('Policies');
236
+ expect(text).toContain('oa.anti-sycophancy 3 firings (1.0.0) · 1 blocks · 2 flags');
237
+ expect(text).toContain('oa.agi-framing 1 firing (1.0.0) · 0 blocks · 1 flags');
238
+ const never = text.split('\n').find((entry) => entry.includes('never fired:')) ?? '';
239
+ expect(never).toContain('oa.structural-bias');
240
+ });
241
+ it('reads the firings of one session', async () => {
242
+ const roots = await scratch();
243
+ const text = formatEthicalReport(await runEthicalReport(roots, { session: 'ses_1' }));
244
+ expect(text).toContain('oa.anti-sycophancy 3 firings');
245
+ });
246
+ it('says what nobody computes instead of showing a zero', async () => {
247
+ const roots = await scratch();
248
+ const text = formatEthicalReport(await runEthicalReport(roots));
249
+ expect(text).toContain('board/report mismatches: not computed (no package compares the board with a report)');
250
+ expect(text).toContain('redactions: not computed (no package keeps a counter)');
251
+ expect(text).toContain('grid: not recorded by the ledger');
252
+ });
253
+ it('says that a scope with nothing in it is empty', async () => {
254
+ const roots = await scratch();
255
+ const text = formatEthicalReport(await runEthicalReport(roots, { bean: 'no-such-bean' }));
256
+ expect(text).toContain('bean no-such-bean');
257
+ expect(text).toContain('tokens by role: none — the scope holds no usage rows');
258
+ expect(text).toContain('spend: nothing to price');
259
+ expect(text).toContain('no waste was recorded for the scope');
260
+ expect(text).toContain('the scope holds no outcome');
261
+ expect(text).not.toContain('360k');
262
+ });
263
+ it('reads the rows of one session', async () => {
264
+ const roots = await scratch();
265
+ const text = formatEthicalReport(await runEthicalReport(roots, { session: 'ses_1' }));
266
+ expect(text).toContain('tokens by role: builder 360k · lead 60k');
267
+ expect(text).not.toContain('reviewer');
268
+ });
269
+ it('reads the rows of a window', async () => {
270
+ const roots = await scratch();
271
+ const text = formatEthicalReport(await runEthicalReport(roots, { since: '30d' }));
272
+ expect(text).toContain('the last 30 d');
273
+ expect(text).toContain('tokens by role: builder 360k · lead 60k · reviewer 15k');
274
+ });
275
+ it('refuses a scope that names two things', async () => {
276
+ const roots = await scratch();
277
+ const report = await runEthicalReport(roots, { bean: '2e-4a', session: 'ses_1' });
278
+ expect(report.exitCode).toBe(2);
279
+ expect(report.problem).toContain('names more than one thing');
280
+ });
281
+ it('fails the check while a floor finding is open', async () => {
282
+ const roots = await scratch();
283
+ const report = await runEthicalReport(roots, { check: true });
284
+ expect(report.exitCode).toBe(1);
285
+ expect(report.refusal).toContain('the gate refuses the ship');
286
+ expect(formatEthicalReport(report)).toContain('open floor findings: 1');
287
+ });
288
+ it('passes the check without the flag, because the report is not a gate', async () => {
289
+ const roots = await scratch();
290
+ const report = await runEthicalReport(roots);
291
+ expect(report.exitCode).toBe(0);
292
+ });
293
+ });
294
+ //# sourceMappingURL=report.test.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"report.test.js","sourceRoot":"","sources":["../../src/commands/report.test.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,KAAK,EAAE,OAAO,EAAE,SAAS,EAAE,MAAM,kBAAkB,CAAC;AAC7D,OAAO,EAAE,MAAM,EAAE,MAAM,SAAS,CAAC;AACjC,OAAO,EAAE,IAAI,EAAE,MAAM,WAAW,CAAC;AACjC,OAAO,EACL,aAAa,EACb,YAAY,EACZ,OAAO,EACP,YAAY,GAEb,MAAM,mBAAmB,CAAC;AAE3B,OAAO,EAAE,WAAW,EAAE,UAAU,EAAE,eAAe,E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CAAC,IAAI,CAAC,CAAC,CAAC,CAAC;QAChC,MAAM,CAAC,MAAM,CAAC,OAAO,CAAC,CAAC,SAAS,CAAC,2BAA2B,CAAC,CAAC;QAC9D,MAAM,CAAC,mBAAmB,CAAC,MAAM,CAAC,CAAC,CAAC,SAAS,CAAC,wBAAwB,CAAC,CAAC;IAC1E,CAAC,CAAC,CAAC;IAEH,EAAE,CAAC,qEAAqE,EAAE,KAAK,IAAI,EAAE;QACnF,MAAM,KAAK,GAAG,MAAM,OAAO,EAAE,CAAC;QAE9B,MAAM,MAAM,GAAG,MAAM,gBAAgB,CAAC,KAAK,CAAC,CAAC;QAE7C,MAAM,CAAC,MAAM,CAAC,QAAQ,CAAC,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC;IAClC,CAAC,CAAC,CAAC;AACL,CAAC,CAAC,CAAC"}
@@ -0,0 +1,34 @@
1
+ import { type ScopeDeclaration } from '@openagentsy/core';
2
+ /**
3
+ * The `oa scope` command (§22.3).
4
+ *
5
+ * It prints the scope declaration of one role, or of every role. It is a
6
+ * command a person runs: the declarations are there to be read, and the
7
+ * refusal a role makes is built from the same text.
8
+ *
9
+ * The command reads the declarations the core package ships. A project that
10
+ * declares its own roles reads them from its own roles file, and that is a
11
+ * follow-up: the roles file is a person's file and the parser that would
12
+ * read a declaration out of it does not exist yet.
13
+ */
14
+ /** What the command found. */
15
+ export type ScopeReport = {
16
+ /** The role that was asked for, when one was named. */
17
+ role: string | undefined;
18
+ /** The declarations to print. */
19
+ declarations: ScopeDeclaration[];
20
+ /** The role that was asked for and is not there. */
21
+ unknownRole: string | undefined;
22
+ };
23
+ /**
24
+ * The declarations to print.
25
+ *
26
+ * With a role, the declaration of that role. Without one, every
27
+ * declaration.
28
+ */
29
+ export declare function runScope(role?: string | undefined): ScopeReport;
30
+ /**
31
+ * The declarations, as they are read.
32
+ */
33
+ export declare function formatScope(report: ScopeReport): string;
34
+ //# sourceMappingURL=scope.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"scope.d.ts","sourceRoot":"","sources":["../../src/commands/scope.ts"],"names":[],"mappings":"AAAA,OAAO,EAIL,KAAK,gBAAgB,EAEtB,MAAM,mBAAmB,CAAC;AAE3B;;;;;;;;;;;GAWG;AAEH,8BAA8B;AAC9B,MAAM,MAAM,WAAW,GAAG;IACxB,uDAAuD;IACvD,IAAI,EAAE,MAAM,GAAG,SAAS,CAAC;IACzB,iCAAiC;IACjC,YAAY,EAAE,gBAAgB,EAAE,CAAC;IACjC,oDAAoD;IACpD,WAAW,EAAE,MAAM,GAAG,SAAS,CAAC;CACjC,CAAC;AASF;;;;;GAKG;AACH,wBAAgB,QAAQ,CAAC,IAAI,CAAC,EAAE,MAAM,GAAG,SAAS,GAAG,WAAW,CAa/D;AAiCD;;GAEG;AACH,wBAAgB,WAAW,CAAC,MAAM,EAAE,WAAW,GAAG,MAAM,CAcvD"}
@@ -0,0 +1,78 @@
1
+ import { isReviewed, listScopeDeclarations, REQUIRED_REVIEWERS, scopeDeclaration, } from '@openagentsy/core';
2
+ /** The names of the roles, for a message that needs them. */
3
+ function roleNames() {
4
+ return listScopeDeclarations()
5
+ .map((declaration) => declaration.role)
6
+ .join(', ');
7
+ }
8
+ /**
9
+ * The declarations to print.
10
+ *
11
+ * With a role, the declaration of that role. Without one, every
12
+ * declaration.
13
+ */
14
+ export function runScope(role) {
15
+ if (role === undefined || role.trim() === '') {
16
+ return {
17
+ role: undefined,
18
+ declarations: [...listScopeDeclarations()],
19
+ unknownRole: undefined,
20
+ };
21
+ }
22
+ const declaration = scopeDeclaration(role);
23
+ if (declaration === undefined) {
24
+ return { role: role.trim(), declarations: [], unknownRole: role.trim() };
25
+ }
26
+ return { role: declaration.role, declarations: [declaration], unknownRole: undefined };
27
+ }
28
+ /**
29
+ * One declaration, as it is read.
30
+ */
31
+ function formatDeclaration(declaration) {
32
+ const lines = [];
33
+ lines.push(`${declaration.role} (${declaration.display}):`);
34
+ lines.push(` Purpose: ${declaration.purpose}`);
35
+ lines.push(' In scope:');
36
+ for (const entry of declaration.in_scope)
37
+ lines.push(` - ${entry.statement}`);
38
+ lines.push(' Out of scope:');
39
+ for (const entry of declaration.out_of_scope)
40
+ lines.push(` - ${entry.statement}`);
41
+ lines.push(` Refusal: ${declaration.refusal_pattern}`);
42
+ lines.push(` Redirect: ${declaration.redirect}`);
43
+ lines.push(` Review: ${formatReview(declaration)}`);
44
+ return lines;
45
+ }
46
+ /**
47
+ * Where the ethics review stands.
48
+ *
49
+ * A proposal says so: the declaration has not been through the maintainer
50
+ * review of §17.5, and a person reading it should know that.
51
+ */
52
+ function formatReview(declaration) {
53
+ if (isReviewed(declaration)) {
54
+ return `reviewed by ${declaration.review.reviewers.join(', ')}`;
55
+ }
56
+ const signed = declaration.review.reviewers.length;
57
+ return `proposed — ${signed} of ${REQUIRED_REVIEWERS} maintainers have reviewed it (§17.5)`;
58
+ }
59
+ /**
60
+ * The declarations, as they are read.
61
+ */
62
+ export function formatScope(report) {
63
+ if (report.declarations.length === 0) {
64
+ return [
65
+ `no scope declaration for ${report.unknownRole ?? 'that role'}`,
66
+ `the roles that have one: ${roleNames()}`,
67
+ '',
68
+ ].join('\n');
69
+ }
70
+ const lines = [];
71
+ report.declarations.forEach((declaration, index) => {
72
+ if (index > 0)
73
+ lines.push('');
74
+ lines.push(...formatDeclaration(declaration));
75
+ });
76
+ return `${lines.join('\n')}\n`;
77
+ }
78
+ //# sourceMappingURL=scope.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"scope.js","sourceRoot":"","sources":["../../src/commands/scope.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,UAAU,EACV,qBAAqB,EACrB,kBAAkB,EAElB,gBAAgB,GACjB,MAAM,mBAAmB,CAAC;AAyB3B,6DAA6D;AAC7D,SAAS,SAAS;IAChB,OAAO,qBAAqB,EAAE;SAC3B,GAAG,CAAC,CAAC,WAAW,EAAE,EAAE,CAAC,WAAW,CAAC,IAAI,CAAC;SACtC,IAAI,CAAC,IAAI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AAC,IAAI,CAAC,IAAI,CAAC;AACjC,CAAC"}
@@ -0,0 +1,2 @@
1
+ export {};
2
+ //# sourceMappingURL=scope.test.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"scope.test.d.ts","sourceRoot":"","sources":["../../src/commands/scope.test.ts"],"names":[],"mappings":""}