@mrciphersmith/keryx 0.2.34 → 0.2.35
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/dist/cli.js +170 -37
- package/docs/requirements/shared-agent-context/schemas/README.md +65 -0
- package/docs/requirements/shared-agent-context/schemas/access-receipt.schema.json +13 -0
- package/docs/requirements/shared-agent-context/schemas/fixtures/invalid-accepted-transition-failed-gate.json +1 -0
- package/docs/requirements/shared-agent-context/schemas/fixtures/invalid-accepted-transition-no-target-write.json +1 -0
- package/docs/requirements/shared-agent-context/schemas/fixtures/invalid-bound-work-no-flow-ref.json +1 -0
- package/docs/requirements/shared-agent-context/schemas/fixtures/invalid-duplicate-roles.json +1 -0
- package/docs/requirements/shared-agent-context/schemas/fixtures/invalid-evidence-missing-revision.json +1 -0
- package/docs/requirements/shared-agent-context/schemas/fixtures/invalid-proposal.json +1 -0
- package/docs/requirements/shared-agent-context/schemas/fixtures/invalid-resource-egress.json +1 -0
- package/docs/requirements/shared-agent-context/schemas/fixtures/invalid-spoofed-viewer-mutation.json +1 -0
- package/docs/requirements/shared-agent-context/schemas/fixtures/invalid-stale-evidence.json +1 -0
- package/docs/requirements/shared-agent-context/schemas/fixtures/invalid-time-order.json +1 -0
- package/docs/requirements/shared-agent-context/schemas/fixtures/invalid-unsafe-uri.json +1 -0
- package/docs/requirements/shared-agent-context/schemas/fixtures/invalid-workspace.json +1 -0
- package/docs/requirements/shared-agent-context/schemas/fixtures/replay-idempotency-corpus.json +1 -0
- package/docs/requirements/shared-agent-context/schemas/fixtures/valid-accepted-transition.json +1 -0
- package/docs/requirements/shared-agent-context/schemas/fixtures/valid-access-receipt.json +1 -0
- package/docs/requirements/shared-agent-context/schemas/fixtures/valid-fwk-receipt.json +1 -0
- package/docs/requirements/shared-agent-context/schemas/fixtures/valid-proposal.json +1 -0
- package/docs/requirements/shared-agent-context/schemas/fixtures/valid-review-decision.json +1 -0
- package/docs/requirements/shared-agent-context/schemas/fixtures/valid-workspace.json +1 -0
- package/docs/requirements/shared-agent-context/schemas/fwk-receipt.schema.json +28 -0
- package/docs/requirements/shared-agent-context/schemas/review-decision.schema.json +18 -0
- package/docs/requirements/shared-agent-context/schemas/workspace-manifest.schema.json +37 -0
- package/docs/requirements/shared-agent-context/schemas/workspace-proposal.schema.json +22 -0
- package/package.json +8 -2
package/dist/cli.js
CHANGED
|
@@ -34772,9 +34772,10 @@ function traceRefFor(traceId) {
|
|
|
34772
34772
|
}
|
|
34773
34773
|
|
|
34774
34774
|
// src/sac/index.ts
|
|
34775
|
-
import { readFile as readFile62, realpath as realpath3 } from "fs/promises";
|
|
34775
|
+
import { access as access3, readFile as readFile62, realpath as realpath3 } from "fs/promises";
|
|
34776
34776
|
import { createHash as createHash10 } from "crypto";
|
|
34777
34777
|
import path115 from "path";
|
|
34778
|
+
import { fileURLToPath as fileURLToPath6 } from "url";
|
|
34778
34779
|
var idPattern = /^[a-z][a-z0-9-]{2,63}$/;
|
|
34779
34780
|
var subjectPattern = /^(?:user|team|service|agent):[a-z0-9][a-z0-9._-]{0,127}$/;
|
|
34780
34781
|
var revisionPattern = /^[A-Za-z0-9][A-Za-z0-9._:-]{0,255}$/;
|
|
@@ -34791,6 +34792,28 @@ var normativeSchemaFiles = {
|
|
|
34791
34792
|
"review-decision": "review-decision.schema.json"
|
|
34792
34793
|
};
|
|
34793
34794
|
var normativeSchemas = new Map;
|
|
34795
|
+
var NORMATIVE_SCHEMA_DIR = path115.join("docs", "requirements", "shared-agent-context", "schemas");
|
|
34796
|
+
async function resolveSacNormativeSchemaPath(fileName, searchFrom = [fileURLToPath6(new URL(".", import.meta.url)), process.cwd()]) {
|
|
34797
|
+
const seen = new Set;
|
|
34798
|
+
for (const start of searchFrom) {
|
|
34799
|
+
let dir = path115.resolve(start);
|
|
34800
|
+
for (let i = 0;i < 10; i++) {
|
|
34801
|
+
if (seen.has(dir))
|
|
34802
|
+
break;
|
|
34803
|
+
seen.add(dir);
|
|
34804
|
+
const candidate = path115.join(dir, NORMATIVE_SCHEMA_DIR, fileName);
|
|
34805
|
+
try {
|
|
34806
|
+
await access3(candidate);
|
|
34807
|
+
return candidate;
|
|
34808
|
+
} catch {}
|
|
34809
|
+
const parent = path115.dirname(dir);
|
|
34810
|
+
if (parent === dir)
|
|
34811
|
+
break;
|
|
34812
|
+
dir = parent;
|
|
34813
|
+
}
|
|
34814
|
+
}
|
|
34815
|
+
throw new Error(`SAC normative schema not found: ${fileName}`);
|
|
34816
|
+
}
|
|
34794
34817
|
function parseStrictRfc3339Utc(value) {
|
|
34795
34818
|
if (typeof value !== "string")
|
|
34796
34819
|
return;
|
|
@@ -34829,7 +34852,7 @@ function isRecord2(value) {
|
|
|
34829
34852
|
async function loadNormativeSchema(schema) {
|
|
34830
34853
|
let pending = normativeSchemas.get(schema);
|
|
34831
34854
|
if (!pending) {
|
|
34832
|
-
pending =
|
|
34855
|
+
pending = resolveSacNormativeSchemaPath(normativeSchemaFiles[schema]).then((file) => readFile62(file, "utf8")).then((source) => JSON.parse(source));
|
|
34833
34856
|
normativeSchemas.set(schema, pending);
|
|
34834
34857
|
}
|
|
34835
34858
|
return pending;
|
|
@@ -44800,7 +44823,7 @@ var AGENT_SLASH_COMMANDS = [
|
|
|
44800
44823
|
modes: BOTH,
|
|
44801
44824
|
modeDescriptions: {
|
|
44802
44825
|
agent: "Connect to an already configured provider (interactive picker)",
|
|
44803
|
-
chat: "
|
|
44826
|
+
chat: "Switch to a connected provider (picker when available)"
|
|
44804
44827
|
}
|
|
44805
44828
|
},
|
|
44806
44829
|
{
|
|
@@ -45706,6 +45729,7 @@ function onKeypress2(r, handler) {
|
|
|
45706
45729
|
}
|
|
45707
45730
|
var COMPOSER_MIN_ROWS = 1;
|
|
45708
45731
|
var COMPOSER_MAX_ROWS = 6;
|
|
45732
|
+
var COMPOSER_BORDER_ROWS = 2;
|
|
45709
45733
|
var MENU_HEIGHT = 10;
|
|
45710
45734
|
var SIDEBAR_WIDTH = 30;
|
|
45711
45735
|
var SIDEBAR_BORDER_LEFT = 1;
|
|
@@ -45723,9 +45747,29 @@ ${result.installCommand.slice(split)}`);
|
|
|
45723
45747
|
var SPINNER = ["\u280B", "\u2819", "\u2839", "\u2838", "\u283C", "\u2834", "\u2826", "\u2827", "\u2807", "\u280F"];
|
|
45724
45748
|
var SPINNER_MS = 120;
|
|
45725
45749
|
var TOAST_MS = 5000;
|
|
45726
|
-
function composerHeightForLines(visualLines) {
|
|
45750
|
+
function composerHeightForLines(visualLines, maxRows = COMPOSER_MAX_ROWS) {
|
|
45751
|
+
const cap = Number.isFinite(maxRows) && maxRows >= COMPOSER_MIN_ROWS ? Math.floor(maxRows) : COMPOSER_MAX_ROWS;
|
|
45727
45752
|
const n = Number.isFinite(visualLines) ? Math.floor(visualLines) : COMPOSER_MIN_ROWS;
|
|
45728
|
-
return Math.min(
|
|
45753
|
+
return Math.min(cap, Math.max(COMPOSER_MIN_ROWS, n < 1 ? COMPOSER_MIN_ROWS : n));
|
|
45754
|
+
}
|
|
45755
|
+
function composerMaxRowsForViewport(viewportRows) {
|
|
45756
|
+
if (!Number.isFinite(viewportRows) || viewportRows < 1) {
|
|
45757
|
+
return COMPOSER_MAX_ROWS;
|
|
45758
|
+
}
|
|
45759
|
+
return Math.max(COMPOSER_MIN_ROWS, Math.floor(viewportRows / 3));
|
|
45760
|
+
}
|
|
45761
|
+
function wrappedLineCount(text, width) {
|
|
45762
|
+
const inner = Number.isFinite(width) ? Math.floor(width) : 0;
|
|
45763
|
+
const paragraphs = text.length === 0 ? [""] : text.split(`
|
|
45764
|
+
`);
|
|
45765
|
+
if (inner < 1) {
|
|
45766
|
+
return Math.max(COMPOSER_MIN_ROWS, paragraphs.length);
|
|
45767
|
+
}
|
|
45768
|
+
let total = 0;
|
|
45769
|
+
for (const paragraph of paragraphs) {
|
|
45770
|
+
total += Math.max(1, Math.ceil(Math.max(paragraph.length, 1) / inner));
|
|
45771
|
+
}
|
|
45772
|
+
return total;
|
|
45729
45773
|
}
|
|
45730
45774
|
function prefixFilter(commands, query) {
|
|
45731
45775
|
const q = query.trim().toLowerCase();
|
|
@@ -45903,6 +45947,9 @@ async function createShellChrome(otui, renderer, opts) {
|
|
|
45903
45947
|
const composer = new otui.BoxRenderable(r, {
|
|
45904
45948
|
id: "composer",
|
|
45905
45949
|
flexShrink: 0,
|
|
45950
|
+
minWidth: 0,
|
|
45951
|
+
width: "100%",
|
|
45952
|
+
flexDirection: "column",
|
|
45906
45953
|
borderStyle: "rounded",
|
|
45907
45954
|
border: true,
|
|
45908
45955
|
paddingLeft: 1,
|
|
@@ -45912,10 +45959,12 @@ async function createShellChrome(otui, renderer, opts) {
|
|
|
45912
45959
|
id: "prompt",
|
|
45913
45960
|
placeholder: opts.placeholder,
|
|
45914
45961
|
wrapMode: "word",
|
|
45962
|
+
minWidth: 0,
|
|
45963
|
+
width: "100%",
|
|
45915
45964
|
minHeight: COMPOSER_MIN_ROWS,
|
|
45916
|
-
maxHeight: COMPOSER_MAX_ROWS,
|
|
45917
45965
|
height: COMPOSER_MIN_ROWS,
|
|
45918
|
-
|
|
45966
|
+
flexShrink: 0,
|
|
45967
|
+
overflow: "scroll",
|
|
45919
45968
|
keyBindings: [
|
|
45920
45969
|
{ name: "return", action: "submit" },
|
|
45921
45970
|
{ name: "kpenter", action: "submit" },
|
|
@@ -45929,17 +45978,28 @@ async function createShellChrome(otui, renderer, opts) {
|
|
|
45929
45978
|
});
|
|
45930
45979
|
composer.add(textarea);
|
|
45931
45980
|
main.add(composer);
|
|
45981
|
+
const viewportRows = () => {
|
|
45982
|
+
const h = r.height;
|
|
45983
|
+
return typeof h === "number" && h > 0 ? h : COMPOSER_MAX_ROWS * 3;
|
|
45984
|
+
};
|
|
45932
45985
|
const syncComposerHeight = () => {
|
|
45986
|
+
const cap = composerMaxRowsForViewport(viewportRows());
|
|
45933
45987
|
let lines = 1;
|
|
45934
45988
|
try {
|
|
45935
|
-
|
|
45989
|
+
const wrapWidth = typeof textarea.width === "number" && textarea.width > 0 ? textarea.width : 0;
|
|
45990
|
+
lines = Math.max(textarea.virtualLineCount || 0, textarea.lineCount || 0, wrappedLineCount(textarea.plainText, wrapWidth), 1);
|
|
45936
45991
|
} catch {
|
|
45937
|
-
lines =
|
|
45992
|
+
lines = wrappedLineCount(textarea.plainText, 0);
|
|
45938
45993
|
}
|
|
45939
|
-
const h = composerHeightForLines(lines);
|
|
45994
|
+
const h = composerHeightForLines(lines, cap);
|
|
45940
45995
|
if (textarea.height !== h) {
|
|
45941
45996
|
textarea.height = h;
|
|
45942
45997
|
}
|
|
45998
|
+
const boxH = h + COMPOSER_BORDER_ROWS;
|
|
45999
|
+
if (composer.height !== boxH) {
|
|
46000
|
+
composer.height = boxH;
|
|
46001
|
+
}
|
|
46002
|
+
textarea.maxHeight = cap;
|
|
45943
46003
|
};
|
|
45944
46004
|
const input2 = {
|
|
45945
46005
|
get value() {
|
|
@@ -46067,6 +46127,10 @@ async function createShellChrome(otui, renderer, opts) {
|
|
|
46067
46127
|
syncComposerHeight();
|
|
46068
46128
|
refilter();
|
|
46069
46129
|
};
|
|
46130
|
+
const onComposerResized = () => {
|
|
46131
|
+
syncComposerHeight();
|
|
46132
|
+
};
|
|
46133
|
+
textarea.on(otui.LayoutEvents.RESIZED, onComposerResized);
|
|
46070
46134
|
textarea.focus();
|
|
46071
46135
|
syncComposerHeight();
|
|
46072
46136
|
const submitHandlers = new Set;
|
|
@@ -46167,6 +46231,9 @@ async function createShellChrome(otui, renderer, opts) {
|
|
|
46167
46231
|
clearBusyTimer();
|
|
46168
46232
|
clearToastTimer();
|
|
46169
46233
|
unsubscribeMenuKeys();
|
|
46234
|
+
try {
|
|
46235
|
+
textarea.off(otui.LayoutEvents.RESIZED, onComposerResized);
|
|
46236
|
+
} catch {}
|
|
46170
46237
|
try {
|
|
46171
46238
|
r.off(otui.CliRenderEvents.SELECTION, onSelection);
|
|
46172
46239
|
} catch {}
|
|
@@ -47266,12 +47333,8 @@ async function filterConnectedDetectedProviders(detected, options = {}) {
|
|
|
47266
47333
|
}
|
|
47267
47334
|
const requiresApiKey = registry.requiresApiKey ?? true;
|
|
47268
47335
|
const envKey = prov.envKey ?? registry.envKey;
|
|
47269
|
-
|
|
47270
|
-
|
|
47271
|
-
continue;
|
|
47272
|
-
}
|
|
47273
|
-
const raw = env[envKey];
|
|
47274
|
-
if (raw === undefined || raw.length === 0) {
|
|
47336
|
+
const raw = envKey !== undefined ? env[envKey] : undefined;
|
|
47337
|
+
if (requiresApiKey && (raw === undefined || raw.length === 0)) {
|
|
47275
47338
|
continue;
|
|
47276
47339
|
}
|
|
47277
47340
|
const compat = {
|
|
@@ -47280,13 +47343,13 @@ async function filterConnectedDetectedProviders(detected, options = {}) {
|
|
|
47280
47343
|
...prov.chatPath !== undefined ? { chatPath: prov.chatPath } : {},
|
|
47281
47344
|
...prov.modelsPath !== undefined ? { modelsPath: prov.modelsPath } : {}
|
|
47282
47345
|
};
|
|
47283
|
-
const result = await fetchOpenAiCompatModelsDetailed(fetchFn, compat, raw, {
|
|
47346
|
+
const result = await fetchOpenAiCompatModelsDetailed(fetchFn, compat, raw ?? "", {
|
|
47284
47347
|
timeoutMs: MODELS_FETCH_TIMEOUT_MS
|
|
47285
47348
|
});
|
|
47286
47349
|
if (result.source !== "live" || result.models.length === 0) {
|
|
47287
47350
|
continue;
|
|
47288
47351
|
}
|
|
47289
|
-
connected.push(prov);
|
|
47352
|
+
connected.push({ ...prov, models: result.models });
|
|
47290
47353
|
}
|
|
47291
47354
|
return connected;
|
|
47292
47355
|
}
|
|
@@ -47693,11 +47756,11 @@ function selectProviderModelInTui(otui, r, detected, options = {}) {
|
|
|
47693
47756
|
resolve3(undefined);
|
|
47694
47757
|
return;
|
|
47695
47758
|
}
|
|
47696
|
-
const selectedBaseUrl = prov.baseUrl
|
|
47697
|
-
if (prov.baseUrl !== undefined && selectedBaseUrl === undefined) {
|
|
47759
|
+
const selectedBaseUrl = options.onlyConnected || prov.baseUrl === undefined ? prov.baseUrl : await promptBaseUrlStep(otui, r, prov.label ?? prov.name, prov.baseUrl);
|
|
47760
|
+
if (!options.onlyConnected && prov.baseUrl !== undefined && selectedBaseUrl === undefined) {
|
|
47698
47761
|
continue;
|
|
47699
47762
|
}
|
|
47700
|
-
if (selectedBaseUrl !== undefined)
|
|
47763
|
+
if (!options.onlyConnected && selectedBaseUrl !== undefined)
|
|
47701
47764
|
saveProviderBaseUrl(prov.name, selectedBaseUrl);
|
|
47702
47765
|
const selectedProvider = selectedBaseUrl === undefined ? prov : { ...prov, baseUrl: selectedBaseUrl };
|
|
47703
47766
|
const envKey = prov.envKey;
|
|
@@ -49315,6 +49378,12 @@ async function launchTuiChatShell(opts) {
|
|
|
49315
49378
|
runShell: opts.runShell,
|
|
49316
49379
|
pickSelection: async (pickOpts) => {
|
|
49317
49380
|
const detected = opts.redetect !== undefined ? await opts.redetect() : opts.detected;
|
|
49381
|
+
if (pickOpts?.onlyConnected === true) {
|
|
49382
|
+
return await selectProviderModelInTui(otui, r, detected, {
|
|
49383
|
+
onlyConnected: true,
|
|
49384
|
+
env: process.env
|
|
49385
|
+
});
|
|
49386
|
+
}
|
|
49318
49387
|
const only = pickOpts?.onlyProvider;
|
|
49319
49388
|
if (only === undefined) {
|
|
49320
49389
|
return await selectProviderModelInTui(otui, r, detected);
|
|
@@ -49347,7 +49416,7 @@ init_shell_config();
|
|
|
49347
49416
|
// package.json
|
|
49348
49417
|
var package_default = {
|
|
49349
49418
|
name: "@mrciphersmith/keryx",
|
|
49350
|
-
version: "0.2.
|
|
49419
|
+
version: "0.2.35",
|
|
49351
49420
|
description: "Version-controlled project context for AI coding agents: code graph, architecture wiki, project memory, relevant tests, quality signals, and task flows.",
|
|
49352
49421
|
private: false,
|
|
49353
49422
|
publishConfig: {
|
|
@@ -49392,6 +49461,7 @@ var package_default = {
|
|
|
49392
49461
|
},
|
|
49393
49462
|
files: [
|
|
49394
49463
|
"dist",
|
|
49464
|
+
"docs/requirements/shared-agent-context/schemas",
|
|
49395
49465
|
"src/gdgraph",
|
|
49396
49466
|
"src/gdskills/bundled",
|
|
49397
49467
|
"src/gdskills/contracts",
|
|
@@ -49407,12 +49477,17 @@ var package_default = {
|
|
|
49407
49477
|
},
|
|
49408
49478
|
devDependencies: {
|
|
49409
49479
|
"@types/bun": "latest",
|
|
49480
|
+
"@xenova/transformers": "^2.17.2",
|
|
49410
49481
|
"bun-types": "latest",
|
|
49411
49482
|
typescript: "^5"
|
|
49412
49483
|
},
|
|
49413
49484
|
engines: {
|
|
49414
49485
|
bun: ">=1.1.0"
|
|
49415
|
-
}
|
|
49486
|
+
},
|
|
49487
|
+
trustedDependencies: [
|
|
49488
|
+
"protobufjs",
|
|
49489
|
+
"sharp"
|
|
49490
|
+
]
|
|
49416
49491
|
};
|
|
49417
49492
|
|
|
49418
49493
|
// src/commands/select.ts
|
|
@@ -49809,7 +49884,12 @@ Starting a new session.
|
|
|
49809
49884
|
continue;
|
|
49810
49885
|
}
|
|
49811
49886
|
if (command === "/connect") {
|
|
49812
|
-
|
|
49887
|
+
if (deps.selectProviderModel === undefined) {
|
|
49888
|
+
system(CONNECT_GUIDANCE);
|
|
49889
|
+
continue;
|
|
49890
|
+
}
|
|
49891
|
+
const picked = await deps.selectProviderModel(io, { onlyConnected: true });
|
|
49892
|
+
applySelection(picked);
|
|
49813
49893
|
continue;
|
|
49814
49894
|
}
|
|
49815
49895
|
const wrongMode = describeUnavailableCommand(command, "chat");
|
|
@@ -53020,9 +53100,9 @@ function printHelp17() {
|
|
|
53020
53100
|
// src/commands/update.ts
|
|
53021
53101
|
import { spawn as spawn5 } from "child_process";
|
|
53022
53102
|
import { chmod as chmod4, mkdir as mkdir52, readFile as readFile75, readdir as readdir22, writeFile as writeFile47 } from "fs/promises";
|
|
53023
|
-
import { access as
|
|
53103
|
+
import { access as access4, constants as constants2, existsSync as existsSync29 } from "fs";
|
|
53024
53104
|
import path141 from "path";
|
|
53025
|
-
import { fileURLToPath as
|
|
53105
|
+
import { fileURLToPath as fileURLToPath7 } from "url";
|
|
53026
53106
|
init_config();
|
|
53027
53107
|
init_config2();
|
|
53028
53108
|
init_templates2();
|
|
@@ -54118,7 +54198,7 @@ async function runPostUpdateHooks(projectRoot) {
|
|
|
54118
54198
|
}
|
|
54119
54199
|
async function accessExecutable(filePath) {
|
|
54120
54200
|
await new Promise((resolve3, reject) => {
|
|
54121
|
-
|
|
54201
|
+
access4(filePath, constants2.X_OK, (error2) => {
|
|
54122
54202
|
if (error2) {
|
|
54123
54203
|
reject(error2);
|
|
54124
54204
|
return;
|
|
@@ -54166,12 +54246,12 @@ async function copyFileIfChanged2(from, to) {
|
|
|
54166
54246
|
await writeFile47(to, next, "utf8");
|
|
54167
54247
|
}
|
|
54168
54248
|
function runtimeSourcePath2(relativePath) {
|
|
54169
|
-
const directPath =
|
|
54249
|
+
const directPath = fileURLToPath7(new URL(relativePath, import.meta.url));
|
|
54170
54250
|
if (existsSync29(directPath)) {
|
|
54171
54251
|
return directPath;
|
|
54172
54252
|
}
|
|
54173
54253
|
if (relativePath.startsWith("../")) {
|
|
54174
|
-
const packagedSourcePath = path141.join(path141.dirname(
|
|
54254
|
+
const packagedSourcePath = path141.join(path141.dirname(fileURLToPath7(import.meta.url)), "..", "src", relativePath.slice(3));
|
|
54175
54255
|
if (existsSync29(packagedSourcePath)) {
|
|
54176
54256
|
return packagedSourcePath;
|
|
54177
54257
|
}
|
|
@@ -56564,6 +56644,53 @@ async function versionCommand(args2, deps = {}) {
|
|
|
56564
56644
|
init_args();
|
|
56565
56645
|
import { randomUUID as randomUUID21 } from "crypto";
|
|
56566
56646
|
import { writeFile as writeFile50 } from "fs/promises";
|
|
56647
|
+
|
|
56648
|
+
// src/sac/fwk-explain.ts
|
|
56649
|
+
function isOverflow(result) {
|
|
56650
|
+
return "code" in result;
|
|
56651
|
+
}
|
|
56652
|
+
function formatFwkExplain(result) {
|
|
56653
|
+
if (isOverflow(result)) {
|
|
56654
|
+
return [`SAC explain: context_overflow (${result.code})`, "No successful manifest/receipt. Shrink the scope or raise the budget."].join(`
|
|
56655
|
+
`);
|
|
56656
|
+
}
|
|
56657
|
+
const facts = Array.isArray(result.manifest.facts) ? result.manifest.facts : [];
|
|
56658
|
+
const knowHow = Array.isArray(result.manifest.knowHow) ? result.manifest.knowHow : [];
|
|
56659
|
+
const work = result.manifest.work;
|
|
56660
|
+
const byKind = { wiki: 0, memory: 0, skill: 0, other: 0 };
|
|
56661
|
+
const knowHowLines = knowHow.map((item) => {
|
|
56662
|
+
const row = item;
|
|
56663
|
+
const kind = row.kind === "wiki" || row.kind === "memory" || row.kind === "skill" ? row.kind : "other";
|
|
56664
|
+
byKind[kind] += 1;
|
|
56665
|
+
return ` - ${kind} ${row.uri ?? "?"} revision=${row.revision ?? "?"} status=${row.status ?? "?"}`;
|
|
56666
|
+
});
|
|
56667
|
+
const workState = work?.state ?? "unbound";
|
|
56668
|
+
const lines = [
|
|
56669
|
+
"SAC explain (FWK \u2014 Facts / Work / Know-how)",
|
|
56670
|
+
` freshness: ${result.manifest.freshness}`,
|
|
56671
|
+
` receipt: ${result.receipt.id} decision=${result.receipt.decision}`,
|
|
56672
|
+
` Facts (${facts.length}) \u2014 evidence-linked, task-local; not durable knowledge`,
|
|
56673
|
+
...facts.map((fact) => {
|
|
56674
|
+
const row = fact;
|
|
56675
|
+
const ev = row.evidence?.[0];
|
|
56676
|
+
return ` - ${row.statement ?? "(no statement)"} uri=${ev?.uri ?? "?"} revision=${ev?.revision ?? "?"} freshness=${row.freshness ?? "?"}`;
|
|
56677
|
+
}),
|
|
56678
|
+
` Work (${workState}) \u2014 Flow projection only; SAC does not write flow.json`,
|
|
56679
|
+
...workState === "bound" ? [
|
|
56680
|
+
` - flow=${work?.flowRef?.uri ?? "?"} snapshot=${work?.flowRef?.snapshot ?? "?"} revision=${work?.flowRef?.revision ?? "?"}`,
|
|
56681
|
+
` - completed=${(work?.completed ?? []).join(",") || "(none)"} next=${(work?.next ?? []).join(",") || "(none)"} blocked=${(work?.blocked ?? []).join(",") || "(none)"}`
|
|
56682
|
+
] : [" - no flow resource bound on this workspace"],
|
|
56683
|
+
` Know-how (${knowHow.length}: wiki=${byKind.wiki} memory=${byKind.memory} skill=${byKind.skill}) \u2014 references to owning stores, not SAC copies`,
|
|
56684
|
+
...knowHowLines.length > 0 ? knowHowLines : [" - (none accepted/visible in this budget)"],
|
|
56685
|
+
" Not written here: graph nodes/edges (navigation only), session transcripts, hidden reasoning."
|
|
56686
|
+
];
|
|
56687
|
+
if (result.partial)
|
|
56688
|
+
lines.push(` partial: omitted optional ${result.omittedOptional.join(", ") || "(none)"}`);
|
|
56689
|
+
return lines.join(`
|
|
56690
|
+
`);
|
|
56691
|
+
}
|
|
56692
|
+
|
|
56693
|
+
// src/commands/workspace.ts
|
|
56567
56694
|
var PROPOSAL_KINDS = ["decision", "wiki-update", "memory-entry", "follow-up", "contract-change", "risk"];
|
|
56568
56695
|
function service4() {
|
|
56569
56696
|
return new WorkspaceService({
|
|
@@ -56612,30 +56739,36 @@ async function workspaceCommand(args2) {
|
|
|
56612
56739
|
return;
|
|
56613
56740
|
}
|
|
56614
56741
|
if (subcommand === "overview") {
|
|
56615
|
-
rejectUnknownOptions(args2.slice(2), new Set(["--max-items", "--max-tokens"]));
|
|
56742
|
+
rejectUnknownOptions(args2.slice(2), new Set(["--max-items", "--max-tokens", "--explain"]));
|
|
56616
56743
|
const workspaceId = args2[1];
|
|
56617
56744
|
if (!workspaceId)
|
|
56618
|
-
throw new Error("Usage: keryx workspace overview <workspace-id> [--max-items N] [--max-tokens N]");
|
|
56745
|
+
throw new Error("Usage: keryx workspace overview <workspace-id> [--max-items N] [--max-tokens N] [--explain]");
|
|
56619
56746
|
const maxItems = Number(optionValue(args2, "--max-items") ?? "32");
|
|
56620
56747
|
const maxTokens = Number(optionValue(args2, "--max-tokens") ?? "4096");
|
|
56621
56748
|
if (!Number.isInteger(maxItems) || !Number.isInteger(maxTokens) || maxItems < 0 || maxTokens < 0)
|
|
56622
56749
|
throw new Error("--max-items and --max-tokens must be non-negative integers");
|
|
56623
56750
|
const result = await createLocalFwkReadService(process.cwd()).overview({ workspaceId, request: undefined, requestCorrelationId: randomUUID21(), budget: { maxItems, maxTokens } });
|
|
56624
|
-
|
|
56751
|
+
const normalized = normalizeFwkResult(result);
|
|
56752
|
+
console.log(JSON.stringify(normalized, null, 2));
|
|
56753
|
+
if (args2.includes("--explain"))
|
|
56754
|
+
console.error(formatFwkExplain(normalized));
|
|
56625
56755
|
return;
|
|
56626
56756
|
}
|
|
56627
56757
|
if (subcommand === "read") {
|
|
56628
|
-
rejectUnknownOptions(args2.slice(3), new Set(["--max-items", "--max-tokens"]));
|
|
56758
|
+
rejectUnknownOptions(args2.slice(3), new Set(["--max-items", "--max-tokens", "--explain"]));
|
|
56629
56759
|
const workspaceId = args2[1];
|
|
56630
56760
|
const itemId = args2[2];
|
|
56631
56761
|
if (!workspaceId || !itemId)
|
|
56632
|
-
throw new Error("Usage: keryx workspace read <workspace-id> <item-id> [--max-items N] [--max-tokens N]");
|
|
56762
|
+
throw new Error("Usage: keryx workspace read <workspace-id> <item-id> [--max-items N] [--max-tokens N] [--explain]");
|
|
56633
56763
|
const maxItems = Number(optionValue(args2, "--max-items") ?? "1");
|
|
56634
56764
|
const maxTokens = Number(optionValue(args2, "--max-tokens") ?? "4096");
|
|
56635
56765
|
if (!Number.isInteger(maxItems) || !Number.isInteger(maxTokens) || maxItems < 0 || maxTokens < 0)
|
|
56636
56766
|
throw new Error("--max-items and --max-tokens must be non-negative integers");
|
|
56637
56767
|
const result = await createLocalFwkReadService(process.cwd()).read({ workspaceId, itemId, request: undefined, requestCorrelationId: randomUUID21(), budget: { maxItems, maxTokens } });
|
|
56638
|
-
|
|
56768
|
+
const normalized = normalizeFwkResult(result);
|
|
56769
|
+
console.log(JSON.stringify(normalized, null, 2));
|
|
56770
|
+
if (args2.includes("--explain"))
|
|
56771
|
+
console.error(formatFwkExplain(normalized));
|
|
56639
56772
|
return;
|
|
56640
56773
|
}
|
|
56641
56774
|
if (subcommand === "propose") {
|
|
@@ -56714,8 +56847,8 @@ function printHelp20() {
|
|
|
56714
56847
|
keryx workspace list
|
|
56715
56848
|
keryx workspace show <workspace-id>
|
|
56716
56849
|
keryx workspace add-resource <workspace-id> --kind <kind> --uri <workspace-relative-ref> [--revision <revision>]
|
|
56717
|
-
keryx workspace overview <workspace-id> [--max-items N] [--max-tokens N]
|
|
56718
|
-
keryx workspace read <workspace-id> <item-id> [--max-items N] [--max-tokens N]
|
|
56850
|
+
keryx workspace overview <workspace-id> [--max-items N] [--max-tokens N] [--explain]
|
|
56851
|
+
keryx workspace read <workspace-id> <item-id> [--max-items N] [--max-tokens N] [--explain]
|
|
56719
56852
|
keryx workspace propose <workspace-id> --kind <` + PROPOSAL_KINDS.join("|") + `> --session <session-id> [--note <one-line note>]
|
|
56720
56853
|
keryx workspace review <workspace-id> <proposal-id> --decision <accepted|rejected|dismissed> [--reason <reason>] [--idempotency-key <key>]
|
|
56721
56854
|
keryx workspace collaboration <workspace-id>
|
|
@@ -0,0 +1,65 @@
|
|
|
1
|
+
# Shared Agent Context — Schemas and Fixtures
|
|
2
|
+
Version: 1.4.0
|
|
3
|
+
|
|
4
|
+
## Purpose
|
|
5
|
+
|
|
6
|
+
These are the normative data contracts used by the implemented SAC phases.
|
|
7
|
+
They use JSON Schema Draft 2020-12. Fixtures define the minimum validator and
|
|
8
|
+
integration-test corpus. The
|
|
9
|
+
implementation must enable format assertion and run the semantic validator for
|
|
10
|
+
the declared `x-` invariants: canonical SubjectId topology, realpath/root
|
|
11
|
+
containment, timestamp ordering and ledger-level idempotency.
|
|
12
|
+
|
|
13
|
+
## Schemas
|
|
14
|
+
|
|
15
|
+
- [Workspace manifest](workspace-manifest.schema.json)
|
|
16
|
+
- [FWK receipt](fwk-receipt.schema.json)
|
|
17
|
+
- [Access receipt](access-receipt.schema.json)
|
|
18
|
+
- [Workspace proposal](workspace-proposal.schema.json)
|
|
19
|
+
- [Review decision](review-decision.schema.json)
|
|
20
|
+
|
|
21
|
+
## Fixtures
|
|
22
|
+
|
|
23
|
+
- [Valid workspace](fixtures/valid-workspace.json)
|
|
24
|
+
- [Invalid workspace](fixtures/invalid-workspace.json)
|
|
25
|
+
- [Valid FWK receipt](fixtures/valid-fwk-receipt.json)
|
|
26
|
+
- [Invalid evidence without revision](fixtures/invalid-evidence-missing-revision.json)
|
|
27
|
+
- [Invalid bound Work without Flow reference](fixtures/invalid-bound-work-no-flow-ref.json)
|
|
28
|
+
- [Valid proposal](fixtures/valid-proposal.json)
|
|
29
|
+
- [Invalid proposal](fixtures/invalid-proposal.json)
|
|
30
|
+
- [Valid accepted transition](fixtures/valid-accepted-transition.json)
|
|
31
|
+
- [Accepted transition with failed security gate](fixtures/invalid-accepted-transition-failed-gate.json)
|
|
32
|
+
- [Accepted transition without target write](fixtures/invalid-accepted-transition-no-target-write.json)
|
|
33
|
+
- [Valid review decision](fixtures/valid-review-decision.json)
|
|
34
|
+
- [Valid access receipt](fixtures/valid-access-receipt.json)
|
|
35
|
+
- [Invalid duplicate roles](fixtures/invalid-duplicate-roles.json)
|
|
36
|
+
- [Invalid unsafe URI](fixtures/invalid-unsafe-uri.json)
|
|
37
|
+
- [Invalid timestamp order](fixtures/invalid-time-order.json)
|
|
38
|
+
- [Invalid stale evidence](fixtures/invalid-stale-evidence.json)
|
|
39
|
+
- [Spoofed viewer mutation](fixtures/invalid-spoofed-viewer-mutation.json)
|
|
40
|
+
- [Denied resource egress](fixtures/invalid-resource-egress.json)
|
|
41
|
+
- [Replay/idempotency corpus](fixtures/replay-idempotency-corpus.json)
|
|
42
|
+
|
|
43
|
+
Positive fixtures must validate against their named schema. Negative fixtures
|
|
44
|
+
must fail for the documented contract reason. The replay corpus is evaluated by
|
|
45
|
+
the append-only ledger validator, not by an isolated JSON document. All schemas
|
|
46
|
+
forbid raw transcript, prompt, hidden-reasoning and secret payload fields by
|
|
47
|
+
using closed objects.
|
|
48
|
+
|
|
49
|
+
Phase 5 publishes its minimized learning/evaluation fixtures separately under
|
|
50
|
+
[`fixtures/sac-policy-experiment`](../../../../fixtures/sac-policy-experiment/).
|
|
51
|
+
The manifest is a closed TypeScript/runtime contract rather than an extension
|
|
52
|
+
of AccessReceipt: it records receipt-chain provenance, independent verifier
|
|
53
|
+
artifact hashes, selection/redaction/quarantine rules and deterministic
|
|
54
|
+
train/holdout/adversarial splits. Receipt self-report is never ground truth.
|
|
55
|
+
|
|
56
|
+
`workspace-proposal` creation also requires minimal `wrapUp` metadata. It is
|
|
57
|
+
only an audit pointer: runtime authorization requires the corresponding
|
|
58
|
+
server-issued, one-time trusted provenance capability bound to its session or
|
|
59
|
+
read-only Flow wrap-up source, actor, workspace, evidence and expiry.
|
|
60
|
+
|
|
61
|
+
For an accepted transition, `acceptance.targetWrite.binding` is normative and
|
|
62
|
+
retains the exact immutable owner receipt binding. It must repeat the proposal,
|
|
63
|
+
workspace, correlation/idempotency, reviewer-authority and policy-revision
|
|
64
|
+
values of that transition; implementations must not reduce it to a hash after
|
|
65
|
+
verification.
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
{
|
|
2
|
+
"$schema": "https://json-schema.org/draft/2020-12/schema",
|
|
3
|
+
"$id": "keryx/shared-agent-context/access-receipt/v1",
|
|
4
|
+
"$vocabulary": {"https://json-schema.org/draft/2020-12/vocab/format-assertion": true},
|
|
5
|
+
"type": "object",
|
|
6
|
+
"additionalProperties": false,
|
|
7
|
+
"required": ["schemaVersion", "id", "workspaceId", "actor", "action", "decision", "recordedAt", "cost", "contextAssembly", "policy", "integrity"],
|
|
8
|
+
"properties": {
|
|
9
|
+
"schemaVersion": {"const": "1.0"}, "id": {"type": "string", "pattern": "^[a-z][a-z0-9-]{2,63}$"}, "workspaceId": {"type": "string", "pattern": "^[a-z][a-z0-9-]{2,63}$"}, "actor": {"type": "string", "pattern": "^(?:user|team|service|agent):[a-z0-9][a-z0-9._-]{0,127}$"}, "action": {"enum": ["overview", "fwk", "resource"]}, "decision": {"enum": ["allowed", "denied", "budget-exhausted", "stale"]}, "recordedAt": {"$ref": "#/$defs/utcTimestamp"}, "cost": {"type": "object", "additionalProperties": false, "required": ["toolCalls", "elapsedMs"], "properties": {"tokens": {"type": "integer", "minimum": 0}, "toolCalls": {"type": "integer", "minimum": 0}, "elapsedMs": {"type": "integer", "minimum": 0}}}, "contextAssembly": {"type": "object", "additionalProperties": false, "required": ["traceRef", "configurationRevision", "selected", "omittedOptional"], "properties": {"traceRef": {"$ref": "#/$defs/workspacePath"}, "configurationRevision": {"$ref": "#/$defs/revision"}, "selected": {"type": "array", "items": {"$ref": "#/$defs/workspacePath"}}, "omittedOptional": {"type": "array", "items": {"$ref": "#/$defs/workspacePath"}}}}, "policy": {"type": "object", "additionalProperties": false, "required": ["ref", "revision"], "properties": {"ref": {"$ref": "#/$defs/workspacePath"}, "revision": {"$ref": "#/$defs/revision"}}}, "integrity": {"type": "object", "additionalProperties": false, "required": ["recordHash", "previousRecordHash"], "properties": {"recordHash": {"type": "string", "pattern": "^[a-f0-9]{64}$"}, "previousRecordHash": {"type": "string", "pattern": "^(?:[a-f0-9]{64}|GENESIS)$"}}}, "resourceRef": {"$ref": "#/$defs/workspacePath"}, "outcome": {"enum": ["unknown", "useful", "not-useful"]}},
|
|
10
|
+
"allOf": [{"if": {"properties": {"action": {"const": "resource"}}, "required": ["action"]}, "then": {"required": ["resourceRef"]}, "else": {"not": {"required": ["resourceRef"]}}}],
|
|
11
|
+
"x-rootContainment": {"fields": ["resourceRef", "contextAssembly.traceRef", "contextAssembly.selected[]", "contextAssembly.omittedOptional[]", "policy.ref"], "root": "workspace root", "resolveSymlinks": true, "rejectEscapes": true}, "x-integrity": {"appendOnlyLedger": true, "verifyRecordHash": true, "owner": "trusted local service"},
|
|
12
|
+
"$defs": {"utcTimestamp": {"type": "string", "format": "date-time", "pattern": "^[0-9]{4}-[0-9]{2}-[0-9]{2}T[0-9]{2}:[0-9]{2}:[0-9]{2}(?:\\.[0-9]+)?Z$", "x-formatAssertionRequired": true}, "revision": {"type": "string", "minLength": 1, "maxLength": 256, "pattern": "^[A-Za-z0-9][A-Za-z0-9._:-]{0,255}$", "x-immutable": true}, "workspacePath": {"type": "string", "pattern": "^\\./(?!.*(?:^|/)\\.\\.(?:/|$))(?:[A-Za-z0-9._-]+/)*[A-Za-z0-9._-]+$"}}
|
|
13
|
+
}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"schemaVersion":"1.0","recordType":"proposal-transition","eventId":"event-accepted-1","proposalId":"proposal-1","proposalRevision":"1","correlationId":"proposal-correlation-0001","workspaceId":"payments-work","sequence":1,"priorEventHash":"aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa","fromStatus":"proposed","toStatus":"accepted","occurredAt":"2026-08-11T00:10:00Z","idempotencyKey":"accepted-transition-0001","acceptance":{"reviewDecisionRef":"./reviews/decision-1","writeIntentRef":"./proposals/proposal-1.intent-1","reviewer":{"subject":"user:reviewer","authority":"owner","trustedPrincipalRef":"./identity/principal-1"},"security":{"gate":"fail","policyRef":"./policies/default","policyRevision":"1"},"freshness":{"state":"fresh","verifiedAt":"2026-08-11T00:05:00Z","maxEvidenceAgeSeconds":3600},"targetWrite":{"receiptRef":"./writes/receipt-1","targetRef":"./memory/constraint","completedAt":"2026-08-11T00:06:00Z"},"evidence":[{"kind":"memory","uri":"./memory/constraint","revision":"1","observedAt":"2026-08-11T00:00:00Z"}],"idempotencyKey":"accepted-transition-0001"}}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"schemaVersion":"1.0","recordType":"proposal-transition","eventId":"event-accepted-1","proposalId":"proposal-1","proposalRevision":"1","correlationId":"proposal-correlation-0001","workspaceId":"payments-work","sequence":1,"priorEventHash":"aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa","fromStatus":"proposed","toStatus":"accepted","occurredAt":"2026-08-11T00:10:00Z","idempotencyKey":"accepted-transition-0001","acceptance":{"reviewDecisionRef":"./reviews/decision-1","reviewer":{"subject":"user:reviewer","authority":"owner","trustedPrincipalRef":"./identity/principal-1"},"security":{"gate":"pass","policyRef":"./policies/default","policyRevision":"1"},"freshness":{"state":"fresh","verifiedAt":"2026-08-11T00:05:00Z","maxEvidenceAgeSeconds":3600},"evidence":[{"kind":"memory","uri":"./memory/constraint","revision":"1","observedAt":"2026-08-11T00:00:00Z"}],"idempotencyKey":"accepted-transition-0001"}}
|
package/docs/requirements/shared-agent-context/schemas/fixtures/invalid-bound-work-no-flow-ref.json
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"schemaVersion":"1.0","workspaceId":"payments-work","generatedAt":"2026-08-11T00:00:00Z","facts":[],"work":{"state":"bound","completed":["task-1"]},"knowHow":[],"freshness":"fresh"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"schemaVersion":"1.0","id":"payments-work","title":"Payments work","status":"active","members":[{"subject":"team:payments","role":"owner"},{"subject":"team:payments","role":"editor"}],"resources":[],"createdAt":"2026-08-11T00:00:00Z","updatedAt":"2026-08-11T00:00:00Z"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"schemaVersion":"1.0","workspaceId":"payments-work","generatedAt":"2026-08-11T00:00:00Z","facts":[{"statement":"Flow is ready","evidence":[{"kind":"flow","uri":"./.metaproject/flows/001","observedAt":"2026-08-11T00:00:00Z","trust":"primary"}],"observedAt":"2026-08-11T00:00:00Z","expiresAt":"2026-08-12T00:00:00Z","freshness":"fresh"}],"work":{"state":"unbound"},"knowHow":[],"freshness":"fresh"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"schemaVersion":"1.0","recordType":"proposal-created","id":"proposal-1","proposalRevision":"1","correlationId":"proposal-correlation-0001","workspaceId":"payments-work","kind":"memory-entry","status":"accepted","summary":"redacted summary","evidence":[{"kind":"memory","uri":"./memory/constraint","revision":"1","observedAt":"2026-08-11T00:00:00Z"}],"author":"agent:writer","security":{"gate":"pass","redacted":true,"policyRef":"./policies/default","policyRevision":"1"},"createdAt":"2026-08-11T00:00:00Z"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"schemaVersion":"1.0","id":"access-1","workspaceId":"payments-work","actor":"agent:release-bot","action":"resource","decision":"allowed","recordedAt":"2026-08-11T00:05:00Z","cost":{"toolCalls":1,"elapsedMs":12},"contextAssembly":{"traceRef":"./context/trace-1","configurationRevision":"1","selected":["./src/payments"],"omittedOptional":[]},"policy":{"ref":"./policies/default","revision":"1"},"integrity":{"recordHash":"aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa","previousRecordHash":"GENESIS"},"resourceRef":"https://outside.invalid/resource"}
|
package/docs/requirements/shared-agent-context/schemas/fixtures/invalid-spoofed-viewer-mutation.json
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"schemaVersion":"1.0","id":"decision-1","proposalId":"proposal-1","proposalRevision":"1","correlationId":"proposal-correlation-0001","workspaceId":"payments-work","decision":"accepted","reviewer":{"subject":"user:viewer","authority":"viewer","trustedPrincipalRef":"./identity/principal-1"},"decidedAt":"2026-08-11T00:05:00Z","idempotencyKey":"review-decision-0001","security":{"gate":"pass","policyRef":"./policies/default","policyRevision":"1"},"freshness":{"state":"fresh","verifiedAt":"2026-08-11T00:05:00Z","evidenceRevision":"1"},"targetWrite":{"receiptRef":"./writes/receipt-1","targetRef":"./memory/constraint","completedAt":"2026-08-11T00:06:00Z"}}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"schemaVersion":"1.0","id":"decision-1","proposalId":"proposal-1","proposalRevision":"1","correlationId":"proposal-correlation-0001","workspaceId":"payments-work","decision":"accepted","reviewer":{"subject":"user:reviewer","authority":"owner","trustedPrincipalRef":"./identity/principal-1"},"decidedAt":"2026-08-11T00:05:00Z","idempotencyKey":"review-decision-0001","security":{"gate":"pass","policyRef":"./policies/default","policyRevision":"1"},"freshness":{"state":"stale","verifiedAt":"2026-08-11T00:05:00Z","evidenceRevision":"1"},"targetWrite":{"receiptRef":"./writes/receipt-1","targetRef":"./memory/constraint","completedAt":"2026-08-11T00:06:00Z"}}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"schemaVersion":"1.0","id":"payments-work","title":"Payments work","status":"active","members":[{"subject":"team:payments","role":"owner"}],"resources":[],"createdAt":"2026-08-12T00:00:00Z","updatedAt":"2026-08-11T00:00:00Z"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"schemaVersion":"1.0","id":"payments-work","title":"Payments work","status":"active","members":[{"subject":"team:payments","role":"owner"}],"resources":[{"kind":"component","uri":"https://outside.invalid/resource"}],"createdAt":"2026-08-11T00:00:00Z","updatedAt":"2026-08-11T00:00:00Z"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"schemaVersion":"1.0","id":"payments-work","title":"Payments work","status":"active","members":[{"subject":"team:payments","role":"owner"}],"resources":[{"kind":"component","uri":"src/no-prefix"}],"createdAt":"2026-08-11T00:00:00Z","updatedAt":"2026-08-11T00:00:00Z"}
|
package/docs/requirements/shared-agent-context/schemas/fixtures/replay-idempotency-corpus.json
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"x-fixturePurpose":"integration negative corpus for x-appendOnly and x-idempotencyScope; each event is individually schema-valid but the pair must be rejected by the ledger validator as a replay","events":[{"schemaVersion":"1.0","recordType":"proposal-transition","eventId":"event-accepted-1","proposalId":"proposal-1","proposalRevision":"1","correlationId":"proposal-correlation-0001","workspaceId":"payments-work","sequence":1,"priorEventHash":"aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa","fromStatus":"proposed","toStatus":"accepted","occurredAt":"2026-08-11T00:10:00Z","idempotencyKey":"accepted-transition-0001","acceptance":{"reviewDecisionRef":"./reviews/decision-1","reviewer":{"subject":"user:reviewer","authority":"owner","trustedPrincipalRef":"./identity/principal-1"},"security":{"gate":"pass","policyRef":"./policies/default","policyRevision":"1"},"freshness":{"state":"fresh","verifiedAt":"2026-08-11T00:05:00Z","maxEvidenceAgeSeconds":3600},"targetWrite":{"receiptRef":"./writes/receipt-1","targetRef":"./memory/constraint","completedAt":"2026-08-11T00:06:00Z"},"evidence":[{"kind":"memory","uri":"./memory/constraint","revision":"1","observedAt":"2026-08-11T00:00:00Z"}],"idempotencyKey":"accepted-transition-0001"}},{"schemaVersion":"1.0","recordType":"proposal-transition","eventId":"event-accepted-2","proposalId":"proposal-1","proposalRevision":"1","correlationId":"proposal-correlation-0001","workspaceId":"payments-work","sequence":2,"priorEventHash":"bbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbb","fromStatus":"proposed","toStatus":"accepted","occurredAt":"2026-08-11T00:11:00Z","idempotencyKey":"accepted-transition-0001","acceptance":{"reviewDecisionRef":"./reviews/decision-2","reviewer":{"subject":"user:reviewer","authority":"owner","trustedPrincipalRef":"./identity/principal-1"},"security":{"gate":"pass","policyRef":"./policies/default","policyRevision":"1"},"freshness":{"state":"fresh","verifiedAt":"2026-08-11T00:05:00Z","maxEvidenceAgeSeconds":3600},"targetWrite":{"receiptRef":"./writes/receipt-2","targetRef":"./memory/constraint","completedAt":"2026-08-11T00:06:00Z"},"evidence":[{"kind":"memory","uri":"./memory/constraint","revision":"1","observedAt":"2026-08-11T00:00:00Z"}],"idempotencyKey":"accepted-transition-0001"}}]}
|
package/docs/requirements/shared-agent-context/schemas/fixtures/valid-accepted-transition.json
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"schemaVersion":"1.0","recordType":"proposal-transition","eventId":"event-accepted-1","proposalId":"proposal-1","proposalRevision":"1","correlationId":"proposal-correlation-0001","workspaceId":"payments-work","sequence":1,"priorEventHash":"aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa","fromStatus":"proposed","toStatus":"accepted","occurredAt":"2026-08-11T00:10:00Z","idempotencyKey":"accepted-transition-0001","acceptance":{"reviewDecisionRef":"./reviews/decision-1","writeIntentRef":"./proposals/proposal-1.intent-1","reviewer":{"subject":"user:reviewer","authority":"owner","trustedPrincipalRef":"./identity/principal-1"},"security":{"gate":"pass","policyRef":"./policies/default","policyRevision":"1"},"freshness":{"state":"fresh","verifiedAt":"2026-08-11T00:05:00Z","maxEvidenceAgeSeconds":3600},"targetWrite":{"receiptRef":"./writes/receipt-1","targetRef":"./memory/constraint","completedAt":"2026-08-11T00:06:00Z","binding":{"owner":"memory","bindingHash":"a62eb99d2270853152d5bc625268f384905b8c558ad704e8e77f2d601c60f66f","intentRef":"./proposals/proposal-1.intent-1","proposalId":"proposal-1","proposalRevision":"1","workspaceId":"payments-work","correlationId":"proposal-correlation-0001","idempotencyKey":"accepted-transition-0001","reviewerSubject":"user:reviewer","reviewerAuthority":"owner","policyRevision":"1"}},"evidence":[{"kind":"memory","uri":"./memory/constraint","revision":"1","observedAt":"2026-08-11T00:00:00Z"}],"idempotencyKey":"accepted-transition-0001"}}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"schemaVersion":"1.0","id":"access-1","workspaceId":"payments-work","actor":"agent:release-bot","action":"resource","decision":"allowed","recordedAt":"2026-08-11T00:05:00Z","cost":{"toolCalls":1,"elapsedMs":12},"contextAssembly":{"traceRef":"./context/trace-1","configurationRevision":"1","selected":["./src/payments"],"omittedOptional":[]},"policy":{"ref":"./policies/default","revision":"1"},"integrity":{"recordHash":"aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa","previousRecordHash":"GENESIS"},"resourceRef":"./src/payments"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"schemaVersion":"1.0","workspaceId":"payments-work","generatedAt":"2026-08-11T00:00:00Z","facts":[{"statement":"Flow is ready","evidence":[{"kind":"flow","uri":"./.metaproject/flows/001","revision":"1","observedAt":"2026-08-11T00:00:00Z","trust":"primary"}],"observedAt":"2026-08-11T00:00:00Z","expiresAt":"2026-08-12T00:00:00Z","freshness":"fresh"}],"work":{"state":"unbound"},"knowHow":[{"kind":"memory","uri":"./.metaproject/memory/constraint","revision":"2","trust":"accepted","status":"fresh"}],"freshness":"fresh"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"schemaVersion":"1.0","recordType":"proposal-created","id":"proposal-1","proposalRevision":"1","correlationId":"proposal-correlation-0001","workspaceId":"payments-work","kind":"memory-entry","status":"proposed","summary":"Redacted reusable constraint","evidence":[{"kind":"memory","uri":"./memory/constraint","revision":"1","observedAt":"2026-08-11T00:00:00Z"}],"wrapUp":{"id":"wrapup-1","source":"flow","sourceRef":"./flows/payments-wrapup","sourceRevision":"1","issuedAt":"2026-08-11T00:00:00Z","expiresAt":"2026-08-11T01:00:00Z"},"author":"agent:writer","security":{"gate":"pass","redacted":true,"policyRef":"./policies/default","policyRevision":"1"},"createdAt":"2026-08-11T00:00:00Z"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"schemaVersion":"1.0","id":"decision-1","proposalId":"proposal-1","proposalRevision":"1","correlationId":"proposal-correlation-0001","workspaceId":"payments-work","decision":"accepted","reviewer":{"subject":"user:reviewer","authority":"owner","trustedPrincipalRef":"./identity/principal-1"},"decidedAt":"2026-08-11T00:05:00Z","idempotencyKey":"review-decision-0001","security":{"gate":"pass","policyRef":"./policies/default","policyRevision":"1"},"freshness":{"state":"fresh","verifiedAt":"2026-08-11T00:05:00Z","evidenceRevision":"1"},"targetWrite":{"receiptRef":"./writes/receipt-1","targetRef":"./memory/constraint","completedAt":"2026-08-11T00:06:00Z"}}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"schemaVersion":"1.0","id":"payments-work","title":"Payments work","status":"active","members":[{"subject":"team:payments","role":"owner"},{"subject":"agent:release-bot","role":"editor"}],"resources":[{"kind":"component","uri":"./src/payments","revision":"abc123"}],"createdAt":"2026-08-11T00:00:00Z","updatedAt":"2026-08-11T00:00:00Z"}
|
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
{
|
|
2
|
+
"$schema": "https://json-schema.org/draft/2020-12/schema",
|
|
3
|
+
"$id": "keryx/shared-agent-context/fwk-receipt/v1",
|
|
4
|
+
"$vocabulary": {"https://json-schema.org/draft/2020-12/vocab/format-assertion": true},
|
|
5
|
+
"type": "object",
|
|
6
|
+
"additionalProperties": false,
|
|
7
|
+
"required": ["schemaVersion", "workspaceId", "generatedAt", "facts", "work", "knowHow", "freshness"],
|
|
8
|
+
"properties": {
|
|
9
|
+
"schemaVersion": {"const": "1.0"},
|
|
10
|
+
"workspaceId": {"type": "string", "pattern": "^[a-z][a-z0-9-]{2,63}$"},
|
|
11
|
+
"generatedAt": {"$ref": "#/$defs/utcTimestamp"},
|
|
12
|
+
"facts": {"type": "array", "items": {"$ref": "#/$defs/fact"}},
|
|
13
|
+
"work": {"$ref": "#/$defs/work"},
|
|
14
|
+
"knowHow": {"type": "array", "items": {"$ref": "#/$defs/knowHow"}},
|
|
15
|
+
"freshness": {"enum": ["fresh", "stale", "partial", "denied"]}
|
|
16
|
+
},
|
|
17
|
+
"x-temporalOrder": [{"earlier": "facts[].observedAt", "laterOrEqual": "facts[].expiresAt"}, {"earlier": "facts[].observedAt", "laterOrEqual": "generatedAt"}],
|
|
18
|
+
"$defs": {
|
|
19
|
+
"utcTimestamp": {"type": "string", "format": "date-time", "pattern": "^[0-9]{4}-[0-9]{2}-[0-9]{2}T[0-9]{2}:[0-9]{2}:[0-9]{2}(?:\\.[0-9]+)?Z$", "x-formatAssertionRequired": true},
|
|
20
|
+
"immutableRevision": {"type": "string", "minLength": 1, "maxLength": 256, "pattern": "^[A-Za-z0-9][A-Za-z0-9._:-]{0,255}$", "x-immutable": true},
|
|
21
|
+
"workspacePath": {"type": "string", "pattern": "^\\./(?!.*(?:^|/)\\.\\.(?:/|$))(?:[A-Za-z0-9._-]+/)*[A-Za-z0-9._-]+$", "x-rootContainment": "workspace root realpath"},
|
|
22
|
+
"evidence": {"type": "object", "additionalProperties": false, "required": ["kind", "uri", "revision", "observedAt", "trust"], "properties": {"kind": {"enum": ["code", "flow", "wiki", "memory", "test", "health", "artifact"]}, "uri": {"$ref": "#/$defs/workspacePath"}, "revision": {"$ref": "#/$defs/immutableRevision"}, "observedAt": {"$ref": "#/$defs/utcTimestamp"}, "trust": {"enum": ["primary", "accepted", "reviewed"]}}},
|
|
23
|
+
"fact": {"type": "object", "additionalProperties": false, "required": ["statement", "evidence", "observedAt", "expiresAt", "freshness"], "properties": {"statement": {"type": "string", "minLength": 1, "maxLength": 4000}, "evidence": {"type": "array", "minItems": 1, "items": {"$ref": "#/$defs/evidence"}}, "observedAt": {"$ref": "#/$defs/utcTimestamp"}, "expiresAt": {"$ref": "#/$defs/utcTimestamp"}, "freshness": {"enum": ["fresh", "stale", "expired", "denied"]}, "confidence": {"type": "number", "minimum": 0, "maximum": 1}}},
|
|
24
|
+
"flowRef": {"type": "object", "additionalProperties": false, "required": ["uri", "snapshot", "revision"], "properties": {"uri": {"$ref": "#/$defs/workspacePath"}, "snapshot": {"type": "string", "minLength": 1, "maxLength": 256}, "revision": {"$ref": "#/$defs/immutableRevision"}}},
|
|
25
|
+
"work": {"oneOf": [{"type": "object", "additionalProperties": false, "required": ["state", "flowRef"], "properties": {"state": {"const": "bound"}, "flowRef": {"$ref": "#/$defs/flowRef"}, "completed": {"type": "array", "items": {"type": "string"}}, "next": {"type": "array", "items": {"type": "string"}}, "blocked": {"type": "array", "items": {"type": "string"}}, "evidence": {"type": "array", "items": {"$ref": "#/$defs/evidence"}}}}, {"type": "object", "additionalProperties": false, "required": ["state"], "properties": {"state": {"const": "unbound"}}, "x-forbids": ["flowRef", "completed", "next", "blocked", "evidence"]}]},
|
|
26
|
+
"knowHow": {"type": "object", "additionalProperties": false, "required": ["kind", "uri", "revision", "trust", "status"], "properties": {"kind": {"enum": ["wiki", "memory", "skill"]}, "uri": {"$ref": "#/$defs/workspacePath"}, "revision": {"$ref": "#/$defs/immutableRevision"}, "trust": {"enum": ["accepted", "reviewed"]}, "status": {"enum": ["fresh", "stale", "withdrawn", "denied"]}, "applicability": {"type": "string", "maxLength": 1000}}}
|
|
27
|
+
}
|
|
28
|
+
}
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
{
|
|
2
|
+
"$schema": "https://json-schema.org/draft/2020-12/schema",
|
|
3
|
+
"$id": "keryx/shared-agent-context/review-decision/v1",
|
|
4
|
+
"$vocabulary": {"https://json-schema.org/draft/2020-12/vocab/format-assertion": true},
|
|
5
|
+
"type": "object",
|
|
6
|
+
"additionalProperties": false,
|
|
7
|
+
"required": ["schemaVersion", "id", "proposalId", "proposalRevision", "correlationId", "workspaceId", "decision", "reviewer", "decidedAt", "idempotencyKey"],
|
|
8
|
+
"properties": {
|
|
9
|
+
"schemaVersion": {"const": "1.0"}, "id": {"$ref": "#/$defs/id"}, "proposalId": {"$ref": "#/$defs/id"}, "proposalRevision": {"$ref": "#/$defs/revision"}, "correlationId": {"$ref": "#/$defs/correlationId"}, "workspaceId": {"$ref": "#/$defs/id"}, "decision": {"enum": ["accepted", "rejected", "dismissed"]}, "reviewer": {"$ref": "#/$defs/actorContext"}, "decidedAt": {"$ref": "#/$defs/utcTimestamp"}, "idempotencyKey": {"$ref": "#/$defs/idempotencyKey"}, "security": {"$ref": "#/$defs/security"}, "freshness": {"$ref": "#/$defs/freshness"}, "targetWrite": {"$ref": "#/$defs/targetWrite"}, "reason": {"type": "string", "minLength": 1, "maxLength": 2000}
|
|
10
|
+
},
|
|
11
|
+
"allOf": [{"if": {"properties": {"decision": {"const": "accepted"}}, "required": ["decision"]}, "then": {"required": ["security", "freshness", "targetWrite"]}, "else": {"required": ["reason"], "not": {"anyOf": [{"required": ["targetWrite"]}, {"required": ["freshness"]}]}}}],
|
|
12
|
+
"x-appendOnly": {"stream": "proposalId", "idempotencyScope": "workspaceId+proposalId", "authoritativeTransition": true},
|
|
13
|
+
"$defs": {
|
|
14
|
+
"id": {"type": "string", "pattern": "^[a-z][a-z0-9-]{2,63}$"}, "revision": {"type": "string", "minLength": 1, "maxLength": 256, "pattern": "^[A-Za-z0-9][A-Za-z0-9._:-]{0,255}$", "x-immutable": true}, "correlationId": {"type": "string", "minLength": 16, "maxLength": 256, "pattern": "^[A-Za-z0-9][A-Za-z0-9._:-]{15,255}$", "x-immutable": true}, "utcTimestamp": {"type": "string", "format": "date-time", "pattern": "^[0-9]{4}-[0-9]{2}-[0-9]{2}T[0-9]{2}:[0-9]{2}:[0-9]{2}(?:\\.[0-9]+)?Z$", "x-formatAssertionRequired": true}, "workspacePath": {"type": "string", "pattern": "^\\./(?!.*(?:^|/)\\.\\.(?:/|$))(?:[A-Za-z0-9._-]+/)*[A-Za-z0-9._-]+$", "x-rootContainment": "workspace root realpath"}, "idempotencyKey": {"type": "string", "pattern": "^[A-Za-z0-9][A-Za-z0-9._:-]{15,255}$"},
|
|
15
|
+
"actorContext": {"type": "object", "additionalProperties": false, "required": ["subject", "authority", "trustedPrincipalRef"], "properties": {"subject": {"type": "string", "pattern": "^(?:user|team|service|agent):[a-z0-9][a-z0-9._-]{0,127}$"}, "authority": {"enum": ["owner", "editor"]}, "trustedPrincipalRef": {"$ref": "#/$defs/workspacePath"}}},
|
|
16
|
+
"security": {"type": "object", "additionalProperties": false, "required": ["gate", "policyRef", "policyRevision"], "properties": {"gate": {"const": "pass"}, "policyRef": {"$ref": "#/$defs/workspacePath"}, "policyRevision": {"$ref": "#/$defs/revision"}}}, "freshness": {"type": "object", "additionalProperties": false, "required": ["state", "verifiedAt", "evidenceRevision"], "properties": {"state": {"const": "fresh"}, "verifiedAt": {"$ref": "#/$defs/utcTimestamp"}, "evidenceRevision": {"$ref": "#/$defs/revision"}}}, "targetWrite": {"type": "object", "additionalProperties": false, "required": ["receiptRef", "targetRef", "completedAt"], "properties": {"receiptRef": {"$ref": "#/$defs/workspacePath"}, "targetRef": {"$ref": "#/$defs/workspacePath"}, "completedAt": {"$ref": "#/$defs/utcTimestamp"}}}
|
|
17
|
+
}
|
|
18
|
+
}
|
|
@@ -0,0 +1,37 @@
|
|
|
1
|
+
{
|
|
2
|
+
"$schema": "https://json-schema.org/draft/2020-12/schema",
|
|
3
|
+
"$id": "keryx/shared-agent-context/workspace-manifest/v1",
|
|
4
|
+
"$vocabulary": {"https://json-schema.org/draft/2020-12/vocab/format-assertion": true},
|
|
5
|
+
"type": "object",
|
|
6
|
+
"additionalProperties": false,
|
|
7
|
+
"required": ["schemaVersion", "id", "title", "status", "members", "resources", "createdAt", "updatedAt"],
|
|
8
|
+
"properties": {
|
|
9
|
+
"schemaVersion": {"const": "1.0"},
|
|
10
|
+
"id": {"type": "string", "pattern": "^[a-z][a-z0-9-]{2,63}$"},
|
|
11
|
+
"title": {"type": "string", "minLength": 1, "maxLength": 160},
|
|
12
|
+
"status": {"enum": ["active", "archived"]},
|
|
13
|
+
"members": {
|
|
14
|
+
"type": "array",
|
|
15
|
+
"minItems": 1,
|
|
16
|
+
"uniqueItems": true,
|
|
17
|
+
"items": {"$ref": "#/$defs/member"},
|
|
18
|
+
"contains": {"properties": {"role": {"const": "owner"}}, "required": ["role"]},
|
|
19
|
+
"minContains": 1,
|
|
20
|
+
"maxContains": 1,
|
|
21
|
+
"x-uniqueBy": "subject",
|
|
22
|
+
"x-roleTopology": "exactly-one-owner; each canonical subject has one role"
|
|
23
|
+
},
|
|
24
|
+
"resources": {"type": "array", "items": {"$ref": "#/$defs/resourceRef"}, "x-uniqueBy": "uri"},
|
|
25
|
+
"createdAt": {"$ref": "#/$defs/utcTimestamp"},
|
|
26
|
+
"updatedAt": {"$ref": "#/$defs/utcTimestamp"}
|
|
27
|
+
},
|
|
28
|
+
"x-temporalOrder": [{"earlier": "createdAt", "laterOrEqual": "updatedAt"}],
|
|
29
|
+
"x-rootContainment": {"fields": ["resources[].uri"], "root": "workspace root", "resolveSymlinks": true, "rejectEscapes": true},
|
|
30
|
+
"$defs": {
|
|
31
|
+
"utcTimestamp": {"type": "string", "format": "date-time", "pattern": "^[0-9]{4}-[0-9]{2}-[0-9]{2}T[0-9]{2}:[0-9]{2}:[0-9]{2}(?:\\.[0-9]+)?Z$", "x-formatAssertionRequired": true},
|
|
32
|
+
"subjectId": {"type": "string", "pattern": "^(?:user|team|service|agent):[a-z0-9][a-z0-9._-]{0,127}$"},
|
|
33
|
+
"member": {"type": "object", "additionalProperties": false, "required": ["subject", "role"], "properties": {"subject": {"$ref": "#/$defs/subjectId"}, "role": {"enum": ["owner", "editor", "viewer"]}}},
|
|
34
|
+
"workspacePath": {"type": "string", "pattern": "^\\./(?!.*(?:^|/)\\.\\.(?:/|$))(?:[A-Za-z0-9._-]+/)*[A-Za-z0-9._-]+$", "x-canonicalize": "realpath within workspace root"},
|
|
35
|
+
"resourceRef": {"type": "object", "additionalProperties": false, "required": ["kind", "uri"], "properties": {"kind": {"enum": ["component", "repository", "flow", "wiki", "memory", "skill", "evidence", "worktree", "session"]}, "uri": {"$ref": "#/$defs/workspacePath"}, "revision": {"type": "string", "minLength": 1, "maxLength": 256}}}
|
|
36
|
+
}
|
|
37
|
+
}
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
{
|
|
2
|
+
"$schema": "https://json-schema.org/draft/2020-12/schema",
|
|
3
|
+
"$id": "keryx/shared-agent-context/workspace-proposal/v1",
|
|
4
|
+
"$vocabulary": {"https://json-schema.org/draft/2020-12/vocab/format-assertion": true},
|
|
5
|
+
"oneOf": [{"$ref":"#/$defs/creation"},{"$ref":"#/$defs/writeIntent"},{"$ref":"#/$defs/transition"}],
|
|
6
|
+
"$defs": {
|
|
7
|
+
"id":{"type":"string","pattern":"^[a-z][a-z0-9-]{2,63}$"},
|
|
8
|
+
"utc":{"type":"string","format":"date-time","pattern":"^[0-9]{4}-[0-9]{2}-[0-9]{2}T[0-9]{2}:[0-9]{2}:[0-9]{2}(?:\\.[0-9]+)?Z$","x-formatAssertionRequired":true},
|
|
9
|
+
"revision":{"type":"string","minLength":1,"maxLength":256,"pattern":"^[A-Za-z0-9][A-Za-z0-9._:-]{0,255}$","x-immutable":true},
|
|
10
|
+
"correlationId":{"type":"string","minLength":16,"maxLength":256,"pattern":"^[A-Za-z0-9][A-Za-z0-9._:-]{15,255}$","x-immutable":true},
|
|
11
|
+
"key":{"type":"string","pattern":"^[A-Za-z0-9][A-Za-z0-9._:-]{15,255}$"},
|
|
12
|
+
"path":{"type":"string","pattern":"^\\./(?!.*(?:^|/)\\.\\.(?:/|$))(?:[A-Za-z0-9._-]+/)*[A-Za-z0-9._-]+$","x-rootContainment":"workspace root realpath"},
|
|
13
|
+
"evidence":{"type":"object","additionalProperties":false,"required":["kind","uri","revision","observedAt"],"properties":{"kind":{"type":"string","minLength":1,"maxLength":64},"uri":{"$ref":"#/$defs/path"},"revision":{"$ref":"#/$defs/revision"},"observedAt":{"$ref":"#/$defs/utc"}}},
|
|
14
|
+
"actor":{"type":"object","additionalProperties":false,"required":["subject","authority","trustedPrincipalRef"],"properties":{"subject":{"type":"string","pattern":"^(?:user|team|service|agent):[a-z0-9][a-z0-9._-]{0,127}$"},"authority":{"enum":["owner","editor"]},"trustedPrincipalRef":{"$ref":"#/$defs/path"}}},
|
|
15
|
+
"security":{"type":"object","additionalProperties":false,"required":["gate","policyRef","policyRevision"],"properties":{"gate":{"const":"pass"},"policyRef":{"$ref":"#/$defs/path"},"policyRevision":{"$ref":"#/$defs/revision"}}},
|
|
16
|
+
"creation":{"type":"object","additionalProperties":false,"required":["schemaVersion","recordType","id","proposalRevision","correlationId","workspaceId","kind","status","summary","evidence","wrapUp","author","security","createdAt"],"properties":{"schemaVersion":{"const":"1.0"},"recordType":{"const":"proposal-created"},"id":{"$ref":"#/$defs/id"},"proposalRevision":{"$ref":"#/$defs/revision"},"correlationId":{"$ref":"#/$defs/correlationId"},"workspaceId":{"$ref":"#/$defs/id"},"kind":{"enum":["decision","wiki-update","memory-entry","follow-up","contract-change","risk"]},"status":{"const":"proposed"},"summary":{"type":"string","minLength":1,"maxLength":8000},"evidence":{"type":"array","minItems":1,"items":{"$ref":"#/$defs/evidence"}},"wrapUp":{"type":"object","additionalProperties":false,"required":["id","source","sourceRef","sourceRevision","issuedAt","expiresAt"],"properties":{"id":{"$ref":"#/$defs/id"},"source":{"enum":["session","flow"]},"sourceRef":{"$ref":"#/$defs/path"},"sourceRevision":{"$ref":"#/$defs/revision"},"issuedAt":{"$ref":"#/$defs/utc"},"expiresAt":{"$ref":"#/$defs/utc"}}},"author":{"type":"string","pattern":"^(?:user|team|service|agent):[a-z0-9][a-z0-9._-]{0,127}$"},"security":{"type":"object","additionalProperties":false,"required":["gate","redacted","policyRef","policyRevision"],"properties":{"gate":{"enum":["pass","needs-approval"]},"redacted":{"const":true},"policyRef":{"$ref":"#/$defs/path"},"policyRevision":{"$ref":"#/$defs/revision"}}},"createdAt":{"$ref":"#/$defs/utc"}},"x-immutableRecord":true},
|
|
17
|
+
"writeIntent":{"type":"object","additionalProperties":false,"required":["schemaVersion","recordType","intentId","proposalId","proposalRevision","correlationId","workspaceId","sequence","priorEventHash","idempotencyKey","reviewer","approvalRef","security","evidence","createdAt"],"properties":{"schemaVersion":{"const":"1.0"},"recordType":{"const":"proposal-write-intent"},"intentId":{"$ref":"#/$defs/id"},"proposalId":{"$ref":"#/$defs/id"},"proposalRevision":{"$ref":"#/$defs/revision"},"correlationId":{"$ref":"#/$defs/correlationId"},"workspaceId":{"$ref":"#/$defs/id"},"sequence":{"type":"integer","minimum":1},"priorEventHash":{"type":"string","pattern":"^[a-f0-9]{64}$"},"idempotencyKey":{"$ref":"#/$defs/key"},"reviewer":{"$ref":"#/$defs/actor"},"approvalRef":{"$ref":"#/$defs/path"},"security":{"$ref":"#/$defs/security"},"evidence":{"type":"array","minItems":1,"items":{"$ref":"#/$defs/evidence"}},"createdAt":{"$ref":"#/$defs/utc"}},"x-appendOnly":{"stream":"proposalId","strictSequence":true,"recovery":"owner-idempotency-key"}},
|
|
18
|
+
"transition":{"type":"object","additionalProperties":false,"required":["schemaVersion","recordType","eventId","proposalId","proposalRevision","correlationId","workspaceId","sequence","priorEventHash","fromStatus","toStatus","occurredAt","idempotencyKey"],"properties":{"schemaVersion":{"const":"1.0"},"recordType":{"const":"proposal-transition"},"eventId":{"$ref":"#/$defs/id"},"proposalId":{"$ref":"#/$defs/id"},"proposalRevision":{"$ref":"#/$defs/revision"},"correlationId":{"$ref":"#/$defs/correlationId"},"workspaceId":{"$ref":"#/$defs/id"},"sequence":{"type":"integer","minimum":1},"priorEventHash":{"type":"string","pattern":"^[a-f0-9]{64}$"},"fromStatus":{"const":"proposed"},"toStatus":{"enum":["accepted","rejected","dismissed","stale"]},"occurredAt":{"$ref":"#/$defs/utc"},"idempotencyKey":{"$ref":"#/$defs/key"},"acceptance":{"$ref":"#/$defs/acceptance"},"reason":{"type":"string","minLength":1,"maxLength":2000}},"allOf":[{"if":{"properties":{"toStatus":{"const":"accepted"}},"required":["toStatus"]},"then":{"required":["acceptance"]},"else":{"required":["reason"],"not":{"required":["acceptance"]}}}]},
|
|
19
|
+
"receiptBinding":{"type":"object","additionalProperties":false,"required":["owner","bindingHash","intentRef","proposalId","proposalRevision","workspaceId","correlationId","idempotencyKey","reviewerSubject","reviewerAuthority","policyRevision"],"properties":{"owner":{"enum":["wiki","memory","skill"]},"bindingHash":{"type":"string","pattern":"^[a-f0-9]{64}$"},"intentRef":{"$ref":"#/$defs/path"},"proposalId":{"$ref":"#/$defs/id"},"proposalRevision":{"$ref":"#/$defs/revision"},"workspaceId":{"$ref":"#/$defs/id"},"correlationId":{"$ref":"#/$defs/correlationId"},"idempotencyKey":{"$ref":"#/$defs/key"},"reviewerSubject":{"type":"string","pattern":"^(?:user|team|service|agent):[a-z0-9][a-z0-9._-]{0,127}$"},"reviewerAuthority":{"enum":["owner","editor"]},"policyRevision":{"$ref":"#/$defs/revision"}}},
|
|
20
|
+
"acceptance":{"type":"object","additionalProperties":false,"required":["reviewDecisionRef","writeIntentRef","reviewer","security","freshness","targetWrite","evidence","idempotencyKey"],"properties":{"reviewDecisionRef":{"$ref":"#/$defs/path"},"writeIntentRef":{"$ref":"#/$defs/path"},"reviewer":{"$ref":"#/$defs/actor"},"security":{"$ref":"#/$defs/security"},"freshness":{"type":"object","additionalProperties":false,"required":["state","verifiedAt","maxEvidenceAgeSeconds"],"properties":{"state":{"const":"fresh"},"verifiedAt":{"$ref":"#/$defs/utc"},"maxEvidenceAgeSeconds":{"type":"integer","minimum":1,"maximum":86400}}},"targetWrite":{"type":"object","additionalProperties":false,"required":["receiptRef","targetRef","completedAt","binding"],"properties":{"receiptRef":{"$ref":"#/$defs/path"},"targetRef":{"$ref":"#/$defs/path"},"completedAt":{"$ref":"#/$defs/utc"},"binding":{"$ref":"#/$defs/receiptBinding"}}},"evidence":{"type":"array","minItems":1,"items":{"$ref":"#/$defs/evidence"}},"idempotencyKey":{"$ref":"#/$defs/key"}},"x-temporalOrder":[{"earlier":"evidence[].observedAt","laterOrEqual":"freshness.verifiedAt"},{"earlier":"freshness.verifiedAt","laterOrEqual":"targetWrite.completedAt"}]}
|
|
21
|
+
}
|
|
22
|
+
}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@mrciphersmith/keryx",
|
|
3
|
-
"version": "0.2.
|
|
3
|
+
"version": "0.2.35",
|
|
4
4
|
"description": "Version-controlled project context for AI coding agents: code graph, architecture wiki, project memory, relevant tests, quality signals, and task flows.",
|
|
5
5
|
"private": false,
|
|
6
6
|
"publishConfig": {
|
|
@@ -45,6 +45,7 @@
|
|
|
45
45
|
},
|
|
46
46
|
"files": [
|
|
47
47
|
"dist",
|
|
48
|
+
"docs/requirements/shared-agent-context/schemas",
|
|
48
49
|
"src/gdgraph",
|
|
49
50
|
"src/gdskills/bundled",
|
|
50
51
|
"src/gdskills/contracts",
|
|
@@ -60,10 +61,15 @@
|
|
|
60
61
|
},
|
|
61
62
|
"devDependencies": {
|
|
62
63
|
"@types/bun": "latest",
|
|
64
|
+
"@xenova/transformers": "^2.17.2",
|
|
63
65
|
"bun-types": "latest",
|
|
64
66
|
"typescript": "^5"
|
|
65
67
|
},
|
|
66
68
|
"engines": {
|
|
67
69
|
"bun": ">=1.1.0"
|
|
68
|
-
}
|
|
70
|
+
},
|
|
71
|
+
"trustedDependencies": [
|
|
72
|
+
"protobufjs",
|
|
73
|
+
"sharp"
|
|
74
|
+
]
|
|
69
75
|
}
|