@riddledc/riddle-proof-packs 0.4.5 → 0.4.7
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 +53 -1
- package/bin/riddle-proof-durable-candidate-plan +4 -0
- package/dist/{chunk-XQ2N4EYF.js → chunk-SAE6HFAG.js} +4 -0
- package/dist/chunk-VFPSPQD7.js +219 -0
- package/dist/durableCandidatePlan-Dv2P33Wg.d.cts +77 -0
- package/dist/durableCandidatePlan-Dv2P33Wg.d.ts +77 -0
- package/dist/durableCandidatePlanCli.cjs +445 -0
- package/dist/durableCandidatePlanCli.d.cts +32 -0
- package/dist/durableCandidatePlanCli.d.ts +32 -0
- package/dist/durableCandidatePlanCli.js +177 -0
- package/dist/index.cjs +403 -2
- package/dist/index.d.cts +1 -0
- package/dist/index.d.ts +1 -0
- package/dist/index.js +192 -3
- package/dist/reviewPacketCli.cjs +4 -0
- package/dist/reviewPacketCli.js +1 -1
- package/package.json +3 -2
- package/packs/audio-mix/ratchet-method.md +12 -0
- package/packs/neon-step-sequencer/README.md +7 -0
- package/packs/neon-step-sequencer/case-study/findings.md +22 -0
- package/packs/neon-step-sequencer/case-study/ratchet-card.md +3 -1
- package/packs/neon-step-sequencer/case-study/ratchet-log.md +112 -0
- package/packs/neon-step-sequencer/examples/README.md +5 -1
- package/packs/neon-step-sequencer/examples/run-006-ratchet-loop-human-review-packet/human-review-packet.md +3 -0
- package/packs/neon-step-sequencer/examples/run-007-approved-candidate-applied/artifact-manifest.json +32 -0
- package/packs/neon-step-sequencer/examples/run-007-approved-candidate-applied/console.json +4 -0
- package/packs/neon-step-sequencer/examples/run-007-approved-candidate-applied/dom-summary.json +40 -0
- package/packs/neon-step-sequencer/examples/run-007-approved-candidate-applied/human-review-packet.json +801 -0
- package/packs/neon-step-sequencer/examples/run-007-approved-candidate-applied/human-review-packet.md +52 -0
- package/packs/neon-step-sequencer/examples/run-007-approved-candidate-applied/profile-result.json +11994 -0
- package/packs/neon-step-sequencer/examples/run-007-approved-candidate-applied/proof.json +11994 -0
- package/packs/neon-step-sequencer/examples/run-007-approved-candidate-applied/screenshots/lilarcade-neon-ratchet-loop-approved-candidate-desktop-neon-ratchet-loop-approved-candidate.png +0 -0
- package/packs/neon-step-sequencer/examples/run-007-approved-candidate-applied/screenshots/lilarcade-neon-ratchet-loop-approved-candidate-desktop.png +0 -0
- package/packs/neon-step-sequencer/examples/run-007-approved-candidate-applied/summary.md +32 -0
- package/packs/neon-step-sequencer/examples/run-008-durable-mix-patch-handoff/artifact-manifest.json +32 -0
- package/packs/neon-step-sequencer/examples/run-008-durable-mix-patch-handoff/console.json +4 -0
- package/packs/neon-step-sequencer/examples/run-008-durable-mix-patch-handoff/dom-summary.json +40 -0
- package/packs/neon-step-sequencer/examples/run-008-durable-mix-patch-handoff/durable-candidate-patch-plan.json +69 -0
- package/packs/neon-step-sequencer/examples/run-008-durable-mix-patch-handoff/durable-candidate-patch-plan.md +29 -0
- package/packs/neon-step-sequencer/examples/run-008-durable-mix-patch-handoff/human-review-packet.json +801 -0
- package/packs/neon-step-sequencer/examples/run-008-durable-mix-patch-handoff/human-review-packet.md +52 -0
- package/packs/neon-step-sequencer/examples/run-008-durable-mix-patch-handoff/profile-result.json +5078 -0
- package/packs/neon-step-sequencer/examples/run-008-durable-mix-patch-handoff/proof.json +5078 -0
- package/packs/neon-step-sequencer/examples/run-008-durable-mix-patch-handoff/screenshots/lilarcade-neon-fast-mix-health-desktop-neon-fast-mix-health.png +0 -0
- package/packs/neon-step-sequencer/examples/run-008-durable-mix-patch-handoff/screenshots/lilarcade-neon-fast-mix-health-desktop.png +0 -0
- package/packs/neon-step-sequencer/examples/run-008-durable-mix-patch-handoff/summary.md +39 -0
- package/packs/neon-step-sequencer/profiles/ratchet-loop-approved-candidate.json +177 -0
package/dist/index.cjs
CHANGED
|
@@ -22,8 +22,11 @@ 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
|
+
createDurableCandidatePatchPlan: () => createDurableCandidatePatchPlan,
|
|
26
|
+
createDurableCandidatePatchPlanArtifacts: () => createDurableCandidatePatchPlanArtifacts,
|
|
25
27
|
createHumanReviewPacketArtifacts: () => createHumanReviewPacketArtifacts,
|
|
26
28
|
findHumanReviewPacket: () => findHumanReviewPacket,
|
|
29
|
+
formatDurableCandidatePatchPlanMarkdown: () => formatDurableCandidatePatchPlanMarkdown,
|
|
27
30
|
formatHumanReviewPacketMarkdown: () => formatHumanReviewPacketMarkdown,
|
|
28
31
|
getPackEnabledRiddleProofPackProfiles: () => getPackEnabledRiddleProofPackProfiles,
|
|
29
32
|
getRiddleProofPackProfile: () => getRiddleProofPackProfile,
|
|
@@ -1656,6 +1659,185 @@ var playback_sync_default = {
|
|
|
1656
1659
|
}
|
|
1657
1660
|
};
|
|
1658
1661
|
|
|
1662
|
+
// packs/neon-step-sequencer/profiles/ratchet-loop-approved-candidate.json
|
|
1663
|
+
var ratchet_loop_approved_candidate_default = {
|
|
1664
|
+
version: "riddle-proof.profile.v1",
|
|
1665
|
+
name: "neon-step-sequencer-ratchet-loop-approved-candidate",
|
|
1666
|
+
target: {
|
|
1667
|
+
route: "/games/drum-sequencer?song=monkberry-moon-delight-tab&mix=profile&view=trainer&instrument=bass",
|
|
1668
|
+
viewports: [
|
|
1669
|
+
{
|
|
1670
|
+
name: "desktop",
|
|
1671
|
+
width: 1440,
|
|
1672
|
+
height: 1e3
|
|
1673
|
+
}
|
|
1674
|
+
],
|
|
1675
|
+
timeout_sec: 360,
|
|
1676
|
+
wait_for_selector: ".drum-sequencer h1",
|
|
1677
|
+
setup_actions: [
|
|
1678
|
+
{
|
|
1679
|
+
type: "window_eval",
|
|
1680
|
+
label: "capture-neon-contract",
|
|
1681
|
+
timeout_ms: 1e4,
|
|
1682
|
+
store_return_to: "__neonMixProof.contract",
|
|
1683
|
+
script: "const contract=window.__NEON_MIX_PROOF__; const diagnostic=contract?.captureDiagnostic?.(); window.__neonMixProof={...(window.__neonMixProof||{}),contract:{available:Boolean(contract),diagnostic}}; return window.__neonMixProof.contract;",
|
|
1684
|
+
return_summary_fields: [
|
|
1685
|
+
{
|
|
1686
|
+
path: "available"
|
|
1687
|
+
},
|
|
1688
|
+
{
|
|
1689
|
+
path: "diagnostic.selectedSong.selectedSong"
|
|
1690
|
+
}
|
|
1691
|
+
]
|
|
1692
|
+
},
|
|
1693
|
+
{
|
|
1694
|
+
type: "assert_window_value",
|
|
1695
|
+
path: "__neonMixProof.contract.available",
|
|
1696
|
+
expected_value: true,
|
|
1697
|
+
timeout_ms: 1e4
|
|
1698
|
+
},
|
|
1699
|
+
{
|
|
1700
|
+
type: "window_call",
|
|
1701
|
+
label: "apply-approved-claim-candidate",
|
|
1702
|
+
path: "__NEON_MIX_PROOF__.runRatchetLoop",
|
|
1703
|
+
args: [
|
|
1704
|
+
{
|
|
1705
|
+
intent: "turn the chord part down a little",
|
|
1706
|
+
strategy: "mix-level-search",
|
|
1707
|
+
focusTracks: [
|
|
1708
|
+
"bass",
|
|
1709
|
+
"chord",
|
|
1710
|
+
"guitar",
|
|
1711
|
+
"rhythmSynth"
|
|
1712
|
+
],
|
|
1713
|
+
maxIterations: 6,
|
|
1714
|
+
monitorProfile: "smallSpeaker",
|
|
1715
|
+
restore: true,
|
|
1716
|
+
applyBest: true,
|
|
1717
|
+
approval: {
|
|
1718
|
+
mode: "mixing_canon_surrogate",
|
|
1719
|
+
approvedBy: "codex",
|
|
1720
|
+
basis: "subtle level reduction after objective receipts pass; this keeps development moving while preserving a listening-review caveat"
|
|
1721
|
+
}
|
|
1722
|
+
}
|
|
1723
|
+
],
|
|
1724
|
+
store_return_to: "__neonMixProof.approvedCandidateLoop",
|
|
1725
|
+
capture_return: true,
|
|
1726
|
+
timeout_ms: 24e4,
|
|
1727
|
+
return_summary_fields: [
|
|
1728
|
+
{
|
|
1729
|
+
path: "ok"
|
|
1730
|
+
},
|
|
1731
|
+
{
|
|
1732
|
+
path: "status"
|
|
1733
|
+
},
|
|
1734
|
+
{
|
|
1735
|
+
path: "best.claimVerdict.status"
|
|
1736
|
+
},
|
|
1737
|
+
{
|
|
1738
|
+
path: "best.claimCandidate.action.track"
|
|
1739
|
+
},
|
|
1740
|
+
{
|
|
1741
|
+
path: "appliedCandidateReceipt.ok"
|
|
1742
|
+
},
|
|
1743
|
+
{
|
|
1744
|
+
path: "humanReviewPacket.status"
|
|
1745
|
+
},
|
|
1746
|
+
{
|
|
1747
|
+
path: "humanReviewPacket.request.approval.mode"
|
|
1748
|
+
},
|
|
1749
|
+
{
|
|
1750
|
+
path: "humanReviewPacket.ranking.role"
|
|
1751
|
+
}
|
|
1752
|
+
]
|
|
1753
|
+
},
|
|
1754
|
+
{
|
|
1755
|
+
type: "assert_window_value",
|
|
1756
|
+
path: "__neonMixProof.approvedCandidateLoop.ok",
|
|
1757
|
+
expected_value: true,
|
|
1758
|
+
timeout_ms: 1e4
|
|
1759
|
+
},
|
|
1760
|
+
{
|
|
1761
|
+
type: "assert_window_value",
|
|
1762
|
+
path: "__neonMixProof.approvedCandidateLoop.appliedCandidateReceipt.ok",
|
|
1763
|
+
expected_value: true,
|
|
1764
|
+
timeout_ms: 1e4
|
|
1765
|
+
},
|
|
1766
|
+
{
|
|
1767
|
+
type: "assert_window_value",
|
|
1768
|
+
path: "__neonMixProof.approvedCandidateLoop.humanReviewPacket.status",
|
|
1769
|
+
expected_value: "candidate_applied_for_listening_review",
|
|
1770
|
+
timeout_ms: 1e4
|
|
1771
|
+
},
|
|
1772
|
+
{
|
|
1773
|
+
type: "assert_window_value",
|
|
1774
|
+
path: "__neonMixProof.approvedCandidateLoop.humanReviewPacket.request.candidateActionsAreTransient",
|
|
1775
|
+
expected_value: false,
|
|
1776
|
+
timeout_ms: 1e4
|
|
1777
|
+
},
|
|
1778
|
+
{
|
|
1779
|
+
type: "assert_window_value",
|
|
1780
|
+
path: "__neonMixProof.approvedCandidateLoop.humanReviewPacket.guardrails.approvedCandidateApplied",
|
|
1781
|
+
expected_value: true,
|
|
1782
|
+
timeout_ms: 1e4
|
|
1783
|
+
},
|
|
1784
|
+
{
|
|
1785
|
+
type: "screenshot",
|
|
1786
|
+
label: "neon-step-sequencer-ratchet-loop-approved-candidate",
|
|
1787
|
+
mode: "viewport"
|
|
1788
|
+
}
|
|
1789
|
+
]
|
|
1790
|
+
},
|
|
1791
|
+
checks: [
|
|
1792
|
+
{
|
|
1793
|
+
type: "route_loaded",
|
|
1794
|
+
expected_path: "/games/drum-sequencer"
|
|
1795
|
+
},
|
|
1796
|
+
{
|
|
1797
|
+
type: "selector_visible",
|
|
1798
|
+
selector: ".drum-sequencer h1"
|
|
1799
|
+
},
|
|
1800
|
+
{
|
|
1801
|
+
type: "no_horizontal_overflow"
|
|
1802
|
+
},
|
|
1803
|
+
{
|
|
1804
|
+
type: "no_fatal_console_errors"
|
|
1805
|
+
}
|
|
1806
|
+
],
|
|
1807
|
+
artifacts: [
|
|
1808
|
+
"screenshot",
|
|
1809
|
+
"console",
|
|
1810
|
+
"dom_summary",
|
|
1811
|
+
"proof_json"
|
|
1812
|
+
],
|
|
1813
|
+
baseline_policy: "invariant_only",
|
|
1814
|
+
failure_policy: {
|
|
1815
|
+
environment_blocked: "neutral",
|
|
1816
|
+
proof_insufficient: "review",
|
|
1817
|
+
needs_human_review: "review",
|
|
1818
|
+
product_regression: "fail"
|
|
1819
|
+
},
|
|
1820
|
+
metadata: {
|
|
1821
|
+
pack_id: "neon_step_sequencer",
|
|
1822
|
+
pack_public_name: "Neon Step Sequencer Pack",
|
|
1823
|
+
evidence_role_pattern: "interaction_snapshots",
|
|
1824
|
+
purpose: "Run a bounded loop, use an explicit operator-approval surrogate, apply the supported claim candidate, and preserve a listening-review packet.",
|
|
1825
|
+
required_receipts: [
|
|
1826
|
+
"ratchet loop returns ok",
|
|
1827
|
+
"a supported claim candidate is selected",
|
|
1828
|
+
"approved candidate application receipt is captured",
|
|
1829
|
+
"compact human-review packet is captured",
|
|
1830
|
+
"ranking remains review-order only",
|
|
1831
|
+
"listening-review caveat remains explicit"
|
|
1832
|
+
],
|
|
1833
|
+
does_not_prove: [
|
|
1834
|
+
"subjective mix quality",
|
|
1835
|
+
"that the approval surrogate is a real listener preference",
|
|
1836
|
+
"all possible mix edits"
|
|
1837
|
+
]
|
|
1838
|
+
}
|
|
1839
|
+
};
|
|
1840
|
+
|
|
1659
1841
|
// packs/neon-step-sequencer/profiles/ratchet-loop-mix-level-search.json
|
|
1660
1842
|
var ratchet_loop_mix_level_search_default = {
|
|
1661
1843
|
version: "riddle-proof.profile.v1",
|
|
@@ -2258,7 +2440,8 @@ var rawProfiles = {
|
|
|
2258
2440
|
"neon-step-sequencer-mobile-trainer-layout": mobile_trainer_layout_default,
|
|
2259
2441
|
"neon-step-sequencer-full-mix-health-matrix": full_mix_health_matrix_default,
|
|
2260
2442
|
"neon-step-sequencer-explore-songs-and-mixes": explore_songs_and_mixes_default,
|
|
2261
|
-
"neon-step-sequencer-ratchet-loop-mix-level-search": ratchet_loop_mix_level_search_default
|
|
2443
|
+
"neon-step-sequencer-ratchet-loop-mix-level-search": ratchet_loop_mix_level_search_default,
|
|
2444
|
+
"neon-step-sequencer-ratchet-loop-approved-candidate": ratchet_loop_approved_candidate_default
|
|
2262
2445
|
};
|
|
2263
2446
|
var sourcePathOverrides = Object.freeze({
|
|
2264
2447
|
"neon-step-sequencer-fast-mix-health": "packs/neon-step-sequencer/profiles/fast-mix-health.json",
|
|
@@ -2268,7 +2451,8 @@ var sourcePathOverrides = Object.freeze({
|
|
|
2268
2451
|
"neon-step-sequencer-mobile-trainer-layout": "packs/neon-step-sequencer/profiles/mobile-trainer-layout.json",
|
|
2269
2452
|
"neon-step-sequencer-full-mix-health-matrix": "packs/neon-step-sequencer/profiles/full-mix-health-matrix.json",
|
|
2270
2453
|
"neon-step-sequencer-explore-songs-and-mixes": "packs/neon-step-sequencer/profiles/explore-songs-and-mixes.json",
|
|
2271
|
-
"neon-step-sequencer-ratchet-loop-mix-level-search": "packs/neon-step-sequencer/profiles/ratchet-loop-mix-level-search.json"
|
|
2454
|
+
"neon-step-sequencer-ratchet-loop-mix-level-search": "packs/neon-step-sequencer/profiles/ratchet-loop-mix-level-search.json",
|
|
2455
|
+
"neon-step-sequencer-ratchet-loop-approved-candidate": "packs/neon-step-sequencer/profiles/ratchet-loop-approved-candidate.json"
|
|
2272
2456
|
});
|
|
2273
2457
|
var RIDDLE_PROOF_PACK_PROFILES = Object.freeze(
|
|
2274
2458
|
Object.fromEntries(
|
|
@@ -2415,6 +2599,7 @@ function formatHumanReviewPacketMarkdown(packet, options = {}) {
|
|
|
2415
2599
|
const guardrails = asRecord(packet.guardrails) ?? {};
|
|
2416
2600
|
const ranking = asRecord(packet.ranking) ?? {};
|
|
2417
2601
|
const request = asRecord(packet.request) ?? {};
|
|
2602
|
+
const approval = asRecord(request.approval) ?? {};
|
|
2418
2603
|
const supportedCandidates = asArray(packet.supportedCandidates);
|
|
2419
2604
|
const rejectedCandidates = asArray(packet.rejectedCandidates);
|
|
2420
2605
|
const selectedSong = getPath(packet, "target.selectedSong.selectedSong") ?? getPath(packet, "target.routeState.selectedSong");
|
|
@@ -2441,6 +2626,9 @@ function formatHumanReviewPacketMarkdown(packet, options = {}) {
|
|
|
2441
2626
|
`- state_restored_after_loop: ${formatCodeValue(guardrails.stateRestoredAfterLoop)}`,
|
|
2442
2627
|
`- candidate_actions_are_transient: ${formatCodeValue(request.candidateActionsAreTransient)}`,
|
|
2443
2628
|
`- no_permanent_edit_unless_apply_best: ${formatCodeValue(guardrails.noPermanentEditUnlessApplyBest)}`,
|
|
2629
|
+
`- approved_candidate_applied: ${formatCodeValue(guardrails.approvedCandidateApplied)}`,
|
|
2630
|
+
`- approval_mode: ${formatCodeValue(approval.mode)}`,
|
|
2631
|
+
`- approval_basis: ${formatValue(approval.basis)}`,
|
|
2444
2632
|
"",
|
|
2445
2633
|
"## Ranking",
|
|
2446
2634
|
"",
|
|
@@ -2478,12 +2666,225 @@ function createHumanReviewPacketArtifacts(proofOrPacket, options = {}) {
|
|
|
2478
2666
|
markdown
|
|
2479
2667
|
};
|
|
2480
2668
|
}
|
|
2669
|
+
|
|
2670
|
+
// src/durableCandidatePlan.ts
|
|
2671
|
+
var DEFAULT_APPROVAL_MODES = ["operator_approved", "mixing_canon_surrogate"];
|
|
2672
|
+
var DEFAULT_ACTION_TYPES = ["set_mixer_level"];
|
|
2673
|
+
var isRecord3 = (value) => Boolean(value) && typeof value === "object" && !Array.isArray(value);
|
|
2674
|
+
var asRecord2 = (value) => isRecord3(value) ? value : {};
|
|
2675
|
+
var getPath2 = (value, path) => {
|
|
2676
|
+
let cursor = value;
|
|
2677
|
+
for (const part of path.split(".")) {
|
|
2678
|
+
if (!isRecord3(cursor)) return void 0;
|
|
2679
|
+
cursor = cursor[part];
|
|
2680
|
+
}
|
|
2681
|
+
return cursor;
|
|
2682
|
+
};
|
|
2683
|
+
var asFiniteNumber = (value) => {
|
|
2684
|
+
if (value === null || value === void 0 || value === "") return null;
|
|
2685
|
+
if (typeof value !== "number" && typeof value !== "string") return null;
|
|
2686
|
+
const numeric = Number(value);
|
|
2687
|
+
return Number.isFinite(numeric) ? Number(numeric.toFixed(4)) : null;
|
|
2688
|
+
};
|
|
2689
|
+
var formatValue2 = (value) => {
|
|
2690
|
+
if (value === null || value === void 0 || value === "") return "not captured";
|
|
2691
|
+
if (typeof value === "number") return Number.isInteger(value) ? String(value) : String(Number(value.toFixed(4)));
|
|
2692
|
+
if (typeof value === "boolean") return value ? "true" : "false";
|
|
2693
|
+
return String(value);
|
|
2694
|
+
};
|
|
2695
|
+
var formatCodeValue2 = (value) => `\`${formatValue2(value)}\``;
|
|
2696
|
+
var selectedTargetLabel = (packet) => {
|
|
2697
|
+
const value = getPath2(packet, "target.selectedSong.selectedSong") ?? getPath2(packet, "target.routeState.selectedSong") ?? getPath2(packet, "target.label");
|
|
2698
|
+
return typeof value === "string" && value.trim() ? value : null;
|
|
2699
|
+
};
|
|
2700
|
+
var selectedRoute = (packet) => {
|
|
2701
|
+
const value = getPath2(packet, "target.routeState.route") ?? getPath2(packet, "target.routeState.path") ?? getPath2(packet, "target.route");
|
|
2702
|
+
return typeof value === "string" && value.trim() ? value : null;
|
|
2703
|
+
};
|
|
2704
|
+
var selectedMixProfileId = (packet) => {
|
|
2705
|
+
const value = getPath2(packet, "recommendation.candidate.summary.mixProfile.id") ?? getPath2(packet, "baseline.mixProfile.id") ?? getPath2(packet, "target.mixProfile.id");
|
|
2706
|
+
return typeof value === "string" && value.trim() ? value : null;
|
|
2707
|
+
};
|
|
2708
|
+
function createDurableCandidatePatchPlan(proofOrPacket, options = {}) {
|
|
2709
|
+
const packet = requireHumanReviewPacket(proofOrPacket);
|
|
2710
|
+
const recommendation = asRecord2(packet.recommendation);
|
|
2711
|
+
const candidate = asRecord2(recommendation.candidate);
|
|
2712
|
+
const action = asRecord2(candidate.action);
|
|
2713
|
+
const guardrails = asRecord2(packet.guardrails);
|
|
2714
|
+
const request = asRecord2(packet.request);
|
|
2715
|
+
const approval = asRecord2(request.approval);
|
|
2716
|
+
const ranking = asRecord2(packet.ranking);
|
|
2717
|
+
const proofBoundary = packet.proofBoundary;
|
|
2718
|
+
const target = {
|
|
2719
|
+
label: selectedTargetLabel(packet),
|
|
2720
|
+
route: selectedRoute(packet),
|
|
2721
|
+
mixProfileId: selectedMixProfileId(packet)
|
|
2722
|
+
};
|
|
2723
|
+
const actionType = action.type;
|
|
2724
|
+
const actionTrack = action.track;
|
|
2725
|
+
const from = asFiniteNumber(action.from);
|
|
2726
|
+
const to = asFiniteNumber(action.to);
|
|
2727
|
+
const numericDelta = asFiniteNumber(action.delta);
|
|
2728
|
+
const delta = numericDelta ?? (from !== null && to !== null ? asFiniteNumber(to - from) : null);
|
|
2729
|
+
const allowedApprovalModes = new Set(options.allowedApprovalModes ?? DEFAULT_APPROVAL_MODES);
|
|
2730
|
+
const allowedActionTypes = new Set(options.allowedActionTypes ?? DEFAULT_ACTION_TYPES);
|
|
2731
|
+
const errors = [];
|
|
2732
|
+
if (packet.status !== "candidate_applied_for_listening_review") {
|
|
2733
|
+
errors.push("packet status must be candidate_applied_for_listening_review");
|
|
2734
|
+
}
|
|
2735
|
+
if (recommendation.action !== "listen_to_applied_candidate") {
|
|
2736
|
+
errors.push("recommendation action must be listen_to_applied_candidate");
|
|
2737
|
+
}
|
|
2738
|
+
if (guardrails.approvedCandidateApplied !== true) {
|
|
2739
|
+
errors.push("approvedCandidateApplied guardrail must be true");
|
|
2740
|
+
}
|
|
2741
|
+
if (request.candidateActionsAreTransient !== false) {
|
|
2742
|
+
errors.push("candidateActionsAreTransient must be false before a durable patch handoff");
|
|
2743
|
+
}
|
|
2744
|
+
if (!approval.mode) {
|
|
2745
|
+
errors.push("approval mode is required");
|
|
2746
|
+
} else if (!allowedApprovalModes.has(String(approval.mode))) {
|
|
2747
|
+
errors.push(`approval mode ${formatValue2(approval.mode)} is not allowed for durable patch handoff`);
|
|
2748
|
+
}
|
|
2749
|
+
if (ranking.role !== "review_order_only") {
|
|
2750
|
+
errors.push("ranking role must remain review_order_only");
|
|
2751
|
+
}
|
|
2752
|
+
if (!String(proofBoundary ?? "").includes("musical taste still requires listening review")) {
|
|
2753
|
+
errors.push("proof boundary must preserve the listening-review caveat");
|
|
2754
|
+
}
|
|
2755
|
+
if (!actionType || !allowedActionTypes.has(String(actionType))) {
|
|
2756
|
+
errors.push(`action type ${formatValue2(actionType)} is not allowed for durable patch handoff`);
|
|
2757
|
+
}
|
|
2758
|
+
if (typeof actionTrack !== "string" || !actionTrack.trim()) {
|
|
2759
|
+
errors.push("candidate action track is required");
|
|
2760
|
+
}
|
|
2761
|
+
if (to === null) {
|
|
2762
|
+
errors.push("candidate action target value is required");
|
|
2763
|
+
}
|
|
2764
|
+
if (String(actionType) === "set_mixer_level" && (to === null || to < 0 || to > 1.5)) {
|
|
2765
|
+
errors.push("set_mixer_level target must be between 0 and 1.5");
|
|
2766
|
+
}
|
|
2767
|
+
if (options.requireTargetLabel !== false && !target.label) {
|
|
2768
|
+
errors.push("target label is required for a scoped durable patch handoff");
|
|
2769
|
+
}
|
|
2770
|
+
if (options.requireMixProfileId === true && !target.mixProfileId) {
|
|
2771
|
+
errors.push("mixProfileId is required for this durable patch handoff");
|
|
2772
|
+
}
|
|
2773
|
+
const actionShape = {
|
|
2774
|
+
type: actionType ?? null,
|
|
2775
|
+
track: actionTrack ?? null,
|
|
2776
|
+
from,
|
|
2777
|
+
to,
|
|
2778
|
+
delta
|
|
2779
|
+
};
|
|
2780
|
+
const mixerLevels = !errors.length && String(actionType) === "set_mixer_level" && typeof actionTrack === "string" && to !== null ? { [actionTrack]: to } : null;
|
|
2781
|
+
return {
|
|
2782
|
+
version: "riddle-proof.durable-candidate-patch-plan.v1",
|
|
2783
|
+
kind: "durable_candidate_patch_plan",
|
|
2784
|
+
status: errors.length ? "not_ready_for_durable_patch" : "ready_for_durable_patch",
|
|
2785
|
+
ok: errors.length === 0,
|
|
2786
|
+
errors,
|
|
2787
|
+
source: {
|
|
2788
|
+
packetStatus: packet.status ?? null,
|
|
2789
|
+
recommendationAction: recommendation.action ?? null,
|
|
2790
|
+
rankingRole: ranking.role ?? null,
|
|
2791
|
+
proofBoundary: proofBoundary ?? null
|
|
2792
|
+
},
|
|
2793
|
+
target,
|
|
2794
|
+
candidate: {
|
|
2795
|
+
label: candidate.label ?? null,
|
|
2796
|
+
action: actionShape
|
|
2797
|
+
},
|
|
2798
|
+
approval: {
|
|
2799
|
+
mode: approval.mode ?? null,
|
|
2800
|
+
approvedBy: approval.approvedBy ?? null,
|
|
2801
|
+
basis: approval.basis ?? null
|
|
2802
|
+
},
|
|
2803
|
+
durableEdit: errors.length ? null : {
|
|
2804
|
+
sourceFile: options.sourceFile ?? null,
|
|
2805
|
+
target,
|
|
2806
|
+
action: actionShape,
|
|
2807
|
+
mixerLevels,
|
|
2808
|
+
provenance: {
|
|
2809
|
+
humanReviewPacketStatus: packet.status ?? null,
|
|
2810
|
+
recommendationLabel: candidate.label ?? null,
|
|
2811
|
+
approvalMode: approval.mode ?? null,
|
|
2812
|
+
approvedBy: approval.approvedBy ?? null,
|
|
2813
|
+
basis: approval.basis ?? null
|
|
2814
|
+
},
|
|
2815
|
+
doesNotProve: [
|
|
2816
|
+
"subjective mix quality",
|
|
2817
|
+
"that the approval surrogate is a real listener preference",
|
|
2818
|
+
"all possible candidate edits"
|
|
2819
|
+
]
|
|
2820
|
+
},
|
|
2821
|
+
boundary: "This is a durable patch handoff for an approved listening-review candidate. It does not prove subjective mix quality.",
|
|
2822
|
+
caveats: [
|
|
2823
|
+
"A durable patch plan is not a taste verdict.",
|
|
2824
|
+
"Ranking orders review only; it is not a universal mix-quality score.",
|
|
2825
|
+
"Run a final current-target proof after the durable edit lands."
|
|
2826
|
+
]
|
|
2827
|
+
};
|
|
2828
|
+
}
|
|
2829
|
+
function formatDurableCandidatePatchPlanMarkdown(plan, options = {}) {
|
|
2830
|
+
if (plan.kind !== "durable_candidate_patch_plan") {
|
|
2831
|
+
throw new Error("Expected a durable_candidate_patch_plan");
|
|
2832
|
+
}
|
|
2833
|
+
const lines = [
|
|
2834
|
+
`# ${options.title ?? "Durable Candidate Patch Plan"}`,
|
|
2835
|
+
"",
|
|
2836
|
+
`- status: ${formatCodeValue2(plan.status)}`,
|
|
2837
|
+
`- ok: ${formatCodeValue2(plan.ok)}`,
|
|
2838
|
+
`- target_label: ${formatValue2(plan.target.label)}`,
|
|
2839
|
+
`- mix_profile_id: ${formatCodeValue2(plan.target.mixProfileId)}`,
|
|
2840
|
+
`- source_file: ${formatCodeValue2(plan.durableEdit?.sourceFile)}`,
|
|
2841
|
+
"",
|
|
2842
|
+
"## Candidate",
|
|
2843
|
+
"",
|
|
2844
|
+
`- label: ${formatCodeValue2(plan.candidate.label)}`,
|
|
2845
|
+
`- action: ${formatCodeValue2(`${formatValue2(plan.candidate.action.type)} ${formatValue2(plan.candidate.action.track)}: ${formatValue2(plan.candidate.action.from)} -> ${formatValue2(plan.candidate.action.to)} (${formatValue2(plan.candidate.action.delta)})`)}`,
|
|
2846
|
+
"",
|
|
2847
|
+
"## Approval Boundary",
|
|
2848
|
+
"",
|
|
2849
|
+
`- approval_mode: ${formatCodeValue2(plan.approval.mode)}`,
|
|
2850
|
+
`- approved_by: ${formatCodeValue2(plan.approval.approvedBy)}`,
|
|
2851
|
+
`- basis: ${formatValue2(plan.approval.basis)}`,
|
|
2852
|
+
`- boundary: ${formatValue2(plan.boundary)}`,
|
|
2853
|
+
"",
|
|
2854
|
+
"## Durable Edit",
|
|
2855
|
+
"",
|
|
2856
|
+
`- mixer_levels: ${formatCodeValue2(JSON.stringify(plan.durableEdit?.mixerLevels ?? null))}`
|
|
2857
|
+
];
|
|
2858
|
+
if (plan.errors.length) {
|
|
2859
|
+
lines.push("", "## Errors", "");
|
|
2860
|
+
for (const error of plan.errors) lines.push(`- ${error}`);
|
|
2861
|
+
}
|
|
2862
|
+
lines.push("", "## Caveats", "");
|
|
2863
|
+
for (const caveat of plan.caveats) lines.push(`- ${caveat}`);
|
|
2864
|
+
return `${lines.join("\n")}
|
|
2865
|
+
`;
|
|
2866
|
+
}
|
|
2867
|
+
function createDurableCandidatePatchPlanArtifacts(proofOrPacket, options = {}) {
|
|
2868
|
+
const plan = createDurableCandidatePatchPlan(proofOrPacket, options);
|
|
2869
|
+
const markdown = formatDurableCandidatePatchPlanMarkdown(plan, {
|
|
2870
|
+
title: options.title
|
|
2871
|
+
});
|
|
2872
|
+
return {
|
|
2873
|
+
plan,
|
|
2874
|
+
json: `${JSON.stringify(plan, null, 2)}
|
|
2875
|
+
`,
|
|
2876
|
+
markdown
|
|
2877
|
+
};
|
|
2878
|
+
}
|
|
2481
2879
|
// Annotate the CommonJS export names for ESM import in node:
|
|
2482
2880
|
0 && (module.exports = {
|
|
2483
2881
|
RIDDLE_PROOF_PACK_MANIFEST,
|
|
2484
2882
|
RIDDLE_PROOF_PACK_PROFILES,
|
|
2883
|
+
createDurableCandidatePatchPlan,
|
|
2884
|
+
createDurableCandidatePatchPlanArtifacts,
|
|
2485
2885
|
createHumanReviewPacketArtifacts,
|
|
2486
2886
|
findHumanReviewPacket,
|
|
2887
|
+
formatDurableCandidatePatchPlanMarkdown,
|
|
2487
2888
|
formatHumanReviewPacketMarkdown,
|
|
2488
2889
|
getPackEnabledRiddleProofPackProfiles,
|
|
2489
2890
|
getRiddleProofPackProfile,
|
package/dist/index.d.cts
CHANGED
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
import * as _riddledc_riddle_proof from '@riddledc/riddle-proof';
|
|
2
2
|
import { RiddleProofProfile } from '@riddledc/riddle-proof';
|
|
3
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';
|
|
4
|
+
export { D as DurableCandidatePatchPlan, a as DurableCandidatePatchPlanArtifacts, b as DurableCandidatePatchPlanOptions, c as createDurableCandidatePatchPlan, d as createDurableCandidatePatchPlanArtifacts, f as formatDurableCandidatePatchPlanMarkdown } from './durableCandidatePlan-Dv2P33Wg.cjs';
|
|
4
5
|
|
|
5
6
|
interface RiddleProofPackProfileManifest {
|
|
6
7
|
/** Profile slug and canonical manifest key. */
|
package/dist/index.d.ts
CHANGED
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
import * as _riddledc_riddle_proof from '@riddledc/riddle-proof';
|
|
2
2
|
import { RiddleProofProfile } from '@riddledc/riddle-proof';
|
|
3
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';
|
|
4
|
+
export { D as DurableCandidatePatchPlan, a as DurableCandidatePatchPlanArtifacts, b as DurableCandidatePatchPlanOptions, c as createDurableCandidatePatchPlan, d as createDurableCandidatePatchPlanArtifacts, f as formatDurableCandidatePatchPlanMarkdown } from './durableCandidatePlan-Dv2P33Wg.js';
|
|
4
5
|
|
|
5
6
|
interface RiddleProofPackProfileManifest {
|
|
6
7
|
/** Profile slug and canonical manifest key. */
|