@yiaany/ghostapi 0.1.7 → 0.1.8

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 (323) hide show
  1. package/CHANGELOG.md +42 -2
  2. package/CONTRIBUTING.md +119 -117
  3. package/LICENSE +21 -21
  4. package/README.md +208 -185
  5. package/SECURITY.md +53 -37
  6. package/dist/actions/gateway.d.ts +179 -0
  7. package/dist/actions/gateway.js +514 -0
  8. package/dist/actions/gateway.js.map +1 -0
  9. package/dist/actions/index.d.ts +2 -0
  10. package/dist/actions/index.js +2 -0
  11. package/dist/actions/index.js.map +1 -0
  12. package/dist/ai/aiClient.js +4 -4
  13. package/dist/ai/aiClient.js.map +1 -1
  14. package/dist/ai/aiGenerator.d.ts +2 -2
  15. package/dist/ai/aiGenerator.js +21 -72
  16. package/dist/ai/aiGenerator.js.map +1 -1
  17. package/dist/ai/prompts.js +51 -51
  18. package/dist/ai/prompts.js.map +1 -1
  19. package/dist/approvals/approvalInbox.d.ts +150 -0
  20. package/dist/approvals/approvalInbox.js +412 -0
  21. package/dist/approvals/approvalInbox.js.map +1 -0
  22. package/dist/approvals/index.d.ts +2 -0
  23. package/dist/approvals/index.js +2 -0
  24. package/dist/approvals/index.js.map +1 -0
  25. package/dist/behavior/behaviorStore.d.ts +2 -0
  26. package/dist/behavior/behaviorStore.js +50 -46
  27. package/dist/behavior/behaviorStore.js.map +1 -1
  28. package/dist/cache/index.d.ts +2 -0
  29. package/dist/cache/index.js +58 -14
  30. package/dist/cache/index.js.map +1 -1
  31. package/dist/cli/index.js +438 -58
  32. package/dist/cli/index.js.map +1 -1
  33. package/dist/cli/openUrl.d.ts +10 -0
  34. package/dist/cli/openUrl.js +31 -0
  35. package/dist/cli/openUrl.js.map +1 -0
  36. package/dist/cli/parser.d.ts +155 -0
  37. package/dist/cli/parser.js +504 -2
  38. package/dist/cli/parser.js.map +1 -1
  39. package/dist/config/dataPaths.d.ts +31 -0
  40. package/dist/config/dataPaths.js +45 -0
  41. package/dist/config/dataPaths.js.map +1 -0
  42. package/dist/config/localConfig.d.ts +1 -2
  43. package/dist/config/localConfig.js +27 -21
  44. package/dist/config/localConfig.js.map +1 -1
  45. package/dist/config/serverConfig.d.ts +2 -0
  46. package/dist/config/serverConfig.js +8 -1
  47. package/dist/config/serverConfig.js.map +1 -1
  48. package/dist/contracts/contract.d.ts +76 -0
  49. package/dist/contracts/contract.js +603 -0
  50. package/dist/contracts/contract.js.map +1 -0
  51. package/dist/contracts/index.d.ts +2 -0
  52. package/dist/contracts/index.js +2 -0
  53. package/dist/contracts/index.js.map +1 -0
  54. package/dist/credentials/credentialBroker.d.ts +207 -0
  55. package/dist/credentials/credentialBroker.js +588 -0
  56. package/dist/credentials/credentialBroker.js.map +1 -0
  57. package/dist/credentials/index.d.ts +2 -0
  58. package/dist/credentials/index.js +2 -0
  59. package/dist/credentials/index.js.map +1 -0
  60. package/dist/dashboard/app.js +685 -615
  61. package/dist/dashboard/index.html +13 -7
  62. package/dist/dashboard/styles.css +349 -349
  63. package/dist/egress/capabilities.d.ts +32 -0
  64. package/dist/egress/capabilities.js +165 -0
  65. package/dist/egress/capabilities.js.map +1 -0
  66. package/dist/egress/linuxBootstrap.d.ts +1 -0
  67. package/dist/egress/linuxBootstrap.js +121 -0
  68. package/dist/egress/linuxBootstrap.js.map +1 -0
  69. package/dist/egress/run.d.ts +18 -0
  70. package/dist/egress/run.js +305 -0
  71. package/dist/egress/run.js.map +1 -0
  72. package/dist/errors/errorEngine.d.ts +2 -2
  73. package/dist/errors/errorEngine.js +3 -40
  74. package/dist/errors/errorEngine.js.map +1 -1
  75. package/dist/evals/evals.d.ts +126 -0
  76. package/dist/evals/evals.js +466 -0
  77. package/dist/evals/evals.js.map +1 -0
  78. package/dist/evals/index.d.ts +2 -0
  79. package/dist/evals/index.js +2 -0
  80. package/dist/evals/index.js.map +1 -0
  81. package/dist/evidence/index.d.ts +2 -0
  82. package/dist/evidence/index.js +2 -0
  83. package/dist/evidence/index.js.map +1 -0
  84. package/dist/evidence/report.d.ts +143 -0
  85. package/dist/evidence/report.js +556 -0
  86. package/dist/evidence/report.js.map +1 -0
  87. package/dist/fault/faultLab.d.ts +5 -4
  88. package/dist/fault/faultLab.js +66 -24
  89. package/dist/fault/faultLab.js.map +1 -1
  90. package/dist/index.d.ts +46 -0
  91. package/dist/index.js +23 -0
  92. package/dist/index.js.map +1 -1
  93. package/dist/inventory/analysis.d.ts +12 -0
  94. package/dist/inventory/analysis.js +457 -0
  95. package/dist/inventory/analysis.js.map +1 -0
  96. package/dist/inventory/index.d.ts +5 -0
  97. package/dist/inventory/index.js +4 -0
  98. package/dist/inventory/index.js.map +1 -0
  99. package/dist/inventory/inventoryController.d.ts +53 -0
  100. package/dist/inventory/inventoryController.js +1044 -0
  101. package/dist/inventory/inventoryController.js.map +1 -0
  102. package/dist/inventory/types.d.ts +579 -0
  103. package/dist/inventory/types.js +787 -0
  104. package/dist/inventory/types.js.map +1 -0
  105. package/dist/landing/assets/index-CxWsopzP.css +1 -0
  106. package/dist/landing/assets/index-DZlpyhqd.js +55 -0
  107. package/dist/landing/assets/index-Dk-Xezs3.js +55 -0
  108. package/dist/landing/index.html +15 -15
  109. package/dist/ledger/actionLedger.d.ts +125 -0
  110. package/dist/ledger/actionLedger.js +594 -0
  111. package/dist/ledger/actionLedger.js.map +1 -0
  112. package/dist/ledger/index.d.ts +2 -0
  113. package/dist/ledger/index.js +2 -0
  114. package/dist/ledger/index.js.map +1 -0
  115. package/dist/mcp/server.js +4 -3
  116. package/dist/mcp/server.js.map +1 -1
  117. package/dist/policy/index.d.ts +3 -0
  118. package/dist/policy/index.js +2 -0
  119. package/dist/policy/index.js.map +1 -0
  120. package/dist/policy/policy.d.ts +14 -0
  121. package/dist/policy/policy.js +282 -0
  122. package/dist/policy/policy.js.map +1 -0
  123. package/dist/policy/types.d.ts +52 -0
  124. package/dist/policy/types.js +2 -0
  125. package/dist/policy/types.js.map +1 -0
  126. package/dist/productTelemetry/index.d.ts +16 -0
  127. package/dist/productTelemetry/index.js +142 -0
  128. package/dist/productTelemetry/index.js.map +1 -0
  129. package/dist/providers/conformance.d.ts +7 -0
  130. package/dist/providers/conformance.js +48 -0
  131. package/dist/providers/conformance.js.map +1 -0
  132. package/dist/providers/index.d.ts +4 -2
  133. package/dist/providers/index.js +3 -1
  134. package/dist/providers/index.js.map +1 -1
  135. package/dist/providers/packs/resendPack.d.ts +2 -0
  136. package/dist/providers/packs/resendPack.js +147 -0
  137. package/dist/providers/packs/resendPack.js.map +1 -0
  138. package/dist/providers/packs/stripePack.d.ts +2 -0
  139. package/dist/providers/packs/stripePack.js +852 -0
  140. package/dist/providers/packs/stripePack.js.map +1 -0
  141. package/dist/providers/registry.d.ts +7 -3
  142. package/dist/providers/registry.js +55 -4
  143. package/dist/providers/registry.js.map +1 -1
  144. package/dist/providers/resend.js +2 -11
  145. package/dist/providers/resend.js.map +1 -1
  146. package/dist/providers/runtime.d.ts +8 -0
  147. package/dist/providers/runtime.js +48 -0
  148. package/dist/providers/runtime.js.map +1 -0
  149. package/dist/providers/stripeWebhook.d.ts +13 -0
  150. package/dist/providers/stripeWebhook.js +50 -0
  151. package/dist/providers/stripeWebhook.js.map +1 -0
  152. package/dist/providers/types.d.ts +153 -0
  153. package/dist/proxy/cacheKey.js +3 -3
  154. package/dist/proxy/cacheKey.js.map +1 -1
  155. package/dist/proxy/providerDetector.d.ts +2 -7
  156. package/dist/proxy/providerDetector.js +4 -4
  157. package/dist/proxy/providerDetector.js.map +1 -1
  158. package/dist/proxy/proxyHandler.js +116 -12
  159. package/dist/proxy/proxyHandler.js.map +1 -1
  160. package/dist/proxy/requestNormalizer.d.ts +0 -1
  161. package/dist/proxy/requestNormalizer.js +2 -5
  162. package/dist/proxy/requestNormalizer.js.map +1 -1
  163. package/dist/reliability/costGovernance.d.ts +175 -0
  164. package/dist/reliability/costGovernance.js +515 -0
  165. package/dist/reliability/costGovernance.js.map +1 -0
  166. package/dist/reliability/index.d.ts +8 -0
  167. package/dist/reliability/index.js +5 -0
  168. package/dist/reliability/index.js.map +1 -0
  169. package/dist/reliability/reconciliation.d.ts +157 -0
  170. package/dist/reliability/reconciliation.js +522 -0
  171. package/dist/reliability/reconciliation.js.map +1 -0
  172. package/dist/reliability/runtimeHealth.d.ts +60 -0
  173. package/dist/reliability/runtimeHealth.js +356 -0
  174. package/dist/reliability/runtimeHealth.js.map +1 -0
  175. package/dist/reliability/slo.d.ts +131 -0
  176. package/dist/reliability/slo.js +375 -0
  177. package/dist/reliability/slo.js.map +1 -0
  178. package/dist/report/safetyReport.js +7 -3
  179. package/dist/report/safetyReport.js.map +1 -1
  180. package/dist/safety/index.d.ts +2 -0
  181. package/dist/safety/index.js +2 -0
  182. package/dist/safety/index.js.map +1 -0
  183. package/dist/safety/safetyController.d.ts +187 -0
  184. package/dist/safety/safetyController.js +477 -0
  185. package/dist/safety/safetyController.js.map +1 -0
  186. package/dist/scenarios/scenarioBundle.d.ts +75 -0
  187. package/dist/scenarios/scenarioBundle.js +750 -0
  188. package/dist/scenarios/scenarioBundle.js.map +1 -0
  189. package/dist/scenarios/scenarioStore.d.ts +1 -0
  190. package/dist/scenarios/scenarioStore.js +47 -32
  191. package/dist/scenarios/scenarioStore.js.map +1 -1
  192. package/dist/security/headerSanitizer.d.ts +2 -0
  193. package/dist/security/headerSanitizer.js +36 -1
  194. package/dist/security/headerSanitizer.js.map +1 -1
  195. package/dist/security/secrets.js +24 -4
  196. package/dist/security/secrets.js.map +1 -1
  197. package/dist/server/accessControl.d.ts +5 -0
  198. package/dist/server/accessControl.js +100 -0
  199. package/dist/server/accessControl.js.map +1 -0
  200. package/dist/server/createServer.d.ts +0 -5
  201. package/dist/server/createServer.js +9 -29
  202. package/dist/server/createServer.js.map +1 -1
  203. package/dist/server/eventsStore.d.ts +6 -1
  204. package/dist/server/eventsStore.js +83 -15
  205. package/dist/server/eventsStore.js.map +1 -1
  206. package/dist/server/routes.js +36 -10
  207. package/dist/server/routes.js.map +1 -1
  208. package/dist/server/sse.d.ts +2 -1
  209. package/dist/server/sse.js +15 -3
  210. package/dist/server/sse.js.map +1 -1
  211. package/dist/setup/setupGenerator.js +53 -6
  212. package/dist/setup/setupGenerator.js.map +1 -1
  213. package/dist/state/stateStore.d.ts +5 -0
  214. package/dist/state/stateStore.js +48 -62
  215. package/dist/state/stateStore.js.map +1 -1
  216. package/dist/storage/fileStore.d.ts +10 -0
  217. package/dist/storage/fileStore.js +131 -0
  218. package/dist/storage/fileStore.js.map +1 -0
  219. package/dist/teamControl/controlPlane.d.ts +255 -0
  220. package/dist/teamControl/controlPlane.js +918 -0
  221. package/dist/teamControl/controlPlane.js.map +1 -0
  222. package/dist/teamControl/deployment.d.ts +33 -0
  223. package/dist/teamControl/deployment.js +67 -0
  224. package/dist/teamControl/deployment.js.map +1 -0
  225. package/dist/teamControl/index.d.ts +4 -0
  226. package/dist/teamControl/index.js +3 -0
  227. package/dist/teamControl/index.js.map +1 -0
  228. package/dist/tests/testGenerator.js +4 -1
  229. package/dist/tests/testGenerator.js.map +1 -1
  230. package/dist/trust/index.d.ts +2 -0
  231. package/dist/trust/index.js +2 -0
  232. package/dist/trust/index.js.map +1 -0
  233. package/dist/trust/trustLadder.d.ts +182 -0
  234. package/dist/trust/trustLadder.js +560 -0
  235. package/dist/trust/trustLadder.js.map +1 -0
  236. package/dist/worlds/index.d.ts +2 -0
  237. package/dist/worlds/index.js +2 -0
  238. package/dist/worlds/index.js.map +1 -0
  239. package/dist/worlds/worlds.d.ts +160 -0
  240. package/dist/worlds/worlds.js +491 -0
  241. package/dist/worlds/worlds.js.map +1 -0
  242. package/docs/assets/dashboard.png +0 -0
  243. package/docs/ci.md +49 -0
  244. package/docs/commercial/README.md +29 -0
  245. package/docs/commercial/data-inventory.md +36 -0
  246. package/docs/commercial/manual-invoicing.md +44 -0
  247. package/docs/commercial/metrics.md +51 -0
  248. package/docs/commercial/pricing.md +103 -0
  249. package/docs/commercial/privacy-policy-draft.md +41 -0
  250. package/docs/commercial/terms-topics-for-counsel.md +51 -0
  251. package/docs/design-partners/README.md +52 -0
  252. package/docs/design-partners/demo-narratives.md +33 -0
  253. package/docs/design-partners/design-partner-offer.md +39 -0
  254. package/docs/design-partners/discovery-questions.md +28 -0
  255. package/docs/design-partners/feedback-capture-template.md +48 -0
  256. package/docs/design-partners/icp-one-pager.md +43 -0
  257. package/docs/design-partners/onboarding-checklist.md +33 -0
  258. package/docs/design-partners/pilot-success-criteria.md +27 -0
  259. package/docs/design-partners/pricing-interview-script.md +18 -0
  260. package/docs/design-partners/telemetry-plan.md +48 -0
  261. package/docs/development/baseline.md +114 -0
  262. package/docs/development/onboarding-smoke.md +37 -0
  263. package/docs/development/verification-0.1.8.md +25 -0
  264. package/docs/enterprise-product-roadmap-ru.md +1879 -0
  265. package/docs/fundraising/README.md +87 -0
  266. package/docs/fundraising/data-room-checklist.md +72 -0
  267. package/docs/fundraising/demo-script.md +52 -0
  268. package/docs/fundraising/design-partners-50.md +74 -0
  269. package/docs/fundraising/launch-posts.md +37 -0
  270. package/docs/fundraising/metrics-and-evidence.md +30 -0
  271. package/docs/fundraising/roadmap-12-month.md +25 -0
  272. package/docs/fundraising/technical-due-diligence-index.md +37 -0
  273. package/docs/fundraising/yc-application.md +25 -0
  274. package/docs/github-actions.md +84 -0
  275. package/docs/hosted-pilot.md +111 -0
  276. package/docs/mcp.md +52 -50
  277. package/docs/operations/disaster-recovery-runbook.md +81 -0
  278. package/docs/operations/kill-switch-runbook.md +32 -0
  279. package/docs/policy.md +61 -0
  280. package/docs/providers/authoring-packs.md +175 -0
  281. package/docs/providers/stripe-core-pack.md +82 -0
  282. package/docs/release-checklist.md +83 -71
  283. package/docs/release-migration-and-rollback.md +63 -0
  284. package/docs/release-readiness.md +39 -0
  285. package/docs/security/action-gateway-threat-model.md +34 -0
  286. package/docs/security/action-ledger-incident-replay-threat-model.md +42 -0
  287. package/docs/security/approval-inbox-threat-model.md +35 -0
  288. package/docs/security/credential-broker-threat-model.md +52 -0
  289. package/docs/security/egress-threat-model.md +126 -0
  290. package/docs/security/inventory-threat-model.md +104 -0
  291. package/docs/security/kill-switch-budgets-threat-model.md +37 -0
  292. package/docs/security/reliability-threat-model.md +111 -0
  293. package/docs/security/trust-ladder-threat-model.md +33 -0
  294. package/docs/team-control-plane.md +72 -0
  295. package/docs/usage.md +571 -57
  296. package/examples/README.md +10 -0
  297. package/examples/agent-instructions/README.md +39 -39
  298. package/examples/ci-smoke/README.md +21 -0
  299. package/examples/ci-smoke/ghostapi.policy.yaml +22 -0
  300. package/examples/ci-smoke/package.json +9 -0
  301. package/examples/ci-smoke/production-egress.mjs +2 -0
  302. package/examples/ci-smoke/safe.mjs +17 -0
  303. package/examples/evals/README.md +24 -0
  304. package/examples/evals/retry-after.eval.json +52 -0
  305. package/examples/generic-rest/README.md +27 -27
  306. package/examples/github-fetch/README.md +35 -35
  307. package/examples/openai-streaming/README.md +16 -0
  308. package/examples/openai-streaming/streaming-tool-call.mjs +31 -0
  309. package/examples/policy/ghostapi.policy.yaml +27 -0
  310. package/examples/record-replay/README.md +19 -0
  311. package/examples/record-replay/replay-requests.json +22 -0
  312. package/examples/record-replay/stripe-checkout.har.json +30 -0
  313. package/examples/resend-node/README.md +22 -22
  314. package/examples/stripe-node/README.md +35 -29
  315. package/examples/stripe-node/checkout-flow.mjs +61 -0
  316. package/examples/twilio-node/README.md +21 -21
  317. package/examples/worlds/README.md +19 -0
  318. package/examples/worlds/subscription-recovery.mjs +12 -0
  319. package/package.json +27 -12
  320. package/dist/providers/stripe.d.ts +0 -2
  321. package/dist/providers/stripe.js +0 -15
  322. package/dist/providers/stripe.js.map +0 -1
  323. package/docs/assets/ghostapi-avatar.png +0 -0
package/CHANGELOG.md CHANGED
@@ -4,6 +4,44 @@ All notable changes to GhostAPI will be documented in this file.
4
4
 
5
5
  The format follows the spirit of [Keep a Changelog](https://keepachangelog.com/en/1.1.0/), and this project uses semantic versioning once public releases begin.
6
6
 
7
+ ## 0.1.8 - 2026-08-22
8
+
9
+ ### Security
10
+
11
+ - Added a local tenant-scoped action ledger with bounded structured redaction, SHA-256 append-only chains, verification/export integrity checks, legal-hold/deletion-request semantics, and no credential or raw payload persistence. Added incident-to-synthetic-world/scenario fixtures that replay only in memory and preserve ambiguous outcomes as reconciliation-required.
12
+ - Added a local tenant-scoped agent inventory and attack-path graph (`inventory.json`) with provenance- and freshness-carrying records and edges, tenant-scoped reads/writes/export, strict payload validation that rejects secret-shaped values, reference-bound operator authorization per action, bounded store, an open export (inventory, policies, eval scenario references, evidence metadata, removal analysis, ROI built only from imported counters and applied remediations), and a remediation workflow whose scope reductions are validated as strict subsets at proposal and apply time. Heuristic blast-radius classifications are explicitly labeled advisory. The enterprise pilot gate is not yet met; results are for local synthetic review.
13
+ - Added a persisted local synthetic safety controller with scoped kill switches, locked budget reservations, circuit breakers, bounded queue/dead-letter handling, audited separately authorized re-enable, final synthetic commit checks, and a scheduled non-destructive game-day drill. No provider, credential, HTTP, or hosted emergency transport was added.
14
+ - Added a local synthetic trust ladder with strict no-side-effect level capabilities, explicit unsupported dry-run/trusted states, verified-owner promotion evidence, deterministic scoped canaries, hash-only shadow/outcome comparison, automatic demotion/circuit-breaker policy, rollback audit reasons, and no provider execution path.
15
+ - Hardened the local approval inbox so inbox-issued artifacts cannot be submitted or executed through the public action-gateway path, and verified approver principals prevent actor aliases from self-approving or satisfying two-person review.
16
+ - Hardened credential execution receipts and revocation handling: vault/provider I/O no longer holds the broker mutation lock, executors must recheck active grants before side effects, and executor errors are recorded as non-retryable unknown outcomes rather than confirmed failures.
17
+ - Added a local approval inbox with action-hash-bound, one-time expiring artifacts, derived risk taxonomy, independent two-person approval, amount/resource/environment/actor/confidence/velocity policy checks, timeout/revoke fail-closed handling, and action-receipt-linked audit records for the synthetic adapter only.
18
+ - Added a credential-broker and workload-identity boundary that stores only metadata, issues scoped server-only short-lived grants bound to action receipts, rechecks revocation/expiry/scope/tenant/workload at execution, invalidates grants on rotation, and ships test-only vault/provider adapters without real credential or network capability.
19
+ - Bound explicit evidence run-input files before parsing and reject malformed JSON, preventing unbounded local memory consumption through `evidence generate --run`.
20
+ - Redact secret-shaped target-start errors before writing Linux run evidence.
21
+ - Redact secret-shaped target stdout/stderr before forwarding it to the operator or CI log, including tokens split across stream chunks; interrupted namespace runs now preserve the caller signal exit code and finalize evidence after escalation.
22
+ - Added bounded queue-body handling to the separate undeployed hosted pilot before signature verification or JSON parsing.
23
+ - Hardened the undeployed hosted pilot with explicit tenant/role authorization, tenant-safe cross-boundary responses, exact-origin mutation checks, secure session/cookie and response-header defaults, and one-time SHA-256-only invitation and ingest secrets.
24
+ - Added hosted request/body limits, concurrency-safe durable quotas, bounded worker/outbox retries and dead-letter state, retention cleanup, and dependency-aware readiness checks; these controls are implemented and locally verified but not yet deployed.
25
+ - Restricted the standard GitHub Actions CI token to `contents: read`.
26
+
27
+ ### Changed
28
+
29
+ - Published a valid package root with ESM and declaration exports, and extended packed-artifact smoke coverage to import `@yiaany/ghostapi` directly.
30
+ - Corrected repository identity to `yiaany/ghostapi`, standardized public commands on `@yiaany/ghostapi`, removed the bundled landing page so `/` opens the dashboard, and clarified setup generation and scenario arming behavior.
31
+ - Upgraded Vite and Vitest to audited compatible versions, added formatting checks, and expanded CI across Node.js and desktop platforms with package, production audit, and hosted-pilot checks.
32
+ - Clarified that `GET /health` is a liveness response that stays HTTP 200 while `GET /health/readiness` returns the structural report and HTTP 503 when dependencies are degraded.
33
+ - Added deterministic malformed-input regression coverage for policy, OpenAPI, and scenario-bundle parsers.
34
+ - Added release-readiness and migration/rollback documentation with platform-specific guarantees and known gaps.
35
+
36
+ ### Fixed
37
+
38
+ - Fixed dashboard clear actions so non-2xx responses are reported as failures, filtered request counts reflect visible rows, and malformed SSE messages are ignored without breaking the stream handler.
39
+ - Hardened the safety controller and action gateway: time-bounded synthetic leases with a default 60 s TTL, a two-phase final commit that re-checks the lease and records `action.final_check` after the operation, a tolerant terminal `complete()`, a stable `SAFETY_KILL_SWITCH` error code, and bounded dead-letter eviction. Gateway commit errors are no longer silently swallowed.
40
+ - Hardened the action ledger: caller-claimed basis markers on echoed policy/approval records, per-tenant retention rotation with hash-chain relinking at the 2,000-entry bound, and a `tracked` flag so a tenant without entries verifies distinctly from a broken chain.
41
+ - Hardened local reliability: SLO sampling is batch-bounded and latency counts only successful samples, reconciliation rejects missing worlds structurally and requires the `reconciliation.manage` permission, and cost governance is idempotent with a pure report path and tenant-scoped alerts.
42
+ - Hardened runtime health and backups: the inventory store is part of health checks, restores refuse non-empty directories, and backup exclusions use canonical cache/backup paths instead of folder names.
43
+ - Hardened the inventory controller: stale attack-path edges are filtered and garbage-collected, findings and import runs are bounded with per-tenant rotation, ineffective remediations can be reopened and are gated by injected eval-scenario existence, and remediation targets validate the environment reference.
44
+
7
45
  ## 0.1.7 - 2026-07-18
8
46
 
9
47
  ### Changed
@@ -14,8 +52,8 @@ The format follows the spirit of [Keep a Changelog](https://keepachangelog.com/e
14
52
 
15
53
  ### Fixed
16
54
 
17
- - Updated npm package repository, bugs, and homepage URLs to point to `yiaany/ghostapi` instead of broken legacy links.
18
- - Replaced custom CI badge with live GitHub Actions workflow status badge (`yiaany/ghostapi/actions/workflows/ci.yml/badge.svg`).
55
+ - Updated npm package repository, bugs, and homepage URLs to point to the then-current repository instead of broken legacy links.
56
+ - Replaced the custom CI badge with a live GitHub Actions workflow status badge.
19
57
 
20
58
  ## 0.1.5 - 2026-07-18
21
59
 
@@ -67,6 +105,8 @@ The format follows the spirit of [Keep a Changelog](https://keepachangelog.com/e
67
105
 
68
106
  ### Security
69
107
 
108
+ - Added a local reliability layer with bounded stores and reference-bound capabilities: a local SLO controller (`slo.json`) that records samples only with a verified record capability, restricts configure/evaluate to authenticated operators, trims evaluation windows, and caps samples per metric and store bytes; a local reconciliation service (`reconciliation.json`) that blocks on ledger integrity failure, classifies ledger timelines as committed/not-committed/unknown/compensated/drifted against synthetic provider state, opens resolveable findings, and records duplicate-prevention, receipt-verification, availability, and execution-latency SLI samples; a local cost-governance store (`costs.json`) with capped attribution records, budgets, acknowledgeable alerts, and a linear-extrapolation forecast explicitly labeled as not a provider invoice; and runtime health plus verified local backup/restore (`reliability/backups/`) with sha256 manifests, tamper and path-traversal rejection, and no egress. `GET /health` reports liveness with readiness state at HTTP 200, while `GET /health/readiness` returns the structural report and HTTP 503 when a store is degraded.
109
+
70
110
  - No real external provider API calls by default.
71
111
  - Secrets are masked before prompt construction, cache key generation, event logging, and dashboard rendering.
72
112
  - `ghostapi doctor` warns about unsafe TLS bypass settings.
package/CONTRIBUTING.md CHANGED
@@ -1,117 +1,119 @@
1
- # Contributing to GhostAPI
2
-
3
- Thanks for helping improve GhostAPI. This project aims to be small, safe, local-first, and useful for developers and AI coding agents.
4
-
5
- ## Setup
6
-
7
- Requirements:
8
-
9
- - Node.js 20 or newer
10
- - npm
11
-
12
- Install dependencies:
13
-
14
- ```bash
15
- npm install
16
- ```
17
-
18
- Run the local development server:
19
-
20
- ```bash
21
- npm run dev
22
- ```
23
-
24
- Open:
25
-
26
- ```text
27
- http://localhost:8080/dashboard
28
- ```
29
-
30
- ## Scripts
31
-
32
- ```bash
33
- npm run typecheck
34
- npm test
35
- npm run build
36
- npm run dev
37
- ```
38
-
39
- Use these before opening a pull request:
40
-
41
- ```bash
42
- npm run typecheck
43
- npm test
44
- npm run build
45
- ```
46
-
47
- ## Tests
48
-
49
- Tests are written with Vitest and must stay local-only. Do not add tests that call real Stripe, Twilio, Resend, GitHub, OpenAI, or any other external API.
50
-
51
- Current test areas include:
52
-
53
- - Secret masking
54
- - Provider detection
55
- - Cache key stability
56
- - State save/read/list/delete
57
- - Provider error formatting
58
- - Prompt construction and JSON repair
59
- - Proxy flow integration
60
- - Dashboard/SSE event formatting
61
-
62
- Shared fixtures live in `test/fixtures/`.
63
-
64
- ## Coding Style
65
-
66
- - TypeScript strict mode.
67
- - ESM modules.
68
- - Prefer functions and simple objects over classes.
69
- - Keep modules small and direct.
70
- - Avoid `any`; use `unknown` and narrow values where possible.
71
- - Add comments only where behavior is not obvious.
72
- - Keep user-facing errors actionable.
73
- - Do not introduce network calls to real provider APIs by default.
74
-
75
- ## Adding A Provider
76
-
77
- GhostAPI intentionally keeps native adapters limited. For the MVP, native adapters are:
78
-
79
- - Stripe
80
- - Twilio
81
- - Resend
82
- - GitHub
83
- - Discord
84
- - OpenAI
85
- - Generic fallback
86
-
87
- Before adding a new native adapter, ask whether generic fallback plus prompt hints is enough. Native adapters should be reserved for providers where contract-specific behavior, validation, or error formatting is clearly worth maintaining.
88
-
89
- If a native adapter is justified:
90
-
91
- 1. Add the adapter under `src/providers/`.
92
- 2. Register it in `src/providers/registry.ts`.
93
- 3. Add detection rules in `src/proxy/providerDetector.ts`.
94
- 4. Add provider-specific prompt guidance in `src/ai/prompts.ts` only if useful.
95
- 5. Add tests for detection, formatting, validation, and proxy behavior.
96
- 6. Update README provider matrix.
97
-
98
- ## Adding Prompt Hints
99
-
100
- Most services should use generic fallback. To improve generic behavior:
101
-
102
- 1. Add or refine lightweight inference in `src/ai/genericInference.ts`.
103
- 2. Keep labels best-effort, such as `generic:shopify-like`.
104
- 3. Do not add provider-specific validation or error formats for generic services.
105
- 4. Add tests in `test/genericInference.test.ts`.
106
- 5. Update README coverage if the change affects documented behavior.
107
-
108
- ## Pull Request Checklist
109
-
110
- - The change is scoped and explained clearly.
111
- - `npm run typecheck` passes.
112
- - `npm test` passes.
113
- - `npm run build` passes.
114
- - New behavior has tests when practical.
115
- - No real external API calls were added by default.
116
- - Secrets are not logged, cached, sent to LLM prompts, or exposed in dashboard payloads.
117
- - README or examples are updated when user-facing behavior changes.
1
+ # Contributing to GhostAPI
2
+
3
+ Thanks for helping improve GhostAPI. This project aims to be small, safe, local-first, and useful for developers and AI coding agents.
4
+
5
+ ## Setup
6
+
7
+ Requirements:
8
+
9
+ - Node.js 20 or newer
10
+ - npm
11
+
12
+ Install dependencies:
13
+
14
+ ```bash
15
+ npm install
16
+ ```
17
+
18
+ Run the local development server:
19
+
20
+ ```bash
21
+ npm run dev
22
+ ```
23
+
24
+ Open:
25
+
26
+ ```text
27
+ http://localhost:8080/dashboard
28
+ ```
29
+
30
+ ## Scripts
31
+
32
+ ```bash
33
+ npm run typecheck
34
+ npm run lint
35
+ npm test
36
+ npm run build
37
+ npm run dev
38
+ ```
39
+
40
+ Use these before opening a pull request:
41
+
42
+ ```bash
43
+ npm run typecheck
44
+ npm run lint
45
+ npm test
46
+ npm run build
47
+ ```
48
+
49
+ ## Tests
50
+
51
+ Tests are written with Vitest and must stay local-only. Do not add tests that call real Stripe, Twilio, Resend, GitHub, OpenAI, or any other external API.
52
+
53
+ Current test areas include:
54
+
55
+ - Secret masking
56
+ - Provider detection
57
+ - Cache key stability
58
+ - State save/read/list/delete
59
+ - Provider error formatting
60
+ - Prompt construction and JSON repair
61
+ - Proxy flow integration
62
+ - Dashboard/SSE event formatting
63
+
64
+ Shared fixtures live in `test/fixtures/`.
65
+
66
+ ## Coding Style
67
+
68
+ - TypeScript strict mode.
69
+ - ESM modules.
70
+ - Prefer functions and simple objects over classes.
71
+ - Keep modules small and direct.
72
+ - Avoid `any`; use `unknown` and narrow values where possible.
73
+ - Add comments only where behavior is not obvious.
74
+ - Keep user-facing errors actionable.
75
+ - Do not introduce network calls to real provider APIs by default.
76
+
77
+ ## Adding A Provider
78
+
79
+ GhostAPI intentionally keeps native adapters limited. For the MVP, native adapters are:
80
+
81
+ - Stripe
82
+ - Twilio
83
+ - Resend
84
+ - GitHub
85
+ - Discord
86
+ - OpenAI
87
+ - Generic fallback
88
+
89
+ Before adding a new native adapter, ask whether generic fallback plus prompt hints is enough. Native adapters should be reserved for providers where contract-specific behavior, validation, or error formatting is clearly worth maintaining.
90
+
91
+ If a native adapter is justified:
92
+
93
+ 1. Read `docs/providers/authoring-packs.md`.
94
+ 2. Add one built-in pack under `src/providers/packs/`.
95
+ 3. Register it in `src/providers/registry.ts` without changing generic fallback.
96
+ 4. Add deterministic conformance fixtures and provider regression tests.
97
+ 5. Do not import network, filesystem, environment, or state-store capabilities into the pack.
98
+ 6. Update README provider coverage and the versioned capability manifest.
99
+
100
+ ## Adding Prompt Hints
101
+
102
+ Most services should use generic fallback. To improve generic behavior:
103
+
104
+ 1. Add or refine lightweight inference in `src/ai/genericInference.ts`.
105
+ 2. Keep labels best-effort, such as `generic:shopify-like`.
106
+ 3. Do not add provider-specific validation or error formats for generic services.
107
+ 4. Add tests in `test/genericInference.test.ts`.
108
+ 5. Update README coverage if the change affects documented behavior.
109
+
110
+ ## Pull Request Checklist
111
+
112
+ - The change is scoped and explained clearly.
113
+ - `npm run typecheck` passes.
114
+ - `npm test` passes.
115
+ - `npm run build` passes.
116
+ - New behavior has tests when practical.
117
+ - No real external API calls were added by default.
118
+ - Secrets are not logged, cached, sent to LLM prompts, or exposed in dashboard payloads.
119
+ - README or examples are updated when user-facing behavior changes.
package/LICENSE CHANGED
@@ -1,21 +1,21 @@
1
- MIT License
2
-
3
- Copyright (c) 2026 GhostAPI contributors
4
-
5
- Permission is hereby granted, free of charge, to any person obtaining a copy
6
- of this software and associated documentation files (the "Software"), to deal
7
- in the Software without restriction, including without limitation the rights
8
- to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9
- copies of the Software, and to permit persons to whom the Software is
10
- furnished to do so, subject to the following conditions:
11
-
12
- The above copyright notice and this permission notice shall be included in all
13
- copies or substantial portions of the Software.
14
-
15
- THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16
- IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17
- FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18
- AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19
- LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20
- OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21
- SOFTWARE.
1
+ MIT License
2
+
3
+ Copyright (c) 2026 GhostAPI contributors
4
+
5
+ Permission is hereby granted, free of charge, to any person obtaining a copy
6
+ of this software and associated documentation files (the "Software"), to deal
7
+ in the Software without restriction, including without limitation the rights
8
+ to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9
+ copies of the Software, and to permit persons to whom the Software is
10
+ furnished to do so, subject to the following conditions:
11
+
12
+ The above copyright notice and this permission notice shall be included in all
13
+ copies or substantial portions of the Software.
14
+
15
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16
+ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17
+ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18
+ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19
+ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20
+ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21
+ SOFTWARE.