Promote schema and canonicalizer out of history; add EvidenceModel (T06)
Verified the three published hashes reproduce byte for byte before promoting anything, then moved the schema, canonicalizer and vectors into governed assets. history/20260909-initial-exploration/ is untouched and stays the provenance record. - schemas/, informed_decision/, tests/vectors/ populated; the reference canonicalizer's ad-hoc __main__ block replaced by a real `python -m informed_decision` entry point. - tests/test_canonicalize.py — 20 tests, all green. Published vectors, all four isolation properties, canonical-form round-trip, key sorting, and a provenance test asserting the governed fixtures have not drifted from history/. - docs/specs/EvidenceModel.md — the two hashes, the split and why it exists, the four isolation properties, the presentation record, the bundle, and the relationship to audit-core. - pyproject.toml, Makefile. One test of mine was wrong on first run: it scanned for ", " to assert no insignificant whitespace, which fires on prose inside a brief. Replaced with a canonical round-trip comparison, which is the property actually meant. The canonicalizer was correct. EvidenceModel leads with what the model does NOT claim — no proof of comprehension, no proof of reading (deliberately, since the alternative is surveillance), no survival of a compromised surface, and audit-core's inherited bound that a hash chain cannot prove a record was never sent. T06 stays progress: the SCOPE.md rewrite is gated on the T02 ruling. Co-Authored-By: Claude Opus 5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01V3W1dQG7GFFM9d94jFx7iR Assistant: claude-code Assistant-Model: opus Assistant-Process: 1565372@bnt-lap001 Assistant-Session: 16bb2f25-b34c-49ef-8e94-5fec3567a568
This commit is contained in:
parent
7ae67b2f4e
commit
a8e227851e
19 changed files with 2207 additions and 2 deletions
31
tests/vectors/adr-binding.json
Normal file
31
tests/vectors/adr-binding.json
Normal file
|
|
@ -0,0 +1,31 @@
|
|||
{
|
||||
"memo_id": "01K4Q8Z3R7V2N6K9M1P5T8W4XC",
|
||||
"memo_version": 2,
|
||||
"question": "Do you formally accept ADR-0042 as the billing architecture for prod?",
|
||||
"requested_act": "accept",
|
||||
"binding_level": "aes",
|
||||
"brief": "Replace nightly batch invoicing with an append-only event ledger.",
|
||||
"locale": "en",
|
||||
"ui_release": "informed-decision@0.3.1",
|
||||
"packet": [
|
||||
{
|
||||
"item_id": "01K4Q8DOC0000000000000001",
|
||||
"hash": {
|
||||
"alg": "sha256",
|
||||
"hex": "6b1c0f8a9d2e4c7b8a1f0e3d5c6b7a8f9e0d1c2b3a4f5e6d7c8b9a0f1e2d3c4b"
|
||||
}
|
||||
}
|
||||
],
|
||||
"highlights": [
|
||||
{
|
||||
"id": "01K4Q8HL00000000000000001",
|
||||
"item_id": "01K4Q8DOC0000000000000001",
|
||||
"severity": "critical",
|
||||
"required_ack": true,
|
||||
"locator": {
|
||||
"kind": "markdown_heading",
|
||||
"heading": "Consequences / rollback"
|
||||
}
|
||||
}
|
||||
]
|
||||
}
|
||||
5
tests/vectors/expected.json
Normal file
5
tests/vectors/expected.json
Normal file
|
|
@ -0,0 +1,5 @@
|
|||
{
|
||||
"login_view_hash": "492d9d311bf44ec9de0d0abef28abac7d31df2781527e8fe276a3186ee1b06b8",
|
||||
"login_awareness_hash": "2be7742970a01e7a879ae5040660659fb8c9a5c024e6c7fb338f3944a4fe05d1",
|
||||
"adr_view_hash": "1c89ec07c3cc9d16f85a1ba1be5169456b3c55d21161f64037787779ae91f202"
|
||||
}
|
||||
63
tests/vectors/login-awareness.json
Normal file
63
tests/vectors/login-awareness.json
Normal file
|
|
@ -0,0 +1,63 @@
|
|||
{
|
||||
"memo_id": "01K4LOGIN00000000000000001",
|
||||
"memo_version": 1,
|
||||
"locale": "en",
|
||||
"ui_release": "informed-decision@0.4.0",
|
||||
"proposed_hat": {
|
||||
"id": "hat:finance-controller",
|
||||
"label": "Finance Controller",
|
||||
"kind": "access_profile",
|
||||
"elevates": false,
|
||||
"permissions_preview": ["invoice.read", "invoice.export"],
|
||||
"scope_id": "tenant:acme"
|
||||
},
|
||||
"proposed_hat_source": "last_used",
|
||||
"available_hats": [
|
||||
{
|
||||
"id": "hat:finance-controller",
|
||||
"label": "Finance Controller",
|
||||
"kind": "access_profile",
|
||||
"elevates": false,
|
||||
"permissions_preview": ["invoice.read", "invoice.export"],
|
||||
"scope_id": "tenant:acme"
|
||||
},
|
||||
{
|
||||
"id": "hat:auditor-readonly",
|
||||
"label": "Auditor (read-only)",
|
||||
"kind": "perspective",
|
||||
"elevates": false,
|
||||
"permissions_preview": ["invoice.read"],
|
||||
"scope_id": "tenant:acme"
|
||||
},
|
||||
{
|
||||
"id": "hat:payroll-admin",
|
||||
"label": "Payroll Admin",
|
||||
"kind": "role",
|
||||
"elevates": true,
|
||||
"permissions_preview": ["payroll.run", "employee.export-all"],
|
||||
"scope_id": "tenant:acme"
|
||||
}
|
||||
],
|
||||
"available_scopes": [
|
||||
{
|
||||
"kind": "tenant",
|
||||
"id": "tenant:acme",
|
||||
"label": "ACME Corp",
|
||||
"environment": "prod",
|
||||
"requires_new_bind": true
|
||||
},
|
||||
{
|
||||
"kind": "tenant",
|
||||
"id": "tenant:beta",
|
||||
"label": "Beta GmbH",
|
||||
"environment": "prod",
|
||||
"requires_new_bind": true
|
||||
}
|
||||
],
|
||||
"last_session": {
|
||||
"ended_at": "2026-09-08T16:12:00Z",
|
||||
"hat_id": "hat:finance-controller",
|
||||
"scope_id": "tenant:acme"
|
||||
},
|
||||
"situation_note": "Last session Tuesday 18:12 CEST as Finance Controller in ACME. Payroll Admin is an elevating hat and needs its own bind."
|
||||
}
|
||||
73
tests/vectors/login-binding.json
Normal file
73
tests/vectors/login-binding.json
Normal file
|
|
@ -0,0 +1,73 @@
|
|||
{
|
||||
"memo_id": "01K4LOGIN00000000000000001",
|
||||
"memo_version": 1,
|
||||
"question": "Log into Payroll-Prod as Bernd Worsch in tenant ACME?",
|
||||
"requested_act": "login",
|
||||
"binding_level": "organizational",
|
||||
"brief": "You are entering Payroll-Prod. Sessions are recorded. Privileges at the gate are identity-scoped, not hat-scoped.",
|
||||
"locale": "en",
|
||||
"ui_release": "informed-decision@0.4.0",
|
||||
"packet": [],
|
||||
"highlights": [],
|
||||
"binding": {
|
||||
"principal": {
|
||||
"id": "01K4PERSONBERND00000000001",
|
||||
"kind": "person",
|
||||
"display_name": "Bernd Worsch",
|
||||
"role": "employee",
|
||||
"identifiers": [
|
||||
{ "scheme": "email", "value": "bernd.worsch@example.com" },
|
||||
{ "scheme": "idp:oidc-sub", "value": "auth.example.com|bernd" }
|
||||
]
|
||||
},
|
||||
"available_identities": [
|
||||
{
|
||||
"id": "01K4PERSONBERND00000000001",
|
||||
"kind": "person",
|
||||
"display_name": "Bernd Worsch",
|
||||
"identifiers": [
|
||||
{ "scheme": "idp:oidc-sub", "value": "auth.example.com|bernd" }
|
||||
]
|
||||
},
|
||||
{
|
||||
"id": "01K4PERSONBERNDADMIN000001",
|
||||
"kind": "person",
|
||||
"display_name": "Bernd Worsch (break-glass)",
|
||||
"identifiers": [
|
||||
{ "scheme": "idp:oidc-sub", "value": "auth.example.com|bernd-bg" }
|
||||
]
|
||||
}
|
||||
],
|
||||
"target": {
|
||||
"kind": "tenant",
|
||||
"id": "tenant:acme",
|
||||
"label": "ACME Corp",
|
||||
"environment": "prod",
|
||||
"requires_new_bind": true
|
||||
},
|
||||
"available_bind_scopes": [
|
||||
{
|
||||
"kind": "tenant",
|
||||
"id": "tenant:acme",
|
||||
"label": "ACME Corp",
|
||||
"environment": "prod",
|
||||
"requires_new_bind": true
|
||||
},
|
||||
{
|
||||
"kind": "tenant",
|
||||
"id": "tenant:beta",
|
||||
"label": "Beta GmbH",
|
||||
"environment": "prod",
|
||||
"requires_new_bind": true
|
||||
}
|
||||
],
|
||||
"granted_at_bind": {
|
||||
"roles": ["authenticated"],
|
||||
"permissions": ["session.create"]
|
||||
},
|
||||
"terms": {
|
||||
"monitoring": true,
|
||||
"consent_code": "LOGIN-PROD-2026"
|
||||
}
|
||||
}
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue