{"_id":"@cubiczan/chp","_rev":"2-88baec00b1dc6fed1f0d9bf1c75cb5c2","name":"@cubiczan/chp","dist-tags":{"latest":"0.1.1"},"versions":{"0.1.0":{"name":"@cubiczan/chp","version":"0.1.0","keywords":["chp","consensus-hardening","ai-agents","governance","audit","capital-gate"],"author":{"name":"Shyam Desigan","email":"sam@cubiczan.com"},"license":"MIT","_id":"@cubiczan/chp@0.1.0","maintainers":[{"name":"cubiczan","email":"icohangar@gmail.com"}],"homepage":"https://github.com/icohangar-ops/cubiczan-chp#readme","bugs":{"url":"https://github.com/icohangar-ops/cubiczan-chp/issues"},"bin":{"chp-adapter":"dist/adapter.js"},"dist":{"shasum":"2d5c80b8b0b727a471882d9c90bbf35b5d9cde72","tarball":"https://registry.npmjs.org/@cubiczan/chp/-/chp-0.1.0.tgz","fileCount":11,"integrity":"sha512-y69ykLLPMdcbLaMPy7e2tLdW2bn6+ualYL0IRLJRyQDw6n+F/U0DGFpdmTnq4gU8VwJNahWD43BzVuf0P4xhxw==","signatures":[{"sig":"MEUCIQCMCD+2MmMBFXh4eFoBtr/ImoVACOyvwLK/wFeWzCmC5QIgLeclzvsoUPJof/SJuo3K/2CG6j+PijGx35JFoQchAio=","keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U"}],"unpackedSize":17988},"main":"./dist/index.js","type":"module","types":"./dist/index.d.ts","engines":{"node":">=18"},"exports":{".":{"types":"./dist/index.d.ts","import":"./dist/index.js"}},"gitHead":"cbb120b6a848faef664a8feae197465d52576278","scripts":{"test":"npm run build && node --test dist/*.test.js","build":"tsc -p tsconfig.json","conformance":"npm run build && python3 \"$CHP_SPEC/conformance/run_conformance.py\" --adapter-cmd \"node dist/adapter.js\" --profile B","prepublishOnly":"npm run build"},"_npmUser":{"name":"cubiczan","email":"icohangar@gmail.com"},"repository":{"url":"git+https://github.com/icohangar-ops/cubiczan-chp.git","type":"git"},"_npmVersion":"12.0.2","description":"Consensus Hardening Protocol — Profile B capital gate, canonical JSON, and signed audit ledger for TypeScript","directories":{},"_nodeVersion":"26.0.0","publishConfig":{"access":"public"},"_hasShrinkwrap":false,"devDependencies":{"typescript":"^5.8.0","@types/node":"^22.15.0"},"_npmOperationalInternal":{"tmp":"tmp/chp_0.1.0_1787362651301_0.11806398099696058","host":"s3://npm-registry-packages-npm-production"}},"0.1.1":{"name":"@cubiczan/chp","version":"0.1.1","description":"Consensus Hardening Protocol — Profile B capital gate, canonical JSON, and signed audit ledger for TypeScript","type":"module","main":"./dist/index.js","types":"./dist/index.d.ts","exports":{".":{"types":"./dist/index.d.ts","import":"./dist/index.js"}},"bin":{"chp-adapter":"bin/chp-adapter.js"},"scripts":{"build":"tsc -p tsconfig.json","test":"npm run build && node --test dist/*.test.js","conformance":"npm run build && python3 \"$CHP_SPEC/conformance/run_conformance.py\" --adapter-cmd \"node dist/adapter.js\" --profile B","prepublishOnly":"npm run build"},"keywords":["chp","consensus-hardening","ai-agents","governance","audit","capital-gate"],"author":{"name":"Shyam Desigan","email":"sam@cubiczan.com"},"license":"MIT","repository":{"type":"git","url":"git+https://github.com/icohangar-ops/cubiczan-chp.git"},"homepage":"https://github.com/icohangar-ops/cubiczan-chp#readme","bugs":{"url":"https://github.com/icohangar-ops/cubiczan-chp/issues"},"engines":{"node":">=18"},"devDependencies":{"@types/node":"^22.15.0","typescript":"^5.8.0"},"publishConfig":{"access":"public"},"gitHead":"e58abd7f59cb9c8389ab8f74b949b63b1087f9b4","_id":"@cubiczan/chp@0.1.1","_nodeVersion":"26.0.0","_npmVersion":"12.0.2","dist":{"integrity":"sha512-pqK/DEEqxo8ReJNexGu0KQB2Q9FVEvNWo9F2xZzphEQdhqqYKSiYeaFDZh2nCgIIB1+nXKBs6spRv3GBVNd1QQ==","shasum":"c4fedbeed69a129fc08191a675398f223538331b","tarball":"https://registry.npmjs.org/@cubiczan/chp/-/chp-0.1.1.tgz","fileCount":12,"unpackedSize":18193,"signatures":[{"keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U","sig":"MEUCIQD1vIXBrVAD3Z4AsTT32L/ygDX5mENlNjEw/zsFBsMqXAIgYEFU2gszdyh1GJcebQK/BdKzxKEjwS1kERsBfyzE+3Y="}]},"_npmUser":{"name":"cubiczan","email":"icohangar@gmail.com"},"directories":{},"maintainers":[{"name":"cubiczan","email":"icohangar@gmail.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages-npm-production","tmp":"tmp/chp_0.1.1_1787362880662_0.24920796304350312"},"_hasShrinkwrap":false}},"time":{"created":"2026-08-22T01:37:31.139Z","modified":"2026-08-22T01:41:20.976Z","0.1.0":"2026-08-22T01:37:31.454Z","0.1.1":"2026-08-22T01:41:20.814Z"},"bugs":{"url":"https://github.com/icohangar-ops/cubiczan-chp/issues"},"author":{"name":"Shyam Desigan","email":"sam@cubiczan.com"},"license":"MIT","homepage":"https://github.com/icohangar-ops/cubiczan-chp#readme","keywords":["chp","consensus-hardening","ai-agents","governance","audit","capital-gate"],"repository":{"type":"git","url":"git+https://github.com/icohangar-ops/cubiczan-chp.git"},"description":"Consensus Hardening Protocol — Profile B capital gate, canonical JSON, and signed audit ledger for TypeScript","maintainers":[{"name":"cubiczan","email":"icohangar@gmail.com"}],"readme":"# `@cubiczan/chp`\n\nConsensus Hardening Protocol for TypeScript — **Profile B** capital gate,\ncanonical JSON, and signed audit ledger.\n\n```bash\nnpm install @cubiczan/chp\n```\n\nPairs with the Python package [`consensus-hardening-protocol`](https://pypi.org/project/consensus-hardening-protocol/)\n(Profile A deliberation + the normative spec). This package is the installable\nTypeScript surface for spend/mandate gates — the same channel shape as\n`@cubiczan/codesentinel-mcp`.\n\n## Quick start\n\n```ts\nimport { evaluateGate, approveHuman } from \"@cubiczan/chp\";\n\nconst policy = {\n  max_notional: 500,\n  daily_cap: 2500,\n  hitl_threshold: 250,\n  min_confidence: 0.55,\n  allowed_actions: [\"LONG\", \"SHORT\"],\n};\n\nconst decision = evaluateGate(\n  { action: \"LONG\", asset: \"ETH\", notional: 300, confidence: 0.9 },\n  policy,\n);\n// → { state: \"HITL_REQUIRED\", requires_human: true, ... }\n\nconst locked = approveHuman(\n  { action: \"LONG\", asset: \"ETH\", notional: 300, confidence: 0.9 },\n  policy,\n  \"cfo@example.com\",\n);\n// → { state: \"LOCKED\", allowed: true, ... }\n```\n\nHard rule failures (`max_notional`, `daily_cap`, `min_confidence`, …) are\ncollected **before** the HITL threshold test. A human may cross the threshold;\nthey may not approve a policy violation (spec §6.3 / §6.5).\n\n## Cross-language hashes\n\nCHP content hashes are SHA-256 over [canonical JSON](https://github.com/icohangar-ops/consensus-hardening-protocol/blob/main/spec/CHP-v1.0.md)\n(spec §3.1). Python emits whole floats as `100.0`; JavaScript's `JSON.stringify`\nemits `100`. This package formats Profile B hashed field sets the Python way so\naudit digests match the golden vectors and the Python reference.\n\n## Conformance adapter\n\n```bash\nnpm run build\npython3 path/to/spec/conformance/run_conformance.py \\\n  --adapter-cmd \"node dist/adapter.js\" \\\n  --profile B\n```\n\nProfile A ops are reported `unsupported` (SKIP), not FAIL.\n\n## Licence\n\nMIT.\n","readmeFilename":"README.md"}