mirror of
https://github.com/hanzoai/trust.git
synced 2026-10-30 14:54:58 +00:00
A cloud plugin (HIP-0106, the captable/plans shape) that publishes a control inventory, folds it onto published framework clause lists, and reads evidence from the platform's audit trail at /v1/trust/*. The inventory is the product. Every entry names the repo and path where the mechanism lives, and five entries record that a mechanism is weaker than a Hanzo page claims — the segment-wise prefix test and in-module key custody do not exist, the trail captures no request body, and its user column is unindexed. An inventory that cannot say that is worth nothing. Coverage is a fold, never a field. A mapping is worth the weakest of what the control claims, how much of the clause it answers, and whether anything can fail on its behalf; an absent control is worth nothing however it maps. The denominator is each framework's whole published clause list, so uncovered clauses stay visible. Every count carries its unit and nothing emits a boolean. The build validates before it bundles: an unknown status, a mapping to an undeclared clause, or prose claiming a certification stops the build, so there is no artifact and therefore no number to misread. No database and no writes — the inventory compiles into the bundle, so no tenant can inflate its own coverage. The audit query carries no org field; the host binds the trail to the tenant it validated. 77 tests over the built artifact in a bare vm, proven to fail by mutation.
33 lines
969 B
JavaScript
33 lines
969 B
JavaScript
// Thirty lines instead of a test framework.
|
|
//
|
|
// `it` takes a sync or async body and chains it onto ONE serial queue, so cases
|
|
// run in the order they were written and a build in one does not race a build in
|
|
// another. `settled()` is what the runner awaits; the exit hook prints the tally
|
|
// and sets the code, so a file run directly reports exactly like the suite does.
|
|
|
|
let passed = 0;
|
|
let failed = 0;
|
|
let queue = Promise.resolve();
|
|
|
|
export function it(name, fn) {
|
|
queue = queue.then(async () => {
|
|
try {
|
|
await fn();
|
|
passed++;
|
|
console.log(`ok - ${name}`);
|
|
} catch (err) {
|
|
failed++;
|
|
const detail = String((err && err.message) || err).split("\n").join("\n ");
|
|
console.log(`FAIL - ${name}\n ${detail}`);
|
|
}
|
|
});
|
|
return queue;
|
|
}
|
|
|
|
export const settled = () => queue;
|
|
|
|
process.on("exit", (code) => {
|
|
console.log(`\n${passed} passed, ${failed} failed`);
|
|
if (failed && !code) process.exitCode = 1;
|
|
});
|