avorelo 0.1.0

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 (258) hide show
  1. package/LICENSE +21 -0
  2. package/README.md +56 -0
  3. package/bin/avorelo +9 -0
  4. package/package.json +135 -0
  5. package/scripts/README.md +40 -0
  6. package/scripts/cco-dashboard.js +252 -0
  7. package/scripts/cco-status.js +430 -0
  8. package/scripts/lib/activation/account-state.js +37 -0
  9. package/scripts/lib/activation/activation-runner.js +546 -0
  10. package/scripts/lib/activation/activation-self-healing.js +480 -0
  11. package/scripts/lib/activation/activation-state.js +83 -0
  12. package/scripts/lib/activation/activation-summary.js +191 -0
  13. package/scripts/lib/activation/adapters/claude-code.js +77 -0
  14. package/scripts/lib/activation/adapters/codex-cli.js +52 -0
  15. package/scripts/lib/activation/adapters/cursor.js +37 -0
  16. package/scripts/lib/activation/adapters/github-agent.js +39 -0
  17. package/scripts/lib/activation/adapters/terminal.js +42 -0
  18. package/scripts/lib/activation/adapters/vscode.js +39 -0
  19. package/scripts/lib/activation/adapters/windsurf.js +37 -0
  20. package/scripts/lib/activation/ai-surface-detector.js +151 -0
  21. package/scripts/lib/activation/connect-account.js +145 -0
  22. package/scripts/lib/activation/detect-environment.js +75 -0
  23. package/scripts/lib/activation/detect-hosts.js +62 -0
  24. package/scripts/lib/activation/format-activation-output.js +109 -0
  25. package/scripts/lib/activation/next-action.js +43 -0
  26. package/scripts/lib/activation/repair-engine.js +219 -0
  27. package/scripts/lib/activation-distribution-readiness.js +507 -0
  28. package/scripts/lib/adapter-conformance.js +176 -0
  29. package/scripts/lib/adapter-readiness.js +417 -0
  30. package/scripts/lib/adapter-safety-boundaries.js +335 -0
  31. package/scripts/lib/adapter-technical-readiness-gate.js +205 -0
  32. package/scripts/lib/agent-access-governance.js +455 -0
  33. package/scripts/lib/agent-enforcement.js +765 -0
  34. package/scripts/lib/agent-policy-profile.js +210 -0
  35. package/scripts/lib/agent-security/action-evaluator.js +507 -0
  36. package/scripts/lib/agent-security/adapter-registry.js +98 -0
  37. package/scripts/lib/agent-security/auto-policy.js +139 -0
  38. package/scripts/lib/agent-security/bounded-scan.js +93 -0
  39. package/scripts/lib/agent-security/enforcement-adapter.js +174 -0
  40. package/scripts/lib/agent-security/enforcement-engine.js +1129 -0
  41. package/scripts/lib/agent-security/file-write-adapter.js +183 -0
  42. package/scripts/lib/agent-security/file-write-rules.js +178 -0
  43. package/scripts/lib/agent-security/index.js +3342 -0
  44. package/scripts/lib/agent-security/instruction-risk.js +181 -0
  45. package/scripts/lib/agent-security/mcp-action-adapter.js +185 -0
  46. package/scripts/lib/agent-security/mcp-action-rules.js +184 -0
  47. package/scripts/lib/agent-security/package-action-adapter.js +175 -0
  48. package/scripts/lib/agent-security/package-action-rules.js +233 -0
  49. package/scripts/lib/agent-security/performance.js +148 -0
  50. package/scripts/lib/agent-security/permission-minimizer.js +403 -0
  51. package/scripts/lib/agent-security/scan-cache.js +74 -0
  52. package/scripts/lib/agent-security/source-trust.js +146 -0
  53. package/scripts/lib/ai-install-prompt.js +288 -0
  54. package/scripts/lib/ai-workspace-hygiene.js +1499 -0
  55. package/scripts/lib/alpha-activation.js +520 -0
  56. package/scripts/lib/alpha-feedback.js +263 -0
  57. package/scripts/lib/alpha-readiness-gate.js +332 -0
  58. package/scripts/lib/anti-gaming.js +169 -0
  59. package/scripts/lib/artifact-health.js +431 -0
  60. package/scripts/lib/attribution.js +180 -0
  61. package/scripts/lib/audit.js +289 -0
  62. package/scripts/lib/avorelo-skill-registry.js +810 -0
  63. package/scripts/lib/batch-jobs.js +71 -0
  64. package/scripts/lib/brain-pack.js +578 -0
  65. package/scripts/lib/brand-boundary.js +424 -0
  66. package/scripts/lib/brand.js +74 -0
  67. package/scripts/lib/browser-capability.js +1048 -0
  68. package/scripts/lib/browser-proof-preflight.js +321 -0
  69. package/scripts/lib/cache-readiness.js +187 -0
  70. package/scripts/lib/canonical-reentry.js +162 -0
  71. package/scripts/lib/capability-packs.js +314 -0
  72. package/scripts/lib/capability-recommender.js +512 -0
  73. package/scripts/lib/capability-registry.js +1059 -0
  74. package/scripts/lib/carry-forward-surfacing.js +194 -0
  75. package/scripts/lib/ccusage-adapter.js +188 -0
  76. package/scripts/lib/company-loop.js +1149 -0
  77. package/scripts/lib/config.js +637 -0
  78. package/scripts/lib/context-acquisition-plan.js +287 -0
  79. package/scripts/lib/context-budget-guard.js +170 -0
  80. package/scripts/lib/context-budget-scanner.js +257 -0
  81. package/scripts/lib/context-optimizer.js +715 -0
  82. package/scripts/lib/context-reduction-plan.js +178 -0
  83. package/scripts/lib/context-safety.js +88 -0
  84. package/scripts/lib/context-savings-engine.js +158 -0
  85. package/scripts/lib/cost-evidence.js +254 -0
  86. package/scripts/lib/cross-host-install-plan.js +308 -0
  87. package/scripts/lib/cross-host-install-readiness.js +237 -0
  88. package/scripts/lib/cross-host-value-flow.js +268 -0
  89. package/scripts/lib/dashboard.js +900 -0
  90. package/scripts/lib/design-partner-feedback.js +346 -0
  91. package/scripts/lib/entitlements.js +100 -0
  92. package/scripts/lib/execution-packet.js +559 -0
  93. package/scripts/lib/experimentation-events.js +547 -0
  94. package/scripts/lib/external-capability-compliance.js +107 -0
  95. package/scripts/lib/external-user-simulation.js +166 -0
  96. package/scripts/lib/failure-recovery-readiness.js +81 -0
  97. package/scripts/lib/failure-recovery.js +419 -0
  98. package/scripts/lib/feedback-intelligence.js +537 -0
  99. package/scripts/lib/feedback-signals.js +205 -0
  100. package/scripts/lib/file-integrity.js +68 -0
  101. package/scripts/lib/fsx.js +127 -0
  102. package/scripts/lib/full-readiness-gate.js +451 -0
  103. package/scripts/lib/guidance-builder.js +174 -0
  104. package/scripts/lib/hook-apply.js +1019 -0
  105. package/scripts/lib/hook-baseline.js +310 -0
  106. package/scripts/lib/hook-config-preview.js +275 -0
  107. package/scripts/lib/hook-contracts.js +290 -0
  108. package/scripts/lib/hook-safety-boundary-readiness.js +80 -0
  109. package/scripts/lib/host-capability-matrix.js +351 -0
  110. package/scripts/lib/host-support-context.js +254 -0
  111. package/scripts/lib/http-hook-action.js +538 -0
  112. package/scripts/lib/install-ai-readiness.js +84 -0
  113. package/scripts/lib/install-intake-risk.js +1037 -0
  114. package/scripts/lib/install-journey-intelligence.js +329 -0
  115. package/scripts/lib/intervention-guidance.js +57 -0
  116. package/scripts/lib/known-limitations.js +115 -0
  117. package/scripts/lib/l8-path-truth.js +146 -0
  118. package/scripts/lib/launch-hardening-gate.js +436 -0
  119. package/scripts/lib/launch-readiness.js +628 -0
  120. package/scripts/lib/learning-memory.js +686 -0
  121. package/scripts/lib/lifecycle-hooks.js +802 -0
  122. package/scripts/lib/local-package-smoke.js +423 -0
  123. package/scripts/lib/local-pricing.js +299 -0
  124. package/scripts/lib/mcp-enforcement.js +311 -0
  125. package/scripts/lib/mcp-least-privilege-policy.js +303 -0
  126. package/scripts/lib/mcp-tool-inventory.js +388 -0
  127. package/scripts/lib/mcp-tool-risk.js +0 -0
  128. package/scripts/lib/memory.js +335 -0
  129. package/scripts/lib/metrics.js +699 -0
  130. package/scripts/lib/micro-proof.js +133 -0
  131. package/scripts/lib/next-run-context.js +436 -0
  132. package/scripts/lib/operating-value.js +1648 -0
  133. package/scripts/lib/optimization-v3.js +122 -0
  134. package/scripts/lib/orchestration/adapters/_shared.js +49 -0
  135. package/scripts/lib/orchestration/adapters/aider.js +18 -0
  136. package/scripts/lib/orchestration/adapters/claude-code.js +35 -0
  137. package/scripts/lib/orchestration/adapters/codex.js +35 -0
  138. package/scripts/lib/orchestration/adapters/gemini-cli.js +18 -0
  139. package/scripts/lib/orchestration/adapters/git.js +25 -0
  140. package/scripts/lib/orchestration/adapters/index.js +31 -0
  141. package/scripts/lib/orchestration/adapters/lm-studio.js +18 -0
  142. package/scripts/lib/orchestration/adapters/ollama.js +18 -0
  143. package/scripts/lib/orchestration/adapters/opencode.js +18 -0
  144. package/scripts/lib/orchestration/adapters/openrouter.js +18 -0
  145. package/scripts/lib/orchestration/adapters/test-runner.js +25 -0
  146. package/scripts/lib/orchestration/cli.js +438 -0
  147. package/scripts/lib/orchestration/execution-manager.js +279 -0
  148. package/scripts/lib/orchestration/handoff.js +314 -0
  149. package/scripts/lib/orchestration/index.js +456 -0
  150. package/scripts/lib/orchestration/inventory.js +47 -0
  151. package/scripts/lib/orchestration/model-discovery.js +498 -0
  152. package/scripts/lib/orchestration/model-profiler.js +170 -0
  153. package/scripts/lib/orchestration/model-profiles.js +252 -0
  154. package/scripts/lib/orchestration/model-refresh-policy.js +72 -0
  155. package/scripts/lib/orchestration/proof-writer.js +349 -0
  156. package/scripts/lib/orchestration/provider-discovery/aider.js +49 -0
  157. package/scripts/lib/orchestration/provider-discovery/claude-code.js +56 -0
  158. package/scripts/lib/orchestration/provider-discovery/codex.js +49 -0
  159. package/scripts/lib/orchestration/provider-discovery/common.js +186 -0
  160. package/scripts/lib/orchestration/provider-discovery/gemini.js +106 -0
  161. package/scripts/lib/orchestration/provider-discovery/lm-studio.js +118 -0
  162. package/scripts/lib/orchestration/provider-discovery/models-dev.js +12 -0
  163. package/scripts/lib/orchestration/provider-discovery/ollama.js +100 -0
  164. package/scripts/lib/orchestration/provider-discovery/opencode.js +47 -0
  165. package/scripts/lib/orchestration/provider-discovery/openrouter.js +44 -0
  166. package/scripts/lib/orchestration/risk-classifier.js +130 -0
  167. package/scripts/lib/orchestration/routing-policy.js +486 -0
  168. package/scripts/lib/orchestration/settings.js +112 -0
  169. package/scripts/lib/orchestration/state.js +165 -0
  170. package/scripts/lib/orchestration/verification-manager.js +138 -0
  171. package/scripts/lib/output-profiles.js +146 -0
  172. package/scripts/lib/package-content-audit.js +368 -0
  173. package/scripts/lib/package-runtime.js +278 -0
  174. package/scripts/lib/plan-surface.js +53 -0
  175. package/scripts/lib/plans.js +2318 -0
  176. package/scripts/lib/policy-provider.js +27 -0
  177. package/scripts/lib/prelaunch-activation-readiness.js +409 -0
  178. package/scripts/lib/prelaunch-evidence-store.js +816 -0
  179. package/scripts/lib/prelaunch-intelligence.js +869 -0
  180. package/scripts/lib/pricing-experiment.js +118 -0
  181. package/scripts/lib/pro-moment-events.js +77 -0
  182. package/scripts/lib/pro-moment-state.js +227 -0
  183. package/scripts/lib/pro-moments.js +1216 -0
  184. package/scripts/lib/product-learning-events.js +629 -0
  185. package/scripts/lib/project-profile.js +555 -0
  186. package/scripts/lib/prompt-compiler.js +280 -0
  187. package/scripts/lib/prompt-lint.js +32 -0
  188. package/scripts/lib/prompt-suggestions.js +52 -0
  189. package/scripts/lib/proof-canonical.js +398 -0
  190. package/scripts/lib/proof-drilldown.js +383 -0
  191. package/scripts/lib/proof-events.js +342 -0
  192. package/scripts/lib/proof-history.js +243 -0
  193. package/scripts/lib/proof-metrics.js +296 -0
  194. package/scripts/lib/proof-outcome-evidence.js +134 -0
  195. package/scripts/lib/proof-receipt.js +335 -0
  196. package/scripts/lib/proof-record.js +461 -0
  197. package/scripts/lib/public-activation-distribution-gate.js +258 -0
  198. package/scripts/lib/public-cli.js +3891 -0
  199. package/scripts/lib/public-distribution-truth.js +211 -0
  200. package/scripts/lib/public-install-claim-checker.js +294 -0
  201. package/scripts/lib/publish-provenance-readiness.js +283 -0
  202. package/scripts/lib/readiness-delta.js +218 -0
  203. package/scripts/lib/readiness-evidence-closure.js +196 -0
  204. package/scripts/lib/reentry-memory-capture.js +241 -0
  205. package/scripts/lib/reentry-memory-retrieval.js +302 -0
  206. package/scripts/lib/reentry-memory-status.js +146 -0
  207. package/scripts/lib/reentry-memory-store.js +178 -0
  208. package/scripts/lib/reentry-state.js +66 -0
  209. package/scripts/lib/release-candidate-bundle.js +166 -0
  210. package/scripts/lib/remediation.js +81 -0
  211. package/scripts/lib/repo-map.js +391 -0
  212. package/scripts/lib/run-improvements-lifecycle.js +330 -0
  213. package/scripts/lib/run-improvements.js +789 -0
  214. package/scripts/lib/runtime-decision-policy.js +387 -0
  215. package/scripts/lib/safe-path-engine.js +705 -0
  216. package/scripts/lib/safe-run-controller.js +887 -0
  217. package/scripts/lib/score.js +262 -0
  218. package/scripts/lib/seamless-enforcement.js +329 -0
  219. package/scripts/lib/seamless-outcome.js +689 -0
  220. package/scripts/lib/seamless-reality-gate.js +5043 -0
  221. package/scripts/lib/security-risk-classifier.js +511 -0
  222. package/scripts/lib/security-scan.js +384 -0
  223. package/scripts/lib/session-context-optimizer.js +1211 -0
  224. package/scripts/lib/session-timing.js +315 -0
  225. package/scripts/lib/skill-hygiene.js +805 -0
  226. package/scripts/lib/skill-packs.js +161 -0
  227. package/scripts/lib/skills-operating-layer.js +580 -0
  228. package/scripts/lib/smart-work-routing.js +768 -0
  229. package/scripts/lib/source-catalog.js +700 -0
  230. package/scripts/lib/status-value-summary.js +32 -0
  231. package/scripts/lib/support-bundle.js +578 -0
  232. package/scripts/lib/task-continuation.js +440 -0
  233. package/scripts/lib/test-helpers.js +15 -0
  234. package/scripts/lib/tier.js +38 -0
  235. package/scripts/lib/token-context-quality-gate.js +370 -0
  236. package/scripts/lib/token-cost-capture.js +187 -0
  237. package/scripts/lib/token-cost-intelligence.js +358 -0
  238. package/scripts/lib/token-efficiency-evidence.js +213 -0
  239. package/scripts/lib/token-evidence.js +699 -0
  240. package/scripts/lib/tokenish.js +17 -0
  241. package/scripts/lib/tool-output-sandbox.js +304 -0
  242. package/scripts/lib/trust-audit.js +136 -0
  243. package/scripts/lib/unified-events.js +396 -0
  244. package/scripts/lib/upgrade-interruption-recovery.js +407 -0
  245. package/scripts/lib/usage-ledger.js +201 -0
  246. package/scripts/lib/value-ledger.js +130 -0
  247. package/scripts/lib/value-proof-calibration.js +531 -0
  248. package/scripts/lib/visual-qa.js +231 -0
  249. package/scripts/lib/voice-alpha.js +29 -0
  250. package/scripts/lib/work-aware-orchestration.js +976 -0
  251. package/scripts/lib/work-control-receipts.js +577 -0
  252. package/scripts/lib/work-ledger.js +1123 -0
  253. package/scripts/lib/work-panel-preview.js +352 -0
  254. package/scripts/lib/workflow-discipline.js +280 -0
  255. package/scripts/lib/workflow-signals.js +419 -0
  256. package/scripts/lib/workspace-map.js +281 -0
  257. package/scripts/lib/workspace-registry.js +1367 -0
  258. package/scripts/lib/workspace-resolver.js +480 -0
@@ -0,0 +1,700 @@
1
+ "use strict";
2
+
3
+ const path = require("path");
4
+
5
+ const VALID_SOURCE_TYPES = new Set([
6
+ "repository",
7
+ "documentation",
8
+ "spec",
9
+ "guide",
10
+ "product_reference",
11
+ "skill_pack",
12
+ "skills_repo",
13
+ "adapter_reference",
14
+ ]);
15
+
16
+ const VALID_SOURCE_TRUST_LEVELS = new Set(["unknown", "low", "medium", "high"]);
17
+ const VALID_RISK_LEVELS = new Set(["low", "medium", "high"]);
18
+ const VALID_SOURCE_REVIEW_STATUSES = new Set(["unreviewed", "reviewed", "trusted", "blocked"]);
19
+ const VALID_ALLOWED_USE_MODES = new Set([
20
+ "reference_only",
21
+ "suggested_install",
22
+ "wrapped_adapter",
23
+ "adapted_internal",
24
+ "vendored_with_attribution",
25
+ "blocked",
26
+ ]);
27
+ const VALID_PRODUCT_DECISIONS = new Set([
28
+ "adopt_now",
29
+ "adapt_now",
30
+ "reference_only",
31
+ "defer",
32
+ "blocked",
33
+ ]);
34
+
35
+ const SOURCE_CATALOG = Object.freeze([
36
+ {
37
+ id: "playwright-local-runner",
38
+ name: "Playwright",
39
+ sourceType: "documentation",
40
+ sourceUrl: "https://playwright.dev",
41
+ owner: "Microsoft",
42
+ license: "Apache-2.0",
43
+ licenseUrl: "https://github.com/microsoft/playwright/blob/main/LICENSE",
44
+ attributionRequired: true,
45
+ noticeRequired: true,
46
+ commercialUseMetadata: "Apache-2.0 generally permits commercial use subject to license conditions. This is metadata, not legal advice.",
47
+ sourceTrustLevel: "high",
48
+ riskLevel: "low",
49
+ sourceReviewStatus: "reviewed",
50
+ lastReviewedAt: "2026-05-12",
51
+ sourceSnapshot: { type: "docs_reference" },
52
+ supportedAgents: ["claude-code", "codex", "cursor", "generic"],
53
+ sourceCategories: ["browser_automation", "visual_qa"],
54
+ usefulPatterns: ["local browser runner", "screenshot-backed verification"],
55
+ adaptationCandidates: ["frontend readiness", "visual qa"],
56
+ blockedPatterns: ["bundling upstream code"],
57
+ knownRisks: ["User must install and configure independently."],
58
+ securityNotes: ["Treat Playwright as a local runner reference only."],
59
+ licenseNotes: ["Keep attribution when referenced in user-facing docs."],
60
+ attributionText: "Playwright is developed and maintained by Microsoft Corporation. Licensed under Apache-2.0. See https://playwright.dev",
61
+ allowedUseModes: ["reference_only", "suggested_install"],
62
+ defaultUseMode: "reference_only",
63
+ dogfoodStatus: "reviewed_for_runner_reference",
64
+ dogfoodEvidencePath: "docs/dogfood/operating-layer-dogfood-report.md",
65
+ productDecision: "reference_only",
66
+ notesFile: "docs/references/source-review-notes.md",
67
+ },
68
+ {
69
+ id: "addyosmani-agent-skills",
70
+ name: "Addy Osmani Agent Skills",
71
+ sourceType: "skills_repo",
72
+ sourceUrl: "https://github.com/addyosmani/agent-skills",
73
+ owner: "Addy Osmani",
74
+ license: "MIT",
75
+ licenseUrl: "https://github.com/addyosmani/agent-skills/blob/main/LICENSE",
76
+ attributionRequired: true,
77
+ noticeRequired: true,
78
+ commercialUseMetadata: "MIT generally permits commercial use subject to license conditions. This is metadata, not legal advice.",
79
+ sourceTrustLevel: "high",
80
+ riskLevel: "medium",
81
+ sourceReviewStatus: "reviewed",
82
+ lastReviewedAt: "2026-05-12",
83
+ sourceSnapshot: {
84
+ type: "reviewed_subset_vendored",
85
+ upstreamCommit: "3ff4b518b3cd3077ca27cf883aa21d21faf53802",
86
+ localPath: "vendor/skillpacks/addyosmani-agent-skills",
87
+ },
88
+ supportedAgents: ["claude-code", "codex", "cursor", "generic"],
89
+ sourceCategories: ["workflow_skills", "context_engineering", "verification"],
90
+ usefulPatterns: [
91
+ "using-agent-skills meta-skill",
92
+ "SKILL.md anatomy",
93
+ "incremental implementation",
94
+ "verification gates",
95
+ "rationalizations and red flags",
96
+ "source-driven development",
97
+ ],
98
+ adaptationCandidates: [
99
+ "reference_first_implementation",
100
+ "spec_driven_development",
101
+ "pr_quality_gate",
102
+ "test_driven_development",
103
+ ],
104
+ blockedPatterns: [
105
+ "blind runtime import",
106
+ "auto-executing upstream scripts",
107
+ "full prompt dump of vendored skills",
108
+ ],
109
+ knownRisks: [
110
+ "Imported scripts must remain non-runnable by default.",
111
+ ],
112
+ securityNotes: [
113
+ "Treat imported scripts as data only until explicitly reviewed.",
114
+ "Run static scanning before any deeper adaptation.",
115
+ ],
116
+ licenseNotes: [
117
+ "MIT confirmed from upstream reference.",
118
+ "Preserve LICENSE and attribution when vendoring locally.",
119
+ ],
120
+ attributionText: "Addy Osmani Agent Skills by Addy Osmani, used with attribution under the MIT license.",
121
+ allowedUseModes: ["reference_only", "adapted_internal", "vendored_with_attribution"],
122
+ defaultUseMode: "vendored_with_attribution",
123
+ dogfoodStatus: "reviewed_subset_vendored",
124
+ dogfoodEvidencePath: "docs/dogfood/skills-operating-layer-dogfood.md",
125
+ productDecision: "adopt_now",
126
+ notesFile: "docs/references/source-review-notes.md",
127
+ },
128
+ {
129
+ id: "anthropic-skills-repo",
130
+ name: "Anthropic Skills repo",
131
+ sourceType: "skills_repo",
132
+ sourceUrl: "https://github.com/anthropics/skills",
133
+ owner: "Anthropic",
134
+ license: "reference_only_pending_review",
135
+ licenseUrl: "https://github.com/anthropics/skills",
136
+ attributionRequired: true,
137
+ noticeRequired: true,
138
+ commercialUseMetadata: "Mixed-license repository. Reuse requires per-skill review.",
139
+ sourceTrustLevel: "high",
140
+ riskLevel: "medium",
141
+ sourceReviewStatus: "reviewed",
142
+ lastReviewedAt: "2026-05-13",
143
+ sourceSnapshot: { type: "docs_and_repo_reference_only" },
144
+ supportedAgents: ["claude-code", "generic"],
145
+ sourceCategories: ["skills", "browser_proof"],
146
+ usefulPatterns: ["narrow task skills", "supporting assets", "task-specific packaging"],
147
+ adaptationCandidates: ["skill structure", "browser proof workflow references"],
148
+ blockedPatterns: ["bulk import of mixed-license content", "runtime use without per-skill review"],
149
+ knownRisks: ["Not all skills share the same reuse status."],
150
+ securityNotes: ["Per-skill provenance review is required before any future vendoring."],
151
+ licenseNotes: ["Treat as structure and pattern source unless a specific open skill is reviewed."],
152
+ attributionText: "Anthropic Skills repo reviewed for structure and workflow patterns only.",
153
+ allowedUseModes: ["reference_only", "adapted_internal", "blocked"],
154
+ defaultUseMode: "reference_only",
155
+ dogfoodStatus: "reviewed_for_structure_only",
156
+ dogfoodEvidencePath: "docs/dogfood/skills-operating-layer-dogfood.md",
157
+ productDecision: "adapt_now",
158
+ notesFile: "docs/references/source-review-notes.md",
159
+ },
160
+ {
161
+ id: "anthropic-webapp-testing-skill",
162
+ name: "Anthropic webapp-testing skill",
163
+ sourceType: "guide",
164
+ sourceUrl: "https://github.com/anthropics/skills/blob/main/skills/webapp-testing/SKILL.md",
165
+ owner: "Anthropic",
166
+ license: "reference_only_pending_review",
167
+ licenseUrl: "https://github.com/anthropics/skills",
168
+ attributionRequired: true,
169
+ noticeRequired: true,
170
+ commercialUseMetadata: "Workflow reference only unless a specific licensed subset is approved later.",
171
+ sourceTrustLevel: "high",
172
+ riskLevel: "low",
173
+ sourceReviewStatus: "reviewed",
174
+ lastReviewedAt: "2026-05-13",
175
+ sourceSnapshot: { type: "workflow_reference_only" },
176
+ supportedAgents: ["claude-code", "generic"],
177
+ sourceCategories: ["browser_proof", "visual_qa"],
178
+ usefulPatterns: ["local server lifecycle", "browser evidence capture", "console and network inspection"],
179
+ adaptationCandidates: ["future Browser Proof capability"],
180
+ blockedPatterns: ["claiming Browser Proof is shipped in this PR", "copying mixed-license bodies into adapters"],
181
+ knownRisks: ["This source informs later Browser Proof work only."],
182
+ securityNotes: ["Keep Browser Proof out of this PR scope."],
183
+ licenseNotes: ["Reference workflow patterns only for now."],
184
+ attributionText: "Anthropic webapp-testing skill reviewed as a Browser Proof workflow reference only.",
185
+ allowedUseModes: ["reference_only"],
186
+ defaultUseMode: "reference_only",
187
+ dogfoodStatus: "reviewed_for_browser_proof_later",
188
+ dogfoodEvidencePath: "docs/dogfood/skills-operating-layer-dogfood.md",
189
+ productDecision: "reference_only",
190
+ notesFile: "docs/references/source-review-notes.md",
191
+ },
192
+ {
193
+ id: "openai-codex-skills-docs",
194
+ name: "OpenAI Codex Skills docs",
195
+ sourceType: "documentation",
196
+ sourceUrl: "https://developers.openai.com/codex/skills",
197
+ owner: "OpenAI",
198
+ license: "docs_reference",
199
+ licenseUrl: "https://openai.com/policies/",
200
+ attributionRequired: true,
201
+ noticeRequired: false,
202
+ commercialUseMetadata: "Use as documentation reference only.",
203
+ sourceTrustLevel: "high",
204
+ riskLevel: "low",
205
+ sourceReviewStatus: "reviewed",
206
+ lastReviewedAt: "2026-05-12",
207
+ sourceSnapshot: { type: "docs_reference" },
208
+ supportedAgents: ["codex"],
209
+ sourceCategories: ["skills", "adapter_behavior"],
210
+ usefulPatterns: ["skill directory with SKILL.md", "progressive disclosure", "context-budgeted discovery"],
211
+ adaptationCandidates: ["codex adapter guidance", "canonical avorelo skills", "skill registry validation"],
212
+ blockedPatterns: ["copying long docs text into adapters"],
213
+ knownRisks: ["Documentation can change without notice."],
214
+ securityNotes: ["Use as behavior reference only."],
215
+ licenseNotes: ["Do not mirror docs text wholesale."],
216
+ attributionText: "Behavior aligned with OpenAI Codex Skills documentation.",
217
+ allowedUseModes: ["reference_only", "adapted_internal"],
218
+ defaultUseMode: "adapted_internal",
219
+ dogfoodStatus: "reviewed_for_patterns",
220
+ dogfoodEvidencePath: "docs/dogfood/operating-layer-dogfood-report.md",
221
+ productDecision: "adapt_now",
222
+ notesFile: "docs/references/source-review-notes.md",
223
+ },
224
+ {
225
+ id: "claude-code-skills-docs",
226
+ name: "Claude Code Skills docs",
227
+ sourceType: "documentation",
228
+ sourceUrl: "https://code.claude.com/docs/en/skills",
229
+ owner: "Anthropic",
230
+ license: "docs_reference",
231
+ licenseUrl: "https://www.anthropic.com/legal/consumer-terms",
232
+ attributionRequired: true,
233
+ noticeRequired: false,
234
+ commercialUseMetadata: "Use as documentation reference only.",
235
+ sourceTrustLevel: "high",
236
+ riskLevel: "low",
237
+ sourceReviewStatus: "reviewed",
238
+ lastReviewedAt: "2026-05-12",
239
+ sourceSnapshot: { type: "docs_reference" },
240
+ supportedAgents: ["claude-code"],
241
+ sourceCategories: ["skills", "context_loading"],
242
+ usefulPatterns: [
243
+ "supporting files stay out of always-loaded context",
244
+ "skills load only when needed",
245
+ "precise invocation descriptions",
246
+ ],
247
+ adaptationCandidates: ["claude adapter guidance", "canonical avorelo skills"],
248
+ blockedPatterns: ["manual divergent copies of skill content"],
249
+ knownRisks: ["Documentation can evolve."],
250
+ securityNotes: ["Keep supporting files separate from always-loaded prompts."],
251
+ licenseNotes: ["Reference patterns only."],
252
+ attributionText: "Behavior aligned with Claude Code Skills documentation.",
253
+ allowedUseModes: ["reference_only", "adapted_internal"],
254
+ defaultUseMode: "adapted_internal",
255
+ dogfoodStatus: "reviewed_for_patterns",
256
+ dogfoodEvidencePath: "docs/dogfood/operating-layer-dogfood-report.md",
257
+ productDecision: "adapt_now",
258
+ notesFile: "docs/references/source-review-notes.md",
259
+ },
260
+ {
261
+ id: "claude-code-hooks-docs",
262
+ name: "Claude Code Hooks docs",
263
+ sourceType: "documentation",
264
+ sourceUrl: "https://code.claude.com/docs/en/hooks",
265
+ owner: "Anthropic",
266
+ license: "docs_reference",
267
+ licenseUrl: "https://www.anthropic.com/legal/consumer-terms",
268
+ attributionRequired: true,
269
+ noticeRequired: false,
270
+ commercialUseMetadata: "Use as documentation reference only.",
271
+ sourceTrustLevel: "high",
272
+ riskLevel: "medium",
273
+ sourceReviewStatus: "reviewed",
274
+ lastReviewedAt: "2026-05-12",
275
+ sourceSnapshot: { type: "docs_reference" },
276
+ supportedAgents: ["claude-code"],
277
+ sourceCategories: ["hooks", "lifecycle"],
278
+ usefulPatterns: ["SessionStart", "UserPromptSubmit", "PreToolUse", "PostToolUse", "PermissionRequest", "SessionEnd", "Stop"],
279
+ adaptationCandidates: ["future deterministic enforcement-point mapping"],
280
+ blockedPatterns: ["heavy new runtime hook system without safe existing infrastructure"],
281
+ knownRisks: ["Hook coverage differs across hosts."],
282
+ securityNotes: ["Use only for low-risk deterministic validations in v1."],
283
+ licenseNotes: ["Reference patterns only."],
284
+ attributionText: "Lifecycle mapping references Claude Code Hooks documentation.",
285
+ allowedUseModes: ["reference_only", "adapted_internal"],
286
+ defaultUseMode: "reference_only",
287
+ dogfoodStatus: "reviewed_for_mapping",
288
+ dogfoodEvidencePath: "docs/dogfood/operating-layer-dogfood-report.md",
289
+ productDecision: "adapt_now",
290
+ notesFile: "docs/references/source-review-notes.md",
291
+ },
292
+ {
293
+ id: "agents-md",
294
+ name: "AGENTS.md",
295
+ sourceType: "spec",
296
+ sourceUrl: "https://agents.md/",
297
+ owner: "AGENTS.md",
298
+ license: "spec_reference",
299
+ licenseUrl: "https://agents.md/",
300
+ attributionRequired: true,
301
+ noticeRequired: false,
302
+ commercialUseMetadata: "Use as open spec reference.",
303
+ sourceTrustLevel: "high",
304
+ riskLevel: "low",
305
+ sourceReviewStatus: "reviewed",
306
+ lastReviewedAt: "2026-05-12",
307
+ sourceSnapshot: { type: "spec_reference" },
308
+ supportedAgents: ["generic", "codex", "claude-code", "cursor", "gemini", "copilot"],
309
+ sourceCategories: ["instructions", "adapter_guidance"],
310
+ usefulPatterns: ["thin agent instruction surface"],
311
+ adaptationCandidates: ["generated adapter AGENTS.md files"],
312
+ blockedPatterns: ["pasting full skill bodies into AGENTS.md"],
313
+ knownRisks: [],
314
+ securityNotes: ["Keep generated files thin and public-safe."],
315
+ licenseNotes: ["Reference the spec, do not over-copy text."],
316
+ attributionText: "Adapter guidance is structured to align with AGENTS.md conventions.",
317
+ allowedUseModes: ["reference_only", "adapted_internal"],
318
+ defaultUseMode: "adapted_internal",
319
+ dogfoodStatus: "generated_guidance",
320
+ dogfoodEvidencePath: "docs/dogfood/operating-layer-dogfood-report.md",
321
+ productDecision: "adapt_now",
322
+ notesFile: "docs/references/source-review-notes.md",
323
+ },
324
+ {
325
+ id: "cursor-rules-docs",
326
+ name: "Cursor Rules docs",
327
+ sourceType: "documentation",
328
+ sourceUrl: "https://cursor.com/docs/rules",
329
+ owner: "Cursor",
330
+ license: "docs_reference",
331
+ licenseUrl: "https://cursor.com/legal",
332
+ attributionRequired: true,
333
+ noticeRequired: false,
334
+ commercialUseMetadata: "Use as documentation reference only.",
335
+ sourceTrustLevel: "high",
336
+ riskLevel: "low",
337
+ sourceReviewStatus: "reviewed",
338
+ lastReviewedAt: "2026-05-12",
339
+ sourceSnapshot: { type: "docs_reference" },
340
+ supportedAgents: ["cursor"],
341
+ sourceCategories: ["rules", "adapter_behavior"],
342
+ usefulPatterns: ["thin rules file"],
343
+ adaptationCandidates: ["generated cursor rules file"],
344
+ blockedPatterns: ["copying proprietary docs text into runtime"],
345
+ knownRisks: [],
346
+ securityNotes: ["Keep generated guidance thin."],
347
+ licenseNotes: ["Reference patterns only."],
348
+ attributionText: "Cursor adapter guidance references Cursor Rules documentation.",
349
+ allowedUseModes: ["reference_only", "adapted_internal"],
350
+ defaultUseMode: "adapted_internal",
351
+ dogfoodStatus: "generated_guidance",
352
+ dogfoodEvidencePath: "docs/dogfood/operating-layer-dogfood-report.md",
353
+ productDecision: "adapt_now",
354
+ notesFile: "docs/references/source-review-notes.md",
355
+ },
356
+ {
357
+ id: "gemini-cli-gemini-md",
358
+ name: "Gemini CLI GEMINI.md reference",
359
+ sourceType: "guide",
360
+ sourceUrl: "https://github.com/google-gemini/gemini-cli",
361
+ owner: "Google",
362
+ license: "reference_only_pending_review",
363
+ licenseUrl: null,
364
+ attributionRequired: true,
365
+ noticeRequired: false,
366
+ commercialUseMetadata: "Use as structural reference only until the exact document license is confirmed.",
367
+ sourceTrustLevel: "medium",
368
+ riskLevel: "medium",
369
+ sourceReviewStatus: "reviewed",
370
+ lastReviewedAt: "2026-05-12",
371
+ sourceSnapshot: { type: "pattern_reference" },
372
+ supportedAgents: ["gemini"],
373
+ sourceCategories: ["adapter_behavior"],
374
+ usefulPatterns: ["thin GEMINI.md adapter guidance"],
375
+ adaptationCandidates: ["generated GEMINI.md file"],
376
+ blockedPatterns: ["copying long upstream text"],
377
+ knownRisks: ["Exact doc path/license not locked in this repo."],
378
+ securityNotes: ["Keep guidance thin and point to core CLI."],
379
+ licenseNotes: ["Pattern-level adaptation only."],
380
+ attributionText: "Gemini adapter guidance uses thin-file patterns informed by Gemini CLI docs.",
381
+ allowedUseModes: ["reference_only", "adapted_internal"],
382
+ defaultUseMode: "adapted_internal",
383
+ dogfoodStatus: "generated_guidance",
384
+ dogfoodEvidencePath: "docs/dogfood/operating-layer-dogfood-report.md",
385
+ productDecision: "adapt_now",
386
+ notesFile: "docs/references/source-review-notes.md",
387
+ },
388
+ {
389
+ id: "github-copilot-custom-instructions-docs",
390
+ name: "GitHub Copilot custom instructions docs",
391
+ sourceType: "documentation",
392
+ sourceUrl: "https://docs.github.com/en/copilot/how-tos/custom-instructions/adding-repository-custom-instructions-for-github-copilot",
393
+ owner: "GitHub",
394
+ license: "docs_reference",
395
+ licenseUrl: "https://docs.github.com/en/site-policy/github-terms/github-terms-of-service",
396
+ attributionRequired: true,
397
+ noticeRequired: false,
398
+ commercialUseMetadata: "Use as documentation reference only.",
399
+ sourceTrustLevel: "high",
400
+ riskLevel: "low",
401
+ sourceReviewStatus: "reviewed",
402
+ lastReviewedAt: "2026-05-13",
403
+ sourceSnapshot: { type: "docs_reference" },
404
+ supportedAgents: ["copilot"],
405
+ sourceCategories: ["instructions", "adapter_guidance"],
406
+ usefulPatterns: ["repo instruction file", "path-specific instructions", "thin instruction surfaces"],
407
+ adaptationCandidates: ["generated copilot guidance"],
408
+ blockedPatterns: ["copying long docs text", "embedding core routing or policy logic in Copilot instructions"],
409
+ knownRisks: ["Docs can evolve over time."],
410
+ securityNotes: ["Keep generated files public-safe and thin."],
411
+ licenseNotes: ["Reference patterns only."],
412
+ attributionText: "Copilot guidance patterns align with GitHub Copilot custom instruction docs.",
413
+ allowedUseModes: ["reference_only", "adapted_internal"],
414
+ defaultUseMode: "adapted_internal",
415
+ dogfoodStatus: "reviewed_for_adapter_generation",
416
+ dogfoodEvidencePath: "docs/dogfood/skills-operating-layer-dogfood.md",
417
+ productDecision: "adapt_now",
418
+ notesFile: "docs/references/source-review-notes.md",
419
+ },
420
+ {
421
+ id: "play-ai-workspace",
422
+ name: "Play AI Workspace",
423
+ sourceType: "product_reference",
424
+ sourceUrl: "https://play.fast/",
425
+ owner: "Play",
426
+ license: "reference_only",
427
+ licenseUrl: null,
428
+ attributionRequired: true,
429
+ noticeRequired: false,
430
+ commercialUseMetadata: "Product-positioning reference only.",
431
+ sourceTrustLevel: "medium",
432
+ riskLevel: "medium",
433
+ sourceReviewStatus: "reviewed",
434
+ lastReviewedAt: "2026-05-12",
435
+ sourceSnapshot: { type: "product_positioning_reference" },
436
+ supportedAgents: ["generic"],
437
+ sourceCategories: ["positioning"],
438
+ usefulPatterns: ["invisible AI", "works with existing stack", "permissions as adoption enabler"],
439
+ adaptationCandidates: ["website copy positioning"],
440
+ blockedPatterns: ["copying text", "copying design", "copying screenshots", "copying assets"],
441
+ knownRisks: ["Product pages are not reusable source material."],
442
+ securityNotes: ["Reference only."],
443
+ licenseNotes: ["No text or design reuse."],
444
+ attributionText: "Positioning patterns informed by Play AI Workspace product references.",
445
+ allowedUseModes: ["reference_only"],
446
+ defaultUseMode: "reference_only",
447
+ dogfoodStatus: "positioning_review_only",
448
+ dogfoodEvidencePath: "docs/dogfood/operating-layer-dogfood-report.md",
449
+ productDecision: "reference_only",
450
+ notesFile: "docs/references/source-review-notes.md",
451
+ },
452
+ {
453
+ id: "impeccable-systems",
454
+ name: "Impeccable design skill systems",
455
+ sourceType: "repository",
456
+ sourceUrl: "unknown",
457
+ owner: "unknown",
458
+ license: "unknown",
459
+ licenseUrl: null,
460
+ attributionRequired: true,
461
+ noticeRequired: true,
462
+ commercialUseMetadata: "Exact source and license must be confirmed before reuse.",
463
+ sourceTrustLevel: "low",
464
+ riskLevel: "high",
465
+ sourceReviewStatus: "unreviewed",
466
+ lastReviewedAt: "2026-05-12",
467
+ sourceSnapshot: { type: "placeholder_reference" },
468
+ supportedAgents: ["claude-code", "codex"],
469
+ sourceCategories: ["frontend_quality"],
470
+ usefulPatterns: ["frontend anti-pattern vocabulary"],
471
+ adaptationCandidates: ["frontend readiness heuristics"],
472
+ blockedPatterns: ["copying code or text without confirmed source/license"],
473
+ knownRisks: ["Exact upstream reference was not present in the repo."],
474
+ securityNotes: ["Reference only until exact source is reviewed."],
475
+ licenseNotes: ["Blocked from copying until confirmed."],
476
+ attributionText: "Potential frontend-readiness patterns pending exact source confirmation.",
477
+ allowedUseModes: ["reference_only", "blocked"],
478
+ defaultUseMode: "reference_only",
479
+ dogfoodStatus: "deferred_pending_exact_source",
480
+ dogfoodEvidencePath: "docs/Capability-Sources.md",
481
+ productDecision: "defer",
482
+ notesFile: "docs/references/source-review-notes.md",
483
+ },
484
+ {
485
+ id: "marketing-skills-systems",
486
+ name: "Marketing skill systems",
487
+ sourceType: "repository",
488
+ sourceUrl: "unknown",
489
+ owner: "unknown",
490
+ license: "unknown",
491
+ licenseUrl: null,
492
+ attributionRequired: true,
493
+ noticeRequired: true,
494
+ commercialUseMetadata: "Exact source and license must be confirmed before reuse.",
495
+ sourceTrustLevel: "low",
496
+ riskLevel: "high",
497
+ sourceReviewStatus: "unreviewed",
498
+ lastReviewedAt: "2026-05-12",
499
+ sourceSnapshot: { type: "placeholder_reference" },
500
+ supportedAgents: ["claude-code", "codex"],
501
+ sourceCategories: ["marketing_readiness"],
502
+ usefulPatterns: ["positioning review", "SEO/CRO basics", "article outline review"],
503
+ adaptationCandidates: ["marketing readiness heuristics"],
504
+ blockedPatterns: ["copying code or text without confirmed source/license"],
505
+ knownRisks: ["Exact upstream reference was not present in the repo."],
506
+ securityNotes: ["Reference only until exact source is reviewed."],
507
+ licenseNotes: ["Blocked from copying until confirmed."],
508
+ attributionText: "Potential marketing-readiness patterns pending exact source confirmation.",
509
+ allowedUseModes: ["reference_only", "blocked"],
510
+ defaultUseMode: "reference_only",
511
+ dogfoodStatus: "deferred_pending_exact_source",
512
+ dogfoodEvidencePath: "docs/Capability-Sources.md",
513
+ productDecision: "defer",
514
+ notesFile: "docs/references/source-review-notes.md",
515
+ },
516
+ ]);
517
+
518
+ const SOURCE_MAP = new Map(SOURCE_CATALOG.map((entry) => [entry.id, entry]));
519
+
520
+ const REQUIRED_FIELDS = [
521
+ "id",
522
+ "name",
523
+ "sourceUrl",
524
+ "sourceType",
525
+ "license",
526
+ "sourceTrustLevel",
527
+ "riskLevel",
528
+ "sourceReviewStatus",
529
+ "allowedUseModes",
530
+ "defaultUseMode",
531
+ "productDecision",
532
+ "notesFile",
533
+ ];
534
+
535
+ function validateSource(entry) {
536
+ const errors = [];
537
+ for (const field of REQUIRED_FIELDS) {
538
+ if (entry[field] === undefined || entry[field] === null || entry[field] === "") {
539
+ errors.push(`Missing required field: ${field}`);
540
+ }
541
+ }
542
+
543
+ if (!VALID_SOURCE_TYPES.has(entry.sourceType)) {
544
+ errors.push(`Invalid sourceType: ${entry.sourceType}`);
545
+ }
546
+ if (!VALID_SOURCE_TRUST_LEVELS.has(entry.sourceTrustLevel)) {
547
+ errors.push(`Invalid sourceTrustLevel: ${entry.sourceTrustLevel}`);
548
+ }
549
+ if (!VALID_RISK_LEVELS.has(entry.riskLevel)) {
550
+ errors.push(`Invalid riskLevel: ${entry.riskLevel}`);
551
+ }
552
+ if (!VALID_SOURCE_REVIEW_STATUSES.has(entry.sourceReviewStatus)) {
553
+ errors.push(`Invalid sourceReviewStatus: ${entry.sourceReviewStatus}`);
554
+ }
555
+ if (!VALID_PRODUCT_DECISIONS.has(entry.productDecision)) {
556
+ errors.push(`Invalid productDecision: ${entry.productDecision}`);
557
+ }
558
+ if (!Array.isArray(entry.allowedUseModes) || entry.allowedUseModes.length === 0) {
559
+ errors.push("allowedUseModes must be a non-empty array");
560
+ } else {
561
+ entry.allowedUseModes.forEach((mode) => {
562
+ if (!VALID_ALLOWED_USE_MODES.has(mode)) {
563
+ errors.push(`Invalid allowedUseMode: ${mode}`);
564
+ }
565
+ });
566
+ }
567
+ if (!VALID_ALLOWED_USE_MODES.has(entry.defaultUseMode)) {
568
+ errors.push(`Invalid defaultUseMode: ${entry.defaultUseMode}`);
569
+ }
570
+ if (Array.isArray(entry.allowedUseModes) && !entry.allowedUseModes.includes(entry.defaultUseMode)) {
571
+ errors.push("defaultUseMode must be included in allowedUseModes");
572
+ }
573
+ if (entry.sourceReviewStatus === "unreviewed" && entry.defaultUseMode === "vendored_with_attribution") {
574
+ errors.push("Unreviewed sources cannot default to vendored_with_attribution");
575
+ }
576
+ if ((entry.license === "unknown" || entry.license === "reference_only_pending_review") && entry.defaultUseMode === "vendored_with_attribution") {
577
+ errors.push("Sources without a confirmed reusable license cannot default to vendored_with_attribution");
578
+ }
579
+ return { valid: errors.length === 0, errors };
580
+ }
581
+
582
+ function validateSourceCatalog() {
583
+ const errors = [];
584
+ const seenIds = new Set();
585
+
586
+ SOURCE_CATALOG.forEach((entry) => {
587
+ if (seenIds.has(entry.id)) {
588
+ errors.push(`Duplicate source ID: ${entry.id}`);
589
+ }
590
+ seenIds.add(entry.id);
591
+ const result = validateSource(entry);
592
+ result.errors.forEach((error) => errors.push(`[${entry.id}] ${error}`));
593
+ });
594
+
595
+ return { valid: errors.length === 0, errors };
596
+ }
597
+
598
+ function getSource(id) {
599
+ return SOURCE_MAP.get(String(id || "").trim()) || null;
600
+ }
601
+
602
+ function listSources() {
603
+ return Array.from(SOURCE_CATALOG);
604
+ }
605
+
606
+ function isSourceAutoRunnable(id) {
607
+ const entry = getSource(id);
608
+ if (!entry) return false;
609
+ if (entry.sourceReviewStatus !== "trusted") return false;
610
+ return entry.defaultUseMode === "wrapped_adapter" || entry.defaultUseMode === "adapted_internal";
611
+ }
612
+
613
+ function canVendorSource(id) {
614
+ const entry = getSource(id);
615
+ if (!entry) return false;
616
+ if (entry.license === "unknown" || entry.license === "reference_only_pending_review") return false;
617
+ return entry.allowedUseModes.includes("vendored_with_attribution");
618
+ }
619
+
620
+ function hasConfirmedReusableLicense(entry) {
621
+ return !["unknown", "reference_only_pending_review", "docs_reference", "spec_reference", "reference_only"].includes(entry.license);
622
+ }
623
+
624
+ function allowsReusableDecision(entry) {
625
+ return entry.productDecision === "adopt_now" || entry.productDecision === "adapt_now";
626
+ }
627
+
628
+ function canReuseSource(entry) {
629
+ if (!allowsReusableDecision(entry)) return false;
630
+ if (!hasConfirmedReusableLicense(entry)) return false;
631
+ return entry.allowedUseModes.includes("vendored_with_attribution") || entry.allowedUseModes.includes("adapted_internal");
632
+ }
633
+
634
+ function canCopyCode(entry) {
635
+ if (!allowsReusableDecision(entry)) return false;
636
+ if (!hasConfirmedReusableLicense(entry)) return false;
637
+ return entry.allowedUseModes.includes("vendored_with_attribution");
638
+ }
639
+
640
+ function canCopyText(entry) {
641
+ if (!allowsReusableDecision(entry)) return false;
642
+ if (!hasConfirmedReusableLicense(entry)) return false;
643
+ if (entry.sourceType === "documentation" || entry.sourceType === "product_reference" || entry.sourceType === "spec" || entry.sourceType === "guide") {
644
+ return false;
645
+ }
646
+ return false;
647
+ }
648
+
649
+ function canLearnPatterns(entry) {
650
+ return entry.productDecision !== "blocked";
651
+ }
652
+
653
+ function toReferenceJsonEntry(entry) {
654
+ return {
655
+ id: entry.id,
656
+ name: entry.name,
657
+ sourceUrl: entry.sourceUrl,
658
+ sourceType: entry.sourceType,
659
+ license: entry.license,
660
+ sourceTrustLevel: entry.sourceTrustLevel,
661
+ riskLevel: entry.riskLevel,
662
+ decision: entry.productDecision,
663
+ reuseAllowed: canReuseSource(entry),
664
+ copyCodeAllowed: canCopyCode(entry),
665
+ copyTextAllowed: canCopyText(entry),
666
+ learnPatternAllowed: canLearnPatterns(entry),
667
+ attributionRequired: entry.attributionRequired,
668
+ avoreloFit: entry.sourceCategories.join(", "),
669
+ implementationArea: entry.adaptationCandidates.join(", "),
670
+ notesFile: entry.notesFile,
671
+ lastReviewed: entry.lastReviewedAt,
672
+ };
673
+ }
674
+
675
+ function resolveNotesPath(cwd, entry) {
676
+ return path.join(cwd, entry.notesFile);
677
+ }
678
+
679
+ module.exports = {
680
+ SOURCE_CATALOG,
681
+ VALID_SOURCE_TYPES,
682
+ VALID_SOURCE_TRUST_LEVELS,
683
+ VALID_RISK_LEVELS,
684
+ VALID_SOURCE_REVIEW_STATUSES,
685
+ VALID_ALLOWED_USE_MODES,
686
+ VALID_PRODUCT_DECISIONS,
687
+ validateSource,
688
+ validateSourceCatalog,
689
+ getSource,
690
+ listSources,
691
+ isSourceAutoRunnable,
692
+ canVendorSource,
693
+ toReferenceJsonEntry,
694
+ hasConfirmedReusableLicense,
695
+ canReuseSource,
696
+ canCopyCode,
697
+ canCopyText,
698
+ canLearnPatterns,
699
+ resolveNotesPath,
700
+ };