@riddledc/riddle-proof-packs 0.4.3 → 0.4.5
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +45 -0
- package/bin/riddle-proof-review-packet +4 -0
- package/dist/chunk-XQ2N4EYF.js +135 -0
- package/dist/humanReviewPacket-APSxuvat.d.cts +17 -0
- package/dist/humanReviewPacket-APSxuvat.d.ts +17 -0
- package/dist/index.cjs +139 -2
- package/dist/index.d.cts +1 -0
- package/dist/index.d.ts +1 -0
- package/dist/index.js +12 -1
- package/dist/reviewPacketCli.cjs +319 -0
- package/dist/reviewPacketCli.d.cts +28 -0
- package/dist/reviewPacketCli.d.ts +28 -0
- package/dist/reviewPacketCli.js +155 -0
- package/package.json +6 -2
- package/packs/neon-step-sequencer/examples/README.md +1 -1
- package/packs/neon-step-sequencer/examples/run-006-ratchet-loop-human-review-packet/human-review-packet.json +795 -0
- package/packs/neon-step-sequencer/examples/run-006-ratchet-loop-human-review-packet/human-review-packet.md +49 -0
package/README.md
CHANGED
|
@@ -24,6 +24,14 @@ Reusable starter profile definitions and proof-pack metadata for Riddle Proof.
|
|
|
24
24
|
- Returns first manifest entry for a matching `pack_id`.
|
|
25
25
|
- `instantiateRiddleProofProfile(name, options)`:
|
|
26
26
|
- Returns a copy of a profile with optional `url`, `route`, and `target` overrides.
|
|
27
|
+
- `findHumanReviewPacket(proofOrPacket)`:
|
|
28
|
+
- Recursively finds the first `human_review_packet` in a proof artifact or returns `null`.
|
|
29
|
+
- `requireHumanReviewPacket(proofOrPacket)`:
|
|
30
|
+
- Same extraction behavior, but throws if no packet is present.
|
|
31
|
+
- `formatHumanReviewPacketMarkdown(packet, options)`:
|
|
32
|
+
- Formats a compact Markdown handoff with recommendation, objective receipts, ranking role, proof boundary, listening prompts, and caveats.
|
|
33
|
+
- `createHumanReviewPacketArtifacts(proofOrPacket, options)`:
|
|
34
|
+
- Returns `{ packet, json, markdown }` for storing a standalone review packet next to a proof run.
|
|
27
35
|
|
|
28
36
|
## Proof claims and evidence roles
|
|
29
37
|
|
|
@@ -98,6 +106,43 @@ The `audio-mix` directory contains reusable audio-proof authoring guidance, a pr
|
|
|
98
106
|
|
|
99
107
|
The `neon-step-sequencer` directory contains the first app-specific ratchet lab under the new architecture. Its profiles declare `current_target` or `interaction_snapshots` evidence-role patterns and explicitly state what they do not prove. The ratchet-loop profile now expects a compact `humanReviewPacket` for listening handoff: supported/rejected candidates, objective guardrails, state restoration, review-order ranking, and taste caveats. The case-study files record the claim, evidence, failure classification, smallest layer changed, and next sharper question for each run.
|
|
100
108
|
|
|
109
|
+
### Human-review packet handoff
|
|
110
|
+
|
|
111
|
+
Human-review packets are proof artifacts for subjective follow-up. They are deliberately not taste scores. A packet should say what objective receipts passed, what was preserved, which candidate is ready for listening review, and which caveats remain.
|
|
112
|
+
|
|
113
|
+
From the CLI:
|
|
114
|
+
|
|
115
|
+
```sh
|
|
116
|
+
riddle-proof-review-packet \
|
|
117
|
+
--proof artifacts/riddle-proof/proof.json \
|
|
118
|
+
--output artifacts/riddle-proof
|
|
119
|
+
```
|
|
120
|
+
|
|
121
|
+
This writes `human-review-packet.json` and `human-review-packet.md` next to the proof run. Use `--stdout` when an agent should read the Markdown handoff immediately.
|
|
122
|
+
|
|
123
|
+
```ts
|
|
124
|
+
import {
|
|
125
|
+
createHumanReviewPacketArtifacts,
|
|
126
|
+
findHumanReviewPacket,
|
|
127
|
+
formatHumanReviewPacketMarkdown,
|
|
128
|
+
} from "@riddledc/riddle-proof-packs";
|
|
129
|
+
|
|
130
|
+
const proof = JSON.parse(await fs.promises.readFile("proof.json", "utf8"));
|
|
131
|
+
const packet = findHumanReviewPacket(proof);
|
|
132
|
+
if (!packet) throw new Error("proof did not emit a human review packet");
|
|
133
|
+
|
|
134
|
+
const markdown = formatHumanReviewPacketMarkdown(packet, {
|
|
135
|
+
title: "Neon Human Review Packet",
|
|
136
|
+
});
|
|
137
|
+
const artifacts = createHumanReviewPacketArtifacts(proof, {
|
|
138
|
+
title: "Neon Human Review Packet",
|
|
139
|
+
});
|
|
140
|
+
|
|
141
|
+
console.log(markdown);
|
|
142
|
+
await fs.promises.writeFile("human-review-packet.json", artifacts.json);
|
|
143
|
+
await fs.promises.writeFile("human-review-packet.md", artifacts.markdown);
|
|
144
|
+
```
|
|
145
|
+
|
|
101
146
|
## Usage
|
|
102
147
|
|
|
103
148
|
```ts
|
|
@@ -0,0 +1,135 @@
|
|
|
1
|
+
// src/humanReviewPacket.ts
|
|
2
|
+
var isRecord = (value) => Boolean(value) && typeof value === "object" && !Array.isArray(value);
|
|
3
|
+
var asRecord = (value) => isRecord(value) ? value : null;
|
|
4
|
+
var asArray = (value) => Array.isArray(value) ? value : [];
|
|
5
|
+
var getPath = (value, path) => {
|
|
6
|
+
let cursor = value;
|
|
7
|
+
for (const part of path.split(".")) {
|
|
8
|
+
if (!isRecord(cursor)) return void 0;
|
|
9
|
+
cursor = cursor[part];
|
|
10
|
+
}
|
|
11
|
+
return cursor;
|
|
12
|
+
};
|
|
13
|
+
var formatValue = (value) => {
|
|
14
|
+
if (value === null || value === void 0 || value === "") return "not captured";
|
|
15
|
+
if (typeof value === "number") return Number.isInteger(value) ? String(value) : String(Number(value.toFixed(4)));
|
|
16
|
+
if (typeof value === "boolean") return value ? "true" : "false";
|
|
17
|
+
return String(value);
|
|
18
|
+
};
|
|
19
|
+
var formatCodeValue = (value) => `\`${formatValue(value)}\``;
|
|
20
|
+
var formatAction = (action) => {
|
|
21
|
+
const record = asRecord(action);
|
|
22
|
+
if (!record) return "not captured";
|
|
23
|
+
const type = record.type ?? "set_mixer_level";
|
|
24
|
+
const track = record.track ?? "track";
|
|
25
|
+
const from = formatValue(record.from);
|
|
26
|
+
const to = formatValue(record.to);
|
|
27
|
+
const delta = record.delta === null || record.delta === void 0 ? "" : ` (${formatValue(record.delta)})`;
|
|
28
|
+
return `${type} ${track}: ${from} -> ${to}${delta}`;
|
|
29
|
+
};
|
|
30
|
+
var addOptionalList = (lines, heading, values) => {
|
|
31
|
+
const entries = asArray(values).filter((entry) => entry !== null && entry !== void 0 && entry !== "");
|
|
32
|
+
if (!entries.length) return;
|
|
33
|
+
lines.push("", `## ${heading}`, "");
|
|
34
|
+
for (const entry of entries) lines.push(`- ${formatValue(entry)}`);
|
|
35
|
+
};
|
|
36
|
+
function findHumanReviewPacket(value) {
|
|
37
|
+
if (!value || typeof value !== "object") return null;
|
|
38
|
+
if (isRecord(value) && value.kind === "human_review_packet") return value;
|
|
39
|
+
if (Array.isArray(value)) {
|
|
40
|
+
for (const entry of value) {
|
|
41
|
+
const packet = findHumanReviewPacket(entry);
|
|
42
|
+
if (packet) return packet;
|
|
43
|
+
}
|
|
44
|
+
return null;
|
|
45
|
+
}
|
|
46
|
+
for (const entry of Object.values(value)) {
|
|
47
|
+
const packet = findHumanReviewPacket(entry);
|
|
48
|
+
if (packet) return packet;
|
|
49
|
+
}
|
|
50
|
+
return null;
|
|
51
|
+
}
|
|
52
|
+
function requireHumanReviewPacket(value) {
|
|
53
|
+
const packet = findHumanReviewPacket(value);
|
|
54
|
+
if (!packet) throw new Error("No human_review_packet found");
|
|
55
|
+
return packet;
|
|
56
|
+
}
|
|
57
|
+
function formatHumanReviewPacketMarkdown(packet, options = {}) {
|
|
58
|
+
if (packet.kind !== "human_review_packet") {
|
|
59
|
+
throw new Error("Expected a human_review_packet");
|
|
60
|
+
}
|
|
61
|
+
const recommendation = asRecord(packet.recommendation) ?? {};
|
|
62
|
+
const candidate = asRecord(recommendation.candidate) ?? {};
|
|
63
|
+
const guardrails = asRecord(packet.guardrails) ?? {};
|
|
64
|
+
const ranking = asRecord(packet.ranking) ?? {};
|
|
65
|
+
const request = asRecord(packet.request) ?? {};
|
|
66
|
+
const supportedCandidates = asArray(packet.supportedCandidates);
|
|
67
|
+
const rejectedCandidates = asArray(packet.rejectedCandidates);
|
|
68
|
+
const selectedSong = getPath(packet, "target.selectedSong.selectedSong") ?? getPath(packet, "target.routeState.selectedSong");
|
|
69
|
+
const lines = [
|
|
70
|
+
`# ${options.title ?? "Human Review Packet"}`,
|
|
71
|
+
"",
|
|
72
|
+
`- status: ${formatCodeValue(packet.status)}`,
|
|
73
|
+
`- domain: ${formatCodeValue(packet.domain)}`,
|
|
74
|
+
`- evidence_role_pattern: ${formatCodeValue(packet.evidenceRolePattern)}`,
|
|
75
|
+
`- requested_intent: ${formatValue(packet.requestedIntent)}`,
|
|
76
|
+
`- selected_song: ${formatValue(selectedSong)}`,
|
|
77
|
+
"",
|
|
78
|
+
"## Recommendation",
|
|
79
|
+
"",
|
|
80
|
+
`- action: ${formatCodeValue(recommendation.action)}`,
|
|
81
|
+
`- candidate: ${formatCodeValue(candidate.label)}`,
|
|
82
|
+
`- candidate_action: ${formatCodeValue(formatAction(candidate.action))}`,
|
|
83
|
+
`- reason: ${formatValue(recommendation.reason)}`,
|
|
84
|
+
"",
|
|
85
|
+
"## Objective Receipts",
|
|
86
|
+
"",
|
|
87
|
+
`- supported_candidates: ${formatCodeValue(guardrails.supportedClaimCandidateCount ?? supportedCandidates.length)}`,
|
|
88
|
+
`- rejected_candidates: ${formatCodeValue(guardrails.rejectedCandidateCount ?? rejectedCandidates.length)}`,
|
|
89
|
+
`- state_restored_after_loop: ${formatCodeValue(guardrails.stateRestoredAfterLoop)}`,
|
|
90
|
+
`- candidate_actions_are_transient: ${formatCodeValue(request.candidateActionsAreTransient)}`,
|
|
91
|
+
`- no_permanent_edit_unless_apply_best: ${formatCodeValue(guardrails.noPermanentEditUnlessApplyBest)}`,
|
|
92
|
+
"",
|
|
93
|
+
"## Ranking",
|
|
94
|
+
"",
|
|
95
|
+
`- metric: ${formatCodeValue(ranking.metric)}`,
|
|
96
|
+
`- role: ${formatCodeValue(ranking.role)}`,
|
|
97
|
+
`- lower_is_better: ${formatCodeValue(ranking.lowerIsBetter)}`,
|
|
98
|
+
`- baseline: ${formatCodeValue(ranking.baselineCandidateRankingMetric)}`,
|
|
99
|
+
`- best: ${formatCodeValue(ranking.bestCandidateRankingMetric)}`,
|
|
100
|
+
`- delta: ${formatCodeValue(ranking.rankingMetricDelta)}`,
|
|
101
|
+
"",
|
|
102
|
+
"## Boundary",
|
|
103
|
+
"",
|
|
104
|
+
formatValue(packet.proofBoundary)
|
|
105
|
+
];
|
|
106
|
+
addOptionalList(lines, "Listening Prompts", packet.listenerPrompts);
|
|
107
|
+
addOptionalList(lines, "Caveats", packet.caveats);
|
|
108
|
+
if (rejectedCandidates.length) {
|
|
109
|
+
lines.push("", "## Rejected Candidates", "");
|
|
110
|
+
for (const entry of rejectedCandidates) {
|
|
111
|
+
const rejected = asRecord(entry) ?? {};
|
|
112
|
+
const failedReceipts = asArray(rejected.failedReceipts).map(formatValue).join(", ") || "not captured";
|
|
113
|
+
lines.push(`- ${formatCodeValue(rejected.label)}: ${failedReceipts}`);
|
|
114
|
+
}
|
|
115
|
+
}
|
|
116
|
+
return `${lines.join("\n")}
|
|
117
|
+
`;
|
|
118
|
+
}
|
|
119
|
+
function createHumanReviewPacketArtifacts(proofOrPacket, options = {}) {
|
|
120
|
+
const packet = requireHumanReviewPacket(proofOrPacket);
|
|
121
|
+
const markdown = formatHumanReviewPacketMarkdown(packet, options);
|
|
122
|
+
return {
|
|
123
|
+
packet,
|
|
124
|
+
json: `${JSON.stringify(packet, null, 2)}
|
|
125
|
+
`,
|
|
126
|
+
markdown
|
|
127
|
+
};
|
|
128
|
+
}
|
|
129
|
+
|
|
130
|
+
export {
|
|
131
|
+
findHumanReviewPacket,
|
|
132
|
+
requireHumanReviewPacket,
|
|
133
|
+
formatHumanReviewPacketMarkdown,
|
|
134
|
+
createHumanReviewPacketArtifacts
|
|
135
|
+
};
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
type HumanReviewPacket = Record<string, unknown> & {
|
|
2
|
+
kind: "human_review_packet";
|
|
3
|
+
};
|
|
4
|
+
interface HumanReviewPacketMarkdownOptions {
|
|
5
|
+
title?: string;
|
|
6
|
+
}
|
|
7
|
+
interface HumanReviewPacketArtifacts {
|
|
8
|
+
packet: HumanReviewPacket;
|
|
9
|
+
json: string;
|
|
10
|
+
markdown: string;
|
|
11
|
+
}
|
|
12
|
+
declare function findHumanReviewPacket(value: unknown): HumanReviewPacket | null;
|
|
13
|
+
declare function requireHumanReviewPacket(value: unknown): HumanReviewPacket;
|
|
14
|
+
declare function formatHumanReviewPacketMarkdown(packet: HumanReviewPacket, options?: HumanReviewPacketMarkdownOptions): string;
|
|
15
|
+
declare function createHumanReviewPacketArtifacts(proofOrPacket: unknown, options?: HumanReviewPacketMarkdownOptions): HumanReviewPacketArtifacts;
|
|
16
|
+
|
|
17
|
+
export { type HumanReviewPacket as H, type HumanReviewPacketArtifacts as a, type HumanReviewPacketMarkdownOptions as b, createHumanReviewPacketArtifacts as c, formatHumanReviewPacketMarkdown as d, findHumanReviewPacket as f, requireHumanReviewPacket as r };
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
type HumanReviewPacket = Record<string, unknown> & {
|
|
2
|
+
kind: "human_review_packet";
|
|
3
|
+
};
|
|
4
|
+
interface HumanReviewPacketMarkdownOptions {
|
|
5
|
+
title?: string;
|
|
6
|
+
}
|
|
7
|
+
interface HumanReviewPacketArtifacts {
|
|
8
|
+
packet: HumanReviewPacket;
|
|
9
|
+
json: string;
|
|
10
|
+
markdown: string;
|
|
11
|
+
}
|
|
12
|
+
declare function findHumanReviewPacket(value: unknown): HumanReviewPacket | null;
|
|
13
|
+
declare function requireHumanReviewPacket(value: unknown): HumanReviewPacket;
|
|
14
|
+
declare function formatHumanReviewPacketMarkdown(packet: HumanReviewPacket, options?: HumanReviewPacketMarkdownOptions): string;
|
|
15
|
+
declare function createHumanReviewPacketArtifacts(proofOrPacket: unknown, options?: HumanReviewPacketMarkdownOptions): HumanReviewPacketArtifacts;
|
|
16
|
+
|
|
17
|
+
export { type HumanReviewPacket as H, type HumanReviewPacketArtifacts as a, type HumanReviewPacketMarkdownOptions as b, createHumanReviewPacketArtifacts as c, formatHumanReviewPacketMarkdown as d, findHumanReviewPacket as f, requireHumanReviewPacket as r };
|
package/dist/index.cjs
CHANGED
|
@@ -22,6 +22,9 @@ var index_exports = {};
|
|
|
22
22
|
__export(index_exports, {
|
|
23
23
|
RIDDLE_PROOF_PACK_MANIFEST: () => RIDDLE_PROOF_PACK_MANIFEST,
|
|
24
24
|
RIDDLE_PROOF_PACK_PROFILES: () => RIDDLE_PROOF_PACK_PROFILES,
|
|
25
|
+
createHumanReviewPacketArtifacts: () => createHumanReviewPacketArtifacts,
|
|
26
|
+
findHumanReviewPacket: () => findHumanReviewPacket,
|
|
27
|
+
formatHumanReviewPacketMarkdown: () => formatHumanReviewPacketMarkdown,
|
|
25
28
|
getPackEnabledRiddleProofPackProfiles: () => getPackEnabledRiddleProofPackProfiles,
|
|
26
29
|
getRiddleProofPackProfile: () => getRiddleProofPackProfile,
|
|
27
30
|
getRiddleProofPackProfileByPackId: () => getRiddleProofPackProfileByPackId,
|
|
@@ -29,7 +32,8 @@ __export(index_exports, {
|
|
|
29
32
|
getRiddleProofProfilesByPackId: () => getRiddleProofProfilesByPackId,
|
|
30
33
|
instantiateRiddleProofProfile: () => instantiateRiddleProofProfile,
|
|
31
34
|
listRiddleProofPackProfiles: () => listRiddleProofPackProfiles,
|
|
32
|
-
listRiddleProofPacks: () => listRiddleProofPacks
|
|
35
|
+
listRiddleProofPacks: () => listRiddleProofPacks,
|
|
36
|
+
requireHumanReviewPacket: () => requireHumanReviewPacket
|
|
33
37
|
});
|
|
34
38
|
module.exports = __toCommonJS(index_exports);
|
|
35
39
|
|
|
@@ -2345,10 +2349,142 @@ function instantiateRiddleProofProfile(profileName, options = {}) {
|
|
|
2345
2349
|
}
|
|
2346
2350
|
);
|
|
2347
2351
|
}
|
|
2352
|
+
|
|
2353
|
+
// src/humanReviewPacket.ts
|
|
2354
|
+
var isRecord2 = (value) => Boolean(value) && typeof value === "object" && !Array.isArray(value);
|
|
2355
|
+
var asRecord = (value) => isRecord2(value) ? value : null;
|
|
2356
|
+
var asArray = (value) => Array.isArray(value) ? value : [];
|
|
2357
|
+
var getPath = (value, path) => {
|
|
2358
|
+
let cursor = value;
|
|
2359
|
+
for (const part of path.split(".")) {
|
|
2360
|
+
if (!isRecord2(cursor)) return void 0;
|
|
2361
|
+
cursor = cursor[part];
|
|
2362
|
+
}
|
|
2363
|
+
return cursor;
|
|
2364
|
+
};
|
|
2365
|
+
var formatValue = (value) => {
|
|
2366
|
+
if (value === null || value === void 0 || value === "") return "not captured";
|
|
2367
|
+
if (typeof value === "number") return Number.isInteger(value) ? String(value) : String(Number(value.toFixed(4)));
|
|
2368
|
+
if (typeof value === "boolean") return value ? "true" : "false";
|
|
2369
|
+
return String(value);
|
|
2370
|
+
};
|
|
2371
|
+
var formatCodeValue = (value) => `\`${formatValue(value)}\``;
|
|
2372
|
+
var formatAction = (action) => {
|
|
2373
|
+
const record = asRecord(action);
|
|
2374
|
+
if (!record) return "not captured";
|
|
2375
|
+
const type = record.type ?? "set_mixer_level";
|
|
2376
|
+
const track = record.track ?? "track";
|
|
2377
|
+
const from = formatValue(record.from);
|
|
2378
|
+
const to = formatValue(record.to);
|
|
2379
|
+
const delta = record.delta === null || record.delta === void 0 ? "" : ` (${formatValue(record.delta)})`;
|
|
2380
|
+
return `${type} ${track}: ${from} -> ${to}${delta}`;
|
|
2381
|
+
};
|
|
2382
|
+
var addOptionalList = (lines, heading, values) => {
|
|
2383
|
+
const entries = asArray(values).filter((entry) => entry !== null && entry !== void 0 && entry !== "");
|
|
2384
|
+
if (!entries.length) return;
|
|
2385
|
+
lines.push("", `## ${heading}`, "");
|
|
2386
|
+
for (const entry of entries) lines.push(`- ${formatValue(entry)}`);
|
|
2387
|
+
};
|
|
2388
|
+
function findHumanReviewPacket(value) {
|
|
2389
|
+
if (!value || typeof value !== "object") return null;
|
|
2390
|
+
if (isRecord2(value) && value.kind === "human_review_packet") return value;
|
|
2391
|
+
if (Array.isArray(value)) {
|
|
2392
|
+
for (const entry of value) {
|
|
2393
|
+
const packet = findHumanReviewPacket(entry);
|
|
2394
|
+
if (packet) return packet;
|
|
2395
|
+
}
|
|
2396
|
+
return null;
|
|
2397
|
+
}
|
|
2398
|
+
for (const entry of Object.values(value)) {
|
|
2399
|
+
const packet = findHumanReviewPacket(entry);
|
|
2400
|
+
if (packet) return packet;
|
|
2401
|
+
}
|
|
2402
|
+
return null;
|
|
2403
|
+
}
|
|
2404
|
+
function requireHumanReviewPacket(value) {
|
|
2405
|
+
const packet = findHumanReviewPacket(value);
|
|
2406
|
+
if (!packet) throw new Error("No human_review_packet found");
|
|
2407
|
+
return packet;
|
|
2408
|
+
}
|
|
2409
|
+
function formatHumanReviewPacketMarkdown(packet, options = {}) {
|
|
2410
|
+
if (packet.kind !== "human_review_packet") {
|
|
2411
|
+
throw new Error("Expected a human_review_packet");
|
|
2412
|
+
}
|
|
2413
|
+
const recommendation = asRecord(packet.recommendation) ?? {};
|
|
2414
|
+
const candidate = asRecord(recommendation.candidate) ?? {};
|
|
2415
|
+
const guardrails = asRecord(packet.guardrails) ?? {};
|
|
2416
|
+
const ranking = asRecord(packet.ranking) ?? {};
|
|
2417
|
+
const request = asRecord(packet.request) ?? {};
|
|
2418
|
+
const supportedCandidates = asArray(packet.supportedCandidates);
|
|
2419
|
+
const rejectedCandidates = asArray(packet.rejectedCandidates);
|
|
2420
|
+
const selectedSong = getPath(packet, "target.selectedSong.selectedSong") ?? getPath(packet, "target.routeState.selectedSong");
|
|
2421
|
+
const lines = [
|
|
2422
|
+
`# ${options.title ?? "Human Review Packet"}`,
|
|
2423
|
+
"",
|
|
2424
|
+
`- status: ${formatCodeValue(packet.status)}`,
|
|
2425
|
+
`- domain: ${formatCodeValue(packet.domain)}`,
|
|
2426
|
+
`- evidence_role_pattern: ${formatCodeValue(packet.evidenceRolePattern)}`,
|
|
2427
|
+
`- requested_intent: ${formatValue(packet.requestedIntent)}`,
|
|
2428
|
+
`- selected_song: ${formatValue(selectedSong)}`,
|
|
2429
|
+
"",
|
|
2430
|
+
"## Recommendation",
|
|
2431
|
+
"",
|
|
2432
|
+
`- action: ${formatCodeValue(recommendation.action)}`,
|
|
2433
|
+
`- candidate: ${formatCodeValue(candidate.label)}`,
|
|
2434
|
+
`- candidate_action: ${formatCodeValue(formatAction(candidate.action))}`,
|
|
2435
|
+
`- reason: ${formatValue(recommendation.reason)}`,
|
|
2436
|
+
"",
|
|
2437
|
+
"## Objective Receipts",
|
|
2438
|
+
"",
|
|
2439
|
+
`- supported_candidates: ${formatCodeValue(guardrails.supportedClaimCandidateCount ?? supportedCandidates.length)}`,
|
|
2440
|
+
`- rejected_candidates: ${formatCodeValue(guardrails.rejectedCandidateCount ?? rejectedCandidates.length)}`,
|
|
2441
|
+
`- state_restored_after_loop: ${formatCodeValue(guardrails.stateRestoredAfterLoop)}`,
|
|
2442
|
+
`- candidate_actions_are_transient: ${formatCodeValue(request.candidateActionsAreTransient)}`,
|
|
2443
|
+
`- no_permanent_edit_unless_apply_best: ${formatCodeValue(guardrails.noPermanentEditUnlessApplyBest)}`,
|
|
2444
|
+
"",
|
|
2445
|
+
"## Ranking",
|
|
2446
|
+
"",
|
|
2447
|
+
`- metric: ${formatCodeValue(ranking.metric)}`,
|
|
2448
|
+
`- role: ${formatCodeValue(ranking.role)}`,
|
|
2449
|
+
`- lower_is_better: ${formatCodeValue(ranking.lowerIsBetter)}`,
|
|
2450
|
+
`- baseline: ${formatCodeValue(ranking.baselineCandidateRankingMetric)}`,
|
|
2451
|
+
`- best: ${formatCodeValue(ranking.bestCandidateRankingMetric)}`,
|
|
2452
|
+
`- delta: ${formatCodeValue(ranking.rankingMetricDelta)}`,
|
|
2453
|
+
"",
|
|
2454
|
+
"## Boundary",
|
|
2455
|
+
"",
|
|
2456
|
+
formatValue(packet.proofBoundary)
|
|
2457
|
+
];
|
|
2458
|
+
addOptionalList(lines, "Listening Prompts", packet.listenerPrompts);
|
|
2459
|
+
addOptionalList(lines, "Caveats", packet.caveats);
|
|
2460
|
+
if (rejectedCandidates.length) {
|
|
2461
|
+
lines.push("", "## Rejected Candidates", "");
|
|
2462
|
+
for (const entry of rejectedCandidates) {
|
|
2463
|
+
const rejected = asRecord(entry) ?? {};
|
|
2464
|
+
const failedReceipts = asArray(rejected.failedReceipts).map(formatValue).join(", ") || "not captured";
|
|
2465
|
+
lines.push(`- ${formatCodeValue(rejected.label)}: ${failedReceipts}`);
|
|
2466
|
+
}
|
|
2467
|
+
}
|
|
2468
|
+
return `${lines.join("\n")}
|
|
2469
|
+
`;
|
|
2470
|
+
}
|
|
2471
|
+
function createHumanReviewPacketArtifacts(proofOrPacket, options = {}) {
|
|
2472
|
+
const packet = requireHumanReviewPacket(proofOrPacket);
|
|
2473
|
+
const markdown = formatHumanReviewPacketMarkdown(packet, options);
|
|
2474
|
+
return {
|
|
2475
|
+
packet,
|
|
2476
|
+
json: `${JSON.stringify(packet, null, 2)}
|
|
2477
|
+
`,
|
|
2478
|
+
markdown
|
|
2479
|
+
};
|
|
2480
|
+
}
|
|
2348
2481
|
// Annotate the CommonJS export names for ESM import in node:
|
|
2349
2482
|
0 && (module.exports = {
|
|
2350
2483
|
RIDDLE_PROOF_PACK_MANIFEST,
|
|
2351
2484
|
RIDDLE_PROOF_PACK_PROFILES,
|
|
2485
|
+
createHumanReviewPacketArtifacts,
|
|
2486
|
+
findHumanReviewPacket,
|
|
2487
|
+
formatHumanReviewPacketMarkdown,
|
|
2352
2488
|
getPackEnabledRiddleProofPackProfiles,
|
|
2353
2489
|
getRiddleProofPackProfile,
|
|
2354
2490
|
getRiddleProofPackProfileByPackId,
|
|
@@ -2356,5 +2492,6 @@ function instantiateRiddleProofProfile(profileName, options = {}) {
|
|
|
2356
2492
|
getRiddleProofProfilesByPackId,
|
|
2357
2493
|
instantiateRiddleProofProfile,
|
|
2358
2494
|
listRiddleProofPackProfiles,
|
|
2359
|
-
listRiddleProofPacks
|
|
2495
|
+
listRiddleProofPacks,
|
|
2496
|
+
requireHumanReviewPacket
|
|
2360
2497
|
});
|
package/dist/index.d.cts
CHANGED
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import * as _riddledc_riddle_proof from '@riddledc/riddle-proof';
|
|
2
2
|
import { RiddleProofProfile } from '@riddledc/riddle-proof';
|
|
3
|
+
export { H as HumanReviewPacket, a as HumanReviewPacketArtifacts, b as HumanReviewPacketMarkdownOptions, c as createHumanReviewPacketArtifacts, f as findHumanReviewPacket, d as formatHumanReviewPacketMarkdown, r as requireHumanReviewPacket } from './humanReviewPacket-APSxuvat.cjs';
|
|
3
4
|
|
|
4
5
|
interface RiddleProofPackProfileManifest {
|
|
5
6
|
/** Profile slug and canonical manifest key. */
|
package/dist/index.d.ts
CHANGED
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import * as _riddledc_riddle_proof from '@riddledc/riddle-proof';
|
|
2
2
|
import { RiddleProofProfile } from '@riddledc/riddle-proof';
|
|
3
|
+
export { H as HumanReviewPacket, a as HumanReviewPacketArtifacts, b as HumanReviewPacketMarkdownOptions, c as createHumanReviewPacketArtifacts, f as findHumanReviewPacket, d as formatHumanReviewPacketMarkdown, r as requireHumanReviewPacket } from './humanReviewPacket-APSxuvat.js';
|
|
3
4
|
|
|
4
5
|
interface RiddleProofPackProfileManifest {
|
|
5
6
|
/** Profile slug and canonical manifest key. */
|
package/dist/index.js
CHANGED
|
@@ -1,3 +1,10 @@
|
|
|
1
|
+
import {
|
|
2
|
+
createHumanReviewPacketArtifacts,
|
|
3
|
+
findHumanReviewPacket,
|
|
4
|
+
formatHumanReviewPacketMarkdown,
|
|
5
|
+
requireHumanReviewPacket
|
|
6
|
+
} from "./chunk-XQ2N4EYF.js";
|
|
7
|
+
|
|
1
8
|
// src/pack-data.ts
|
|
2
9
|
import { normalizeRiddleProofProfile } from "@riddledc/riddle-proof";
|
|
3
10
|
|
|
@@ -2313,6 +2320,9 @@ function instantiateRiddleProofProfile(profileName, options = {}) {
|
|
|
2313
2320
|
export {
|
|
2314
2321
|
RIDDLE_PROOF_PACK_MANIFEST,
|
|
2315
2322
|
RIDDLE_PROOF_PACK_PROFILES,
|
|
2323
|
+
createHumanReviewPacketArtifacts,
|
|
2324
|
+
findHumanReviewPacket,
|
|
2325
|
+
formatHumanReviewPacketMarkdown,
|
|
2316
2326
|
getPackEnabledRiddleProofPackProfiles,
|
|
2317
2327
|
getRiddleProofPackProfile,
|
|
2318
2328
|
getRiddleProofPackProfileByPackId,
|
|
@@ -2320,5 +2330,6 @@ export {
|
|
|
2320
2330
|
getRiddleProofProfilesByPackId,
|
|
2321
2331
|
instantiateRiddleProofProfile,
|
|
2322
2332
|
listRiddleProofPackProfiles,
|
|
2323
|
-
listRiddleProofPacks
|
|
2333
|
+
listRiddleProofPacks,
|
|
2334
|
+
requireHumanReviewPacket
|
|
2324
2335
|
};
|