planr 1.4.0 → 1.5.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (60) hide show
  1. package/README.md +21 -61
  2. package/docs/ARCHITECTURE.md +4 -4
  3. package/docs/CLAUDE_CODE.md +2 -2
  4. package/docs/CLI_REFERENCE.md +6 -14
  5. package/docs/CODEX.md +6 -6
  6. package/docs/CURSOR.md +2 -2
  7. package/docs/EXAMPLE_WEBAPP.md +63 -97
  8. package/docs/GOALS.md +8 -25
  9. package/docs/INSTALL.md +3 -3
  10. package/docs/MCP_CONTRACT.md +6 -9
  11. package/docs/MODEL_ROUTING.md +20 -177
  12. package/docs/RELEASE.md +1 -1
  13. package/docs/ROUTING_BUNDLES.md +32 -0
  14. package/docs/SKILLS.md +35 -50
  15. package/docs/documentation/CONTRACT.md +164 -0
  16. package/docs/documentation/COVERAGE.md +91 -0
  17. package/docs/documentation/INFORMATION_ARCHITECTURE.md +147 -0
  18. package/docs/fixtures/mcp-contract.json +3 -11
  19. package/npm/native/darwin-arm64/planr +0 -0
  20. package/npm/native/darwin-x86_64/planr +0 -0
  21. package/npm/native/linux-arm64/planr +0 -0
  22. package/npm/native/linux-x86_64/planr +0 -0
  23. package/package.json +25 -14
  24. package/plugins/planr/.claude-plugin/plugin.json +1 -1
  25. package/plugins/planr/.codex-plugin/plugin.json +2 -2
  26. package/plugins/planr/skills/planr-loop/SKILL.md +1 -1
  27. package/docs/PRESET_COMPOSITION.md +0 -109
  28. package/docs/PRESET_EVALUATION.md +0 -118
  29. package/docs/PRESET_REGISTRY.md +0 -61
  30. package/evaluations/preset-suite-v1.toml +0 -127
  31. package/evaluations/sol-luna-codex-v1.toml +0 -42
  32. package/plugins/planr/skills/planr-loop/agents/planr-reviewer.toml +0 -23
  33. package/plugins/planr/skills/planr-loop/agents/planr-worker.toml +0 -21
  34. package/presets/bindings/claude-native.toml +0 -52
  35. package/presets/bindings/codex-openai.toml +0 -56
  36. package/presets/bindings/cursor-fable-grok.toml +0 -49
  37. package/presets/bindings/cursor-openai.toml +0 -49
  38. package/presets/bindings/mixed-host.toml +0 -64
  39. package/presets/policies/balanced.toml +0 -50
  40. package/presets/policies/low-usage.toml +0 -50
  41. package/presets/policies/max-quality.toml +0 -50
  42. package/presets/policies/read-only-audit.toml +0 -50
  43. package/website/README.md +0 -79
  44. package/website/_headers +0 -7
  45. package/website/alchemy-runtime.test.mjs +0 -21
  46. package/website/app.mjs +0 -216
  47. package/website/build-catalog.mjs +0 -135
  48. package/website/build-site.test.mjs +0 -69
  49. package/website/catalog-model.mjs +0 -185
  50. package/website/catalog-model.test.mjs +0 -124
  51. package/website/cloudflare-launcher.test.mjs +0 -38
  52. package/website/data/catalog.json +0 -307
  53. package/website/index.html +0 -122
  54. package/website/registry/manifest.toml +0 -48
  55. package/website/registry/report.md +0 -33
  56. package/website/registry/trusted-maintainers.toml +0 -6
  57. package/website/registry/verification.json +0 -7258
  58. package/website/serve.mjs +0 -41
  59. package/website/styles.css +0 -201
  60. package/website/test-fixtures/recommended.json +0 -72
@@ -1,49 +0,0 @@
1
- schema_version = 1
2
- id = "cursor-openai"
3
- version = "1.0.0"
4
- host = "cursor"
5
- driver_role = "driver"
6
- default_role = "driver"
7
- capability_evidence = ["builtin-cursor-project-agent-contract"]
8
- billing_assumptions = ["Planr records declared tiers; Cursor remains billing authority"]
9
- known_limitations = ["workspace policy or Max Mode may override the requested model"]
10
-
11
- [capabilities]
12
- model_override = true
13
- effort_override = false
14
- fork_none = true
15
- fork_all = false
16
-
17
- [profiles.driver]
18
- profile = "cursor-openai-driver"
19
- client = "cursor"
20
- model = "gpt-5.5"
21
- cost_tier = "premium"
22
-
23
- [profiles.worker]
24
- profile = "cursor-openai-worker"
25
- client = "cursor"
26
- model = "gpt-5.4-mini"
27
- cost_tier = "standard"
28
- skill = "planr-work"
29
- fork_turns = { mode = "none" }
30
-
31
- [[routes]]
32
- work_type = "code"
33
- role = "worker"
34
- fallback_roles = ["driver"]
35
-
36
- [verification]
37
- id = "builtin-cursor-openai-v1"
38
- verified_at_unix = 1783987200
39
- max_age_seconds = 31536000
40
-
41
- [[artifacts]]
42
- path = ".cursor/agents/planr-preset-worker.md"
43
- kind = "cursor_agent"
44
- content = '''---
45
- name: planr-preset-worker
46
- model: gpt-5.4-mini
47
- ---
48
- Use the planr-work skill and preserve Planr evidence.
49
- '''
@@ -1,64 +0,0 @@
1
- schema_version = 1
2
- id = "mixed-host"
3
- version = "1.0.0"
4
- host = "mixed-host"
5
- driver_role = "driver"
6
- default_role = "driver"
7
- capability_evidence = ["builtin-explicit-cross-client-contract"]
8
- billing_assumptions = ["Each host remains authoritative for its own billing and availability"]
9
- known_limitations = ["effective model evidence must be collected independently from each host"]
10
-
11
- [capabilities]
12
- model_override = true
13
- effort_override = true
14
- fork_none = true
15
- fork_all = false
16
-
17
- [profiles.driver]
18
- profile = "mixed-cursor-driver"
19
- client = "cursor"
20
- model = "fable-5"
21
- cost_tier = "premium"
22
-
23
- [profiles.worker]
24
- profile = "mixed-codex-worker"
25
- client = "codex"
26
- model = "gpt-5.4-mini"
27
- effort = "high"
28
- cost_tier = "standard"
29
- skill = "planr-work"
30
- fork_turns = { mode = "none" }
31
-
32
- [[routes]]
33
- work_type = "code"
34
- role = "worker"
35
- fallback_roles = ["driver"]
36
-
37
- [verification]
38
- id = "builtin-mixed-host-v1"
39
- verified_at_unix = 1783987200
40
- max_age_seconds = 31536000
41
-
42
- [[artifacts]]
43
- path = ".cursor/agents/planr-preset-driver.md"
44
- kind = "cursor_agent"
45
- content = '''---
46
- name: planr-preset-driver
47
- model: fable-5
48
- ---
49
- Drive the Planr map and keep final verdict ownership.
50
- '''
51
-
52
- [[artifacts]]
53
- path = ".codex/agents/planr-preset-worker.toml"
54
- kind = "codex_agent"
55
- content = '''name = "planr_preset_worker"
56
- description = "Implements one picked Planr map item with evidence-backed handoff."
57
- model = "gpt-5.4-mini"
58
- model_reasoning_effort = "high"
59
- sandbox_mode = "workspace-write"
60
-
61
- developer_instructions = """
62
- Use the planr-work skill for exactly one picked item. Preserve the task scope, record changed files and real verification commands, request review, and stop.
63
- """
64
- '''
@@ -1,50 +0,0 @@
1
- schema_version = 1
2
- id = "balanced"
3
- version = "1.0.0"
4
-
5
- [usage]
6
- max_active_agents = 3
7
- max_parallel_readers = 2
8
- max_parallel_writers = 1
9
- max_depth = 1
10
- max_attempts = 4
11
- max_wall_time_seconds = 3600
12
- max_tool_calls = 120
13
- review_reserve_percent = 20
14
- budget_exhaustion = "stop"
15
- metering = "estimated"
16
-
17
- [transitions.retry]
18
- max_same_route_retries = 1
19
-
20
- [transitions.availability_fallback]
21
- max_fallbacks = 1
22
- require_same_capability_class = true
23
-
24
- [transitions.quality_escalation]
25
- max_escalations = 1
26
- require_verification_evidence = true
27
-
28
- [transitions.quota_downgrade]
29
- enabled = false
30
- max_downgrades = 0
31
- noncritical_only = true
32
-
33
- [transitions.safety_stop]
34
- enabled = true
35
-
36
- [materiality]
37
- changed_files_threshold = 10
38
- changed_lines_threshold = 500
39
-
40
- [execution]
41
- max_read_scope_entries = 8
42
- max_write_scope_entries = 4
43
-
44
- [execution.roles.worker]
45
- tools = ["cargo", "git", "rg"]
46
-
47
- [execution.roles.worker.filesystem]
48
- read_roots = ["src", "tests", "docs"]
49
- write_roots = ["src", "tests", "docs"]
50
- allow_overwrite = false
@@ -1,50 +0,0 @@
1
- schema_version = 1
2
- id = "low-usage"
3
- version = "1.0.0"
4
-
5
- [usage]
6
- max_active_agents = 2
7
- max_parallel_readers = 1
8
- max_parallel_writers = 1
9
- max_depth = 1
10
- max_attempts = 3
11
- max_wall_time_seconds = 1800
12
- max_tool_calls = 60
13
- review_reserve_percent = 25
14
- budget_exhaustion = "downgrade_noncritical"
15
- metering = "estimated"
16
-
17
- [transitions.retry]
18
- max_same_route_retries = 0
19
-
20
- [transitions.availability_fallback]
21
- max_fallbacks = 1
22
- require_same_capability_class = true
23
-
24
- [transitions.quality_escalation]
25
- max_escalations = 1
26
- require_verification_evidence = true
27
-
28
- [transitions.quota_downgrade]
29
- enabled = true
30
- max_downgrades = 1
31
- noncritical_only = true
32
-
33
- [transitions.safety_stop]
34
- enabled = true
35
-
36
- [materiality]
37
- changed_files_threshold = 6
38
- changed_lines_threshold = 250
39
-
40
- [execution]
41
- max_read_scope_entries = 6
42
- max_write_scope_entries = 3
43
-
44
- [execution.roles.worker]
45
- tools = ["cargo", "git", "rg"]
46
-
47
- [execution.roles.worker.filesystem]
48
- read_roots = ["src", "tests", "docs"]
49
- write_roots = ["src", "tests", "docs"]
50
- allow_overwrite = false
@@ -1,50 +0,0 @@
1
- schema_version = 1
2
- id = "max-quality"
3
- version = "1.0.0"
4
-
5
- [usage]
6
- max_active_agents = 4
7
- max_parallel_readers = 3
8
- max_parallel_writers = 1
9
- max_depth = 1
10
- max_attempts = 5
11
- max_wall_time_seconds = 7200
12
- max_tool_calls = 240
13
- review_reserve_percent = 40
14
- budget_exhaustion = "stop"
15
- metering = "estimated"
16
-
17
- [transitions.retry]
18
- max_same_route_retries = 1
19
-
20
- [transitions.availability_fallback]
21
- max_fallbacks = 1
22
- require_same_capability_class = true
23
-
24
- [transitions.quality_escalation]
25
- max_escalations = 2
26
- require_verification_evidence = true
27
-
28
- [transitions.quota_downgrade]
29
- enabled = false
30
- max_downgrades = 0
31
- noncritical_only = true
32
-
33
- [transitions.safety_stop]
34
- enabled = true
35
-
36
- [materiality]
37
- changed_files_threshold = 5
38
- changed_lines_threshold = 200
39
-
40
- [execution]
41
- max_read_scope_entries = 12
42
- max_write_scope_entries = 6
43
-
44
- [execution.roles.worker]
45
- tools = ["cargo", "git", "rg"]
46
-
47
- [execution.roles.worker.filesystem]
48
- read_roots = ["src", "tests", "docs"]
49
- write_roots = ["src", "tests", "docs"]
50
- allow_overwrite = false
@@ -1,50 +0,0 @@
1
- schema_version = 1
2
- id = "read-only-audit"
3
- version = "1.0.0"
4
-
5
- [usage]
6
- max_active_agents = 3
7
- max_parallel_readers = 3
8
- max_parallel_writers = 0
9
- max_depth = 1
10
- max_attempts = 2
11
- max_wall_time_seconds = 1800
12
- max_tool_calls = 80
13
- review_reserve_percent = 20
14
- budget_exhaustion = "stop"
15
- metering = "estimated"
16
-
17
- [transitions.retry]
18
- max_same_route_retries = 0
19
-
20
- [transitions.availability_fallback]
21
- max_fallbacks = 1
22
- require_same_capability_class = true
23
-
24
- [transitions.quality_escalation]
25
- max_escalations = 0
26
- require_verification_evidence = true
27
-
28
- [transitions.quota_downgrade]
29
- enabled = false
30
- max_downgrades = 0
31
- noncritical_only = true
32
-
33
- [transitions.safety_stop]
34
- enabled = true
35
-
36
- [materiality]
37
- changed_files_threshold = 1
38
- changed_lines_threshold = 1
39
-
40
- [execution]
41
- max_read_scope_entries = 12
42
- max_write_scope_entries = 1
43
-
44
- [execution.roles.worker]
45
- tools = ["git", "rg"]
46
-
47
- [execution.roles.worker.filesystem]
48
- read_roots = ["src", "tests", "docs"]
49
- write_roots = []
50
- allow_overwrite = false
package/website/README.md DELETED
@@ -1,79 +0,0 @@
1
- # Planr Preset Catalog
2
-
3
- This directory is a dependency-free static website. Production catalog data is never authored by hand: `build-catalog.mjs` invokes Planr's canonical registry verifier, requires a trusted maintainer signature and safe policy/binding preview, binds status to the evaluation report, and writes `data/catalog.json`.
4
-
5
- The committed catalog is generated from the included `registry/manifest.toml`, canonical `registry/verification.json`, and separately pinned public maintainer trust store. Its private release and telemetry signing keys are intentionally not committed. If verification expires, is deprecated, or no longer earns recommendation, the generated catalog preserves the visible lifecycle state instead of inventing or retaining a recommendation.
6
-
7
- ```sh
8
- node website/build-catalog.mjs \
9
- --planr-bin ./target/release/planr \
10
- --manifest website/registry/manifest.toml \
11
- --content-root . \
12
- --trust-store website/registry/trusted-maintainers.toml \
13
- --entry balanced-codex=codex \
14
- --at-unix 1783987200 \
15
- --output website/data/catalog.json
16
-
17
- npm run site:test
18
- npm run site:serve
19
- ```
20
-
21
- ## Cloudflare test deployment
22
-
23
- Cloudflare infrastructure is owned by the repository-root `alchemy.run.ts`. The
24
- deployment publishes a clean `dist/website` containing only runtime assets; tests,
25
- fixtures, registry inputs, trust stores, and build tooling are never uploaded.
26
-
27
- Install the pinned development dependency and authenticate Cloudflare using an existing
28
- Alchemy/Cloudflare profile, Wrangler login, or a least-privilege API token. Set the
29
- account id from `.env.example` in the process environment when account inference would
30
- be ambiguous. Planr never runs login/configure commands and never changes user-level
31
- configuration. This static stack has no secret bindings, so it deliberately requires no
32
- `ALCHEMY_PASSWORD` or repository-local secret file.
33
-
34
- The published Planr CLI retains its declared Node.js 18+ compatibility. Repository
35
- dependency installation and the separate Cloudflare deployment toolchain require Node.js
36
- 22+ because the pinned pnpm/Alchemy lockfile contains current tooling with that minimum.
37
- Select Node 22 or newer before invoking pnpm. On an unknown machine, this pnpm-free
38
- preflight is safe to run first even with Node 18 or 20:
39
-
40
- ```sh
41
- node scripts/check-alchemy-runtime.mjs
42
- ```
43
-
44
- The authoritative deployment launcher performs the same check before it starts pnpm or
45
- Alchemy, so older runtimes receive Planr's error instead of a Corepack or dependency crash.
46
-
47
- ```sh
48
- pnpm install
49
- pnpm site:check
50
- node scripts/cloudflare-test.mjs deploy
51
- ```
52
-
53
- After Node 22+ is active, `pnpm deploy:test` is an equivalent convenience alias.
54
-
55
- The committed `pnpm-workspace.yaml` is a repository-only dependency security policy:
56
- it allows the `esbuild` and `workerd` install scripts required by Alchemy and explicitly
57
- keeps the unused transitive `sharp` build disabled. It does not modify global pnpm state.
58
-
59
- `deploy:test` always targets the isolated Alchemy stage `test`. It creates a standalone
60
- Cloudflare Worker website and prints its Cloudflare-assigned `workers.dev` URL. The
61
- initial deployment deliberately configures no custom domain, DNS route, backend resource,
62
- or adoption of an existing Worker.
63
-
64
- Removing that test website is an explicit, separate operation:
65
-
66
- ```sh
67
- node scripts/cloudflare-test.mjs destroy
68
- ```
69
-
70
- After Node 22+ is active, `pnpm destroy:test` is an equivalent convenience alias.
71
-
72
- Never add private registry or telemetry signing keys to the deployment environment. The
73
- site deploy consumes only the already verified public `website/data/catalog.json`.
74
-
75
- Release operators must regenerate the evaluation report through `planr agents preset evaluate` with an independently pinned telemetry collector, update the manifest artifact digest, and sign the registry entry with the corresponding offline maintainer key before rebuilding this file. The public `registry/report.md` summarizes that evidence; the machine report and signature remain the verification source of truth.
76
-
77
- The report-wide `reproducible_evidence` flag summarizes the entire candidate matrix. Registry publication independently requires the selected candidate's complete reproducible evidence, passing thresholds, verified route receipts, and matching entry in `report.recommended`; candidates that fail those gates are not published as recommendations.
78
-
79
- The localhost-only `?fixture=recommended` query remains available for isolated UI regression checks. It is visibly labeled, ignored on non-local hosts, and never substitutes for live verification of the production `data/catalog.json` path.
package/website/_headers DELETED
@@ -1,7 +0,0 @@
1
- /*
2
- Cache-Control: public, max-age=0, must-revalidate
3
- Content-Security-Policy: default-src 'self'; script-src 'self'; style-src 'self'; img-src 'self' data:; connect-src 'self'; base-uri 'none'; form-action 'none'; frame-ancestors 'none'
4
- Permissions-Policy: camera=(), geolocation=(), microphone=(), payment=(), usb=()
5
- Referrer-Policy: no-referrer
6
- X-Content-Type-Options: nosniff
7
- X-Frame-Options: DENY
@@ -1,21 +0,0 @@
1
- import assert from "node:assert/strict";
2
- import test from "node:test";
3
- import {
4
- assertAlchemyRuntime,
5
- MINIMUM_ALCHEMY_NODE_MAJOR,
6
- } from "../scripts/check-alchemy-runtime.mjs";
7
-
8
- test("accepts the minimum supported Alchemy deployment runtime", () => {
9
- assert.equal(assertAlchemyRuntime("22.0.0"), MINIMUM_ALCHEMY_NODE_MAJOR);
10
- });
11
-
12
- test("rejects Node runtimes supported by the Planr CLI but not by Alchemy", () => {
13
- assert.throws(
14
- () => assertAlchemyRuntime("18.16.1"),
15
- /Cloudflare deployment requires Node\.js 22 or newer; current runtime is 18\.16\.1/,
16
- );
17
- assert.throws(
18
- () => assertAlchemyRuntime("20.19.5"),
19
- /Cloudflare deployment requires Node\.js 22 or newer/,
20
- );
21
- });
package/website/app.mjs DELETED
@@ -1,216 +0,0 @@
1
- import { formatBasisPoints, previewCommand, statusLabel, visibleCompositions } from "./catalog-model.mjs";
2
-
3
- const nodes = {
4
- selectA: document.querySelector("#composition-a"),
5
- selectB: document.querySelector("#composition-b"),
6
- cardA: document.querySelector("#comparison-a"),
7
- cardB: document.querySelector("#comparison-b"),
8
- comparison: document.querySelector("#comparison"),
9
- empty: document.querySelector("#empty-state"),
10
- emptyMessage: document.querySelector("#empty-message"),
11
- filter: document.querySelector("#recommended-only"),
12
- published: document.querySelector("#stat-published"),
13
- recommended: document.querySelector("#stat-recommended"),
14
- trust: document.querySelector("#stat-trust"),
15
- generated: document.querySelector("#generated-at"),
16
- copyStatus: document.querySelector("#copy-status"),
17
- fixtureBanner: document.querySelector("#fixture-banner"),
18
- };
19
-
20
- function catalogLocation() {
21
- const local = ["127.0.0.1", "localhost"].includes(location.hostname);
22
- const fixture = new URLSearchParams(location.search).get("fixture");
23
- if (local && fixture === "recommended") {
24
- nodes.fixtureBanner.hidden = false;
25
- return "./test-fixtures/recommended.json";
26
- }
27
- return "./data/catalog.json";
28
- }
29
-
30
- function text(parent, element, value, className) {
31
- const node = document.createElement(element);
32
- if (className) node.className = className;
33
- node.textContent = value;
34
- parent.append(node);
35
- return node;
36
- }
37
-
38
- function formatDate(unix) {
39
- if (!Number.isFinite(unix)) return "Not published";
40
- return new Intl.DateTimeFormat("en", { dateStyle: "medium", timeZone: "UTC" }).format(new Date(unix * 1000));
41
- }
42
-
43
- function formatNumber(value) {
44
- return Number.isFinite(Number(value)) ? new Intl.NumberFormat("en").format(Number(value)) : "—";
45
- }
46
-
47
- function optionLabel(entry) {
48
- return `${entry.policy.id} + ${entry.binding.id} · ${statusLabel(entry.status)}`;
49
- }
50
-
51
- function fillSelect(select, entries, preferredIndex) {
52
- const previous = select.value;
53
- select.replaceChildren();
54
- for (const entry of entries) {
55
- const option = document.createElement("option");
56
- option.value = entry.id;
57
- option.textContent = optionLabel(entry);
58
- select.append(option);
59
- }
60
- select.value = entries.some((entry) => entry.id === previous) ? previous : entries[Math.min(preferredIndex, entries.length - 1)]?.id ?? "";
61
- }
62
-
63
- function metric(parent, label, value) {
64
- const wrapper = document.createElement("div");
65
- wrapper.className = "metric";
66
- text(wrapper, "span", label);
67
- text(wrapper, "strong", value);
68
- parent.append(wrapper);
69
- }
70
-
71
- function section(parent, title) {
72
- const wrapper = document.createElement("section");
73
- wrapper.className = "card-section";
74
- text(wrapper, "h4", title);
75
- parent.append(wrapper);
76
- return wrapper;
77
- }
78
-
79
- function definitionRow(list, termValue, detailValue) {
80
- const row = document.createElement("div");
81
- text(row, "dt", termValue);
82
- text(row, "dd", detailValue);
83
- list.append(row);
84
- }
85
-
86
- function renderCard(card, entry) {
87
- card.replaceChildren();
88
- if (!entry) return;
89
- card.dataset.compositionId = entry.id;
90
-
91
- const top = document.createElement("div");
92
- top.className = "card-top";
93
- const title = document.createElement("div");
94
- text(title, "span", `${entry.binding.id} · ${entry.binding.host}`, "binding-name");
95
- text(title, "h3", entry.policy.id);
96
- const badge = text(top, "span", statusLabel(entry.status), `badge status-${entry.status}`);
97
- badge.setAttribute("aria-label", `Status: ${statusLabel(entry.status)}`);
98
- top.prepend(title);
99
- card.append(top);
100
- text(card, "p", `Policy ${entry.policy.version} · Binding ${entry.binding.version} · Entry ${entry.entryVersion}`, "meta-line");
101
-
102
- const metrics = document.createElement("div");
103
- metrics.className = "metric-grid";
104
- metric(metrics, "Active agents", formatNumber(entry.policy.usage.max_active_agents));
105
- metric(metrics, "Parallel writers", formatNumber(entry.policy.usage.max_parallel_writers));
106
- metric(metrics, "Max depth", formatNumber(entry.policy.usage.max_depth));
107
- metric(metrics, "Metering", entry.policy.usage.metering ?? "unavailable");
108
- card.append(metrics);
109
-
110
- const compatibility = section(card, "Compatibility");
111
- const compatibilityList = document.createElement("dl");
112
- compatibilityList.className = "compatibility-list";
113
- definitionRow(
114
- compatibilityList,
115
- "Supported hosts",
116
- entry.compatibility.hosts?.length ? entry.compatibility.hosts.join(", ") : "No compatible host declared",
117
- );
118
- definitionRow(
119
- compatibilityList,
120
- "Planr versions",
121
- `${entry.compatibility.minPlanrVersion ?? "Any"} through ${entry.compatibility.maxPlanrVersion ?? "latest"}`,
122
- );
123
- definitionRow(
124
- compatibilityList,
125
- "Lifecycle",
126
- entry.replacement
127
- ? `${statusLabel(entry.status)}; replace with ${entry.replacement}`
128
- : statusLabel(entry.status),
129
- );
130
- compatibility.append(compatibilityList);
131
-
132
- const enforcement = section(card, "Enforcement matrix");
133
- const list = document.createElement("dl");
134
- list.className = "enforcement-list";
135
- for (const item of entry.enforcement) {
136
- const row = document.createElement("div");
137
- const term = text(row, "dt", item.dimension);
138
- text(term, "span", item.state.replaceAll("_", " "), "state");
139
- text(row, "dd", item.detail);
140
- list.append(row);
141
- }
142
- enforcement.append(list);
143
-
144
- const evidence = section(card, "Evaluation & provenance");
145
- text(evidence, "p", `${entry.evaluation.suiteId} ${entry.evaluation.suiteVersion} · evaluated ${formatDate(entry.evaluation.evaluatedAtUnix)} · review ${formatDate(entry.evaluation.reviewAtUnix)}`, "meta-line");
146
- text(evidence, "p", `Quality ${formatBasisPoints(entry.evaluation.metrics?.average_quality_score_bps)} · runs ${formatNumber(entry.evaluation.metrics?.runs)} · oracle passes ${formatNumber(entry.evaluation.metrics?.oracle_passes)}`, "meta-line");
147
- text(evidence, "p", `Manifest ${entry.registry.manifestSha256}`, "hash");
148
- text(evidence, "p", `Signer ${entry.registry.signer} · signature verified · trusted maintainer`, "meta-line");
149
-
150
- const commandSection = section(card, "Preview safely");
151
- const commandBlock = document.createElement("div");
152
- commandBlock.className = "command-block";
153
- const command = previewCommand(entry.policy.id, entry.binding.id);
154
- text(commandBlock, "code", command);
155
- const button = text(commandBlock, "button", "Copy preview command", "copy-button");
156
- button.type = "button";
157
- button.dataset.command = command;
158
- commandSection.append(commandBlock);
159
- }
160
-
161
- function wireCopy() {
162
- document.addEventListener("click", async (event) => {
163
- const button = event.target.closest("button[data-command]");
164
- if (!button) return;
165
- try {
166
- await navigator.clipboard.writeText(button.dataset.command);
167
- button.textContent = "Copied";
168
- nodes.copyStatus.textContent = `Copied preview command for ${button.closest(".preset-card").dataset.compositionId}`;
169
- setTimeout(() => { button.textContent = "Copy preview command"; }, 1400);
170
- } catch {
171
- nodes.copyStatus.textContent = "Clipboard access was unavailable; select the command text to copy it manually.";
172
- }
173
- });
174
- }
175
-
176
- function render(catalog) {
177
- const entries = visibleCompositions(catalog, nodes.filter.checked);
178
- nodes.published.textContent = formatNumber(catalog.compositions.length);
179
- nodes.recommended.textContent = formatNumber(catalog.compositions.filter((entry) => entry.recommended).length);
180
- nodes.trust.textContent = catalog.source?.state === "verified_registry_projection" ? "Signed registry" : "Publication gated";
181
- nodes.generated.textContent = Number.isFinite(catalog.generatedAtUnix)
182
- ? `Projection generated ${formatDate(catalog.generatedAtUnix)} · ${catalog.source.trust}`
183
- : "No signed registry projection published.";
184
- fillSelect(nodes.selectA, entries, 0);
185
- fillSelect(nodes.selectB, entries, 1);
186
- const empty = entries.length === 0;
187
- nodes.empty.hidden = !empty;
188
- nodes.comparison.hidden = empty;
189
- if (empty) {
190
- nodes.emptyMessage.textContent = catalog.source?.message ?? (nodes.filter.checked ? "No published composition currently carries an evaluation-backed recommendation." : "No trusted compositions are published.");
191
- return;
192
- }
193
- const find = (id) => entries.find((entry) => entry.id === id);
194
- renderCard(nodes.cardA, find(nodes.selectA.value));
195
- renderCard(nodes.cardB, find(nodes.selectB.value));
196
- }
197
-
198
- async function start() {
199
- wireCopy();
200
- const response = await fetch(catalogLocation(), { cache: "no-store" });
201
- if (!response.ok) throw new Error(`catalog request failed with HTTP ${response.status}`);
202
- const catalog = await response.json();
203
- if (catalog.schemaVersion !== 1 || !Array.isArray(catalog.compositions)) throw new Error("unsupported catalog data");
204
- const update = () => render(catalog);
205
- nodes.filter.addEventListener("change", update);
206
- nodes.selectA.addEventListener("change", update);
207
- nodes.selectB.addEventListener("change", update);
208
- update();
209
- }
210
-
211
- start().catch((error) => {
212
- nodes.empty.hidden = false;
213
- nodes.comparison.hidden = true;
214
- nodes.emptyMessage.textContent = `Catalog unavailable: ${error.message}`;
215
- nodes.trust.textContent = "Unavailable";
216
- });