Prepare exact informed-decision catalogue maintenance decision packet
Assistant: codex Assistant-Model: gpt-6.1-sol Assistant-Session: 01a126e1-76f8-7643-8cf3-e93336539ade
This commit is contained in:
parent
c89614ec81
commit
5d80644efa
29 changed files with 2033 additions and 0 deletions
|
|
@ -39,3 +39,7 @@ the revised executor requires an exact integer. Five source negatives pass.
|
|||
The original16 PostgreSQL checks are retained as prior-source mechanism proof;
|
||||
the revised source needs its own actual final verification and formal User
|
||||
Engine review before an exact founder exception is requested.
|
||||
|
||||
## Supplementary source readiness — human packet preparation
|
||||
|
||||
Dedicated User Engine owner agreement and final-owner-postgres-receipt now record21 real isolated checks on corrected executor b0dbbb9786e927055030acf849a72e9a44e9d3d55c84efdf245e419d381684f3, reviewed refined nine-file manifest0ff545d26a0fd72f06040fe377de3efdcc3bd62cdcb6f653247c8ba72f3f34a7. NetKingdom independently agrees to the exception scope and Informed Decision acknowledges its application facts in their own review files. Original constructor failures and earlier16 tests above remain historical evidence. New six offline transport guards test existing unchanged3e594 source without SSH/native invocation. The requesting human packet is docs/evidence/2026-10-11-one-app-catalogue-human-packet: it requests a separate exact founder exception, records conditional restoration and leaves native disposition/dry-run/apply/catalogue verification pending. This note is not a formal owner review or an active waiver.
|
||||
|
|
|
|||
|
|
@ -0,0 +1,61 @@
|
|||
# Informed Decision application-owner catalogue facts review
|
||||
|
||||
```yaml
|
||||
reviewer: informed-decision-owner (agent informed-decision, codex)
|
||||
decision: approved
|
||||
work_item: INFD-WP-ADHOC-2026-10-11-T01
|
||||
scope: application-facts source acknowledgement only
|
||||
comment: >-
|
||||
INTENT.md Purpose and What informed-decision Owns assign the decision surface
|
||||
and browser client to this repository; What informed-decision Does Not Own
|
||||
and Design Principles 9-10 reserve authorization, authentication and human
|
||||
binding to their respective owners. Exact canonical-records.json SHA-256
|
||||
ae6fde5f2c879e75fabb53e132261899dae0f4d864e18dd425bc272be713426b and refined
|
||||
nine-file executor manifest SHA-256
|
||||
0ff545d26a0fd72f06040fe377de3efdcc3bd62cdcb6f653247c8ba72f3f34a7 were reviewed
|
||||
under INFD-WP-ADHOC-2026-10-11-T01. Application facts agree with the native
|
||||
identity/declaration/client/requester source and existing value-free receipts.
|
||||
```
|
||||
|
||||
Application is `informed-decision`, display name `Informed Decision`, owner
|
||||
`informed-decision`, allowed profile scopes exactly `[global]`, allowed
|
||||
projection types exactly `[application_runtime]`. Binding is application
|
||||
`informed-decision`, browser OIDC client `informed-decision-approver`, protected
|
||||
system `informed-decision`, empty `catalog_namespaces`, null `event_source`
|
||||
and null `deployment_ref`. These are two catalogue metadata entities only;
|
||||
allowed profile/projection vocabulary is not a user permission or an IAM grant.
|
||||
|
||||
`informed_decision/oidc.py` fixes the browser client, HTTPS origin and exact
|
||||
callback; `informed_decision/policy.py:build_request` submits protected system
|
||||
`informed-decision`. Governing INTENT.md declares `Staff`/`pep-shaped`, matching
|
||||
its derived `layer.yaml`; no layer or role change is proposed.
|
||||
`informed_decision/requester.py` instead fixes the separate create-only
|
||||
`informed-decision-sitting-requester`, authenticates service subject
|
||||
`informed-decision` and requests `approval:create`. The proposal correctly
|
||||
binds the browser client, without conflating it with that workload identity.
|
||||
|
||||
The User Engine Application/ApplicationBinding model has no URL field.
|
||||
`https://decisions.coulomb.social/` remains context only, never an invented
|
||||
field or a substitute for event/deployment identity. Existing proposal receipts
|
||||
`native-entry-metadata.json`, `keycape-client-presence.json` and
|
||||
`native-preflight.json` retain TLS Ingress host/UID, native wrong-redirect
|
||||
refusal and absent exact catalogue rows, respectively. These dated receipts
|
||||
are supporting evidence, not a fresh live observation or real human MFA proof.
|
||||
|
||||
The refined executor's APP/BINDING values agree with these facts. Its standalone
|
||||
SERVICE maintenance attribution and retained genuine ordinary PDP denial do
|
||||
not create a browser/human identity or claim a normal PDP allow. Exact founder
|
||||
exception disposition remains separately required. Single-use/native-clock
|
||||
expiry, created-only recovery and retained audit/outbox history are exception
|
||||
mechanisms reviewed by their owners; this application ACK neither approves
|
||||
those mechanisms for live use nor certifies downstream reversal. Dead-lettering
|
||||
excludes automatic drain only: privileged targeted delivery/replay can revive
|
||||
the retained event and remains outside the proposed maintenance authority.
|
||||
|
||||
This entry records only the informed-decision-owner role. It changes no record
|
||||
status, bound claims, admission fields or authority; it approves no maintenance
|
||||
exception, credentials, login, native mutation, release or human disposition.
|
||||
Real human browser/MFA acceptance and USER-WP-0026-T03/USER-WP-0028-T02 closure
|
||||
remain independent gates. No owner-facts correction was found.
|
||||
|
||||
Reviewed owner HEAD: `3e4bcb26f8eeaa8c64345c565477b5ac8ccbb168`.
|
||||
|
|
@ -0,0 +1,69 @@
|
|||
{
|
||||
"application": {
|
||||
"application_id": "informed-decision",
|
||||
"display_name": "Informed Decision",
|
||||
"owner": "informed-decision",
|
||||
"allowed_profile_scopes": [
|
||||
"global"
|
||||
],
|
||||
"allowed_projection_types": [
|
||||
"application_runtime"
|
||||
]
|
||||
},
|
||||
"binding": {
|
||||
"application_id": "informed-decision",
|
||||
"oidc_client_id": "informed-decision-approver",
|
||||
"protected_system_id": "informed-decision",
|
||||
"catalog_namespaces": [],
|
||||
"event_source": null,
|
||||
"deployment_ref": null
|
||||
},
|
||||
"canonical_store_rows": [
|
||||
{
|
||||
"record_type": "applications",
|
||||
"record_key": "informed-decision",
|
||||
"payload": {
|
||||
"application_id": "informed-decision",
|
||||
"display_name": "Informed Decision",
|
||||
"owner": "informed-decision",
|
||||
"allowed_profile_scopes": [
|
||||
"global"
|
||||
],
|
||||
"allowed_projection_types": [
|
||||
"application_runtime"
|
||||
]
|
||||
},
|
||||
"tenant": null,
|
||||
"user_id": null,
|
||||
"application_id": "informed-decision",
|
||||
"scope_type": null,
|
||||
"scope_id": null
|
||||
},
|
||||
{
|
||||
"record_type": "application_bindings",
|
||||
"record_key": "informed-decision",
|
||||
"payload": {
|
||||
"application_id": "informed-decision",
|
||||
"oidc_client_id": "informed-decision-approver",
|
||||
"protected_system_id": "informed-decision",
|
||||
"catalog_namespaces": [],
|
||||
"event_source": null,
|
||||
"deployment_ref": null
|
||||
},
|
||||
"tenant": null,
|
||||
"user_id": null,
|
||||
"application_id": "informed-decision",
|
||||
"scope_type": null,
|
||||
"scope_id": null
|
||||
}
|
||||
],
|
||||
"application_owner": "informed-decision",
|
||||
"local_registry_owner": "user-engine",
|
||||
"protected_system_owner": "access-engine",
|
||||
"oidc_client_owner": "key-cape",
|
||||
"entry_url_evidence": "https://decisions.coulomb.social/",
|
||||
"entry_url_persisted": false,
|
||||
"entry_url_reason": "Canonical Application/ApplicationBinding model has no entry URL field. URL is separate verified Ingress context, never an invented persisted field.",
|
||||
"creates_user_permissions": false,
|
||||
"scope": "One application record and one exact binding; no memberships, roles, grants or user creation."
|
||||
}
|
||||
|
|
@ -0,0 +1,9 @@
|
|||
# Conditional single-control close-down entry — not active
|
||||
|
||||
Stable reference USER-CATALOGUE-INFDEC-20261011-R1; proposed only. If the founder accepts this exact memo, append one entry to Custodian's existing security-close-down checklist without removing or relabelling prior controls. Record the actual founder disposition, packet/executor/transport/grant hashes and native outcome before marking an executed relaxation.
|
||||
|
||||
Control: ordinary authenticated operator/PDP admission for User Engine application.register. Conditional exception: exactly one supervised registration of informed-decision Application and its exact browser-client/protected-system binding; genuine denial remains unmet and audited, followed by explicit maintenance attribution. No human/JWT roles, IAM grant, runtime endpoint, token/config change, future registrations or targeted event replay are authorized.
|
||||
|
||||
Authority deadline: 2026-10-12T23:59:59Z, with native precommit clock checks and durable consumed-grant closure. Existing catalogue facts are not automatically erased at expiry. Recovery may be blocked by expiry, changed rows/dependencies or claimed/delivered/missing events; owner reconciliation then needs separate disposition. Removing the private artifact is cleanup, not authentication/revocation proof.
|
||||
|
||||
Restoration owners: User Engine for the authenticated management surface/lifecycle, Access Engine for ordinary PDP admission; Custodian tracks the checklist and founder closes it. Criterion: before customer production, a supported management path authenticates genuine operators and performs ordinary authorization, demonstrated allow/deny/attribution and fail-closed unavailable behavior; retire the one-time tool from operational use, retain consumed ledger/audits/events and reconcile any retained registration/rollback event. This draft does not claim that restoration already exists, create another workplan, or promote agent autonomy.
|
||||
|
|
@ -0,0 +1,35 @@
|
|||
# One-app catalogue registration — R1
|
||||
|
||||
## Requested decision
|
||||
|
||||
Approve USER-CATALOGUE-INFDEC-20261011-R1, the exact attached executor and supervisor transport, as one explicitly labelled maintenance exception to ordinary application.register PDP admission. Execution ends by 2026-10-12T23:59:59Z. Approve its native database dry-run, one atomic exact two-record apply, stated verification/cleanup and bounded created-only recovery; record the single conditional close-down obligation. This is a separate approval from the already accepted readback runtime R2.
|
||||
|
||||
The exception creates only Application informed-decision (display Informed Decision, owner informed-decision, scopes [global], projections [application_runtime]) and binding to browser client informed-decision-approver/protected system informed-decision, empty namespaces and null event/deployment references. URL https://decisions.coulomb.social is context only: the DTO has no URL field. No users, memberships, entitlements, IAM grants, human identity, runtime image/config/token/namespace changes or service endpoint are created.
|
||||
|
||||
## Exact source and current evidence
|
||||
|
||||
Executor commit c89614ec816886e9a773da3047e35cb099c6c9ca, executor SHA256 b0dbbb9786e927055030acf849a72e9a44e9d3d55c84efdf245e419d381684f3, transport SHA256 3e594e0e8561100ae1eeb34d7208cd5b5e387ae56c29689f155aed94219770f3; canonical codec-record SHA256 23577cc4f3ea6c0ca43eb21ca0e3280eb53fb64e29b030dcd31251593f0f3f2f. Exact refined nine-file manifest 0ff545d26a0fd72f06040fe377de3efdcc3bd62cdcb6f653247c8ba72f3f34a7 is reviewed by dedicated User Engine and NetKingdom owner workers. Informed Decision independently acknowledges only its application facts. Their original signed-role prose is attached unchanged; this requesting packet writes no formal owner approval.
|
||||
|
||||
Final dedicated User Engine proof ran 21 actual isolated PostgreSQL checks with installed immutable f239 package/current executor. Six additional offline transport tests prove private-file/hash/UID/image/Ready/stdin guards without SSH or estate invocation. Retain original 16 tests and the earlier five constructor assertions as preparation history. Historical native metadata demonstrates an absent catalogue, actual Access readback registry/client and KeyCape wrong-redirect refusal; it is dated supporting evidence, not a new observation or human MFA proof. All fresh native preconditions remain mandatory.
|
||||
|
||||
## Honest admission and one-use authority
|
||||
|
||||
Ordinary registration calls the genuine provider and must receive an identified denial. Preserve its denial audit, then invoke unchanged register_application through a one-request, fixed-subject/app/tenant/action/correlation maintenance adapter. The maintenance actor is SERVICE, issuer urn:supervised-maintenance, separate explicit operator attribution and empty roles/assurance/audience. The exception has no PDP allow ID and does not satisfy normal admission. Unexpected ordinary ALLOW stops for the normal owner path; unavailable/transport/uncertain denial refuses.
|
||||
|
||||
Before any native dry-run the supervisor independently confirms actual founder disposition for memo infd-20261011-user-catalogue-bootstrap-r1@1 and this exact packet/executor AND transport. Only then create the mode0600 private closed grant with actual approval ID and native-receipt SHA; that native receipt carries the actual founder identity. Do not invent a founder grant field, human actor or authenticated JSON author. Pin canonical grant SHA and fresh Ready pod UID with immutable f239 image/package; preserve exact approval/target/source binding. No template fixture is a grant.
|
||||
|
||||
SERIALIZABLE transaction, fixed application lock, native database clock checks and persistent consumed audit key enforce closed exact metadata admission/replay. Final clock check is before commit, not a measurement of commit completing before expiry. Exact preexisting match consumes with no creation/event/undo. Partial/conflicting state stops. Native dry-run rolls back all local records/audits/events/ledger but genuine provider telemetry may remain; it is not globally side-effect free.
|
||||
|
||||
## Verification and recovery
|
||||
|
||||
Apply produces the two exact payloads plus genuine denial/registration/maintenance audits, attributable application.registered event and durable consumed ledger. Read back only fixed metadata/booleans/hashes inside the admitted workload; keep credentials internal and suppress raw errors. Verify Access registered system/issuer/client, independent KeyCape client/callback facts and actual User Engine binding/catalogue/account-facing projection. Recheck actual advisory provider allow/deny/expiry/unavailable/cache behavior using clearly labelled nonpersisted policy-test fixtures, not verified human claims or a manufactured IAM identity; ordinary enforcement stays separate. A native transport allow fixture is not a human login/MFA or entitlement proof. Do not mark USER26/28 done unless their actual native acceptance conditions are met.
|
||||
|
||||
Recovery is authorized only before expiry using the original consumed grant hash, exact unchanged created rows, no later dependencies, preserved event IDs and delivery-worker lock. Claimed/delivered/missing events stop. Retain all audits/events; only an unsent unclaimed event becomes dead-lettered. This excludes automatic drain, not separately privileged targeted delivery/replay. This exception authorizes neither; later replay or consumer reconciliation is a separate owner decision. No downstream reversal or complete consumer inventory is claimed. If recovery fails or scope drifts, stop and record the unverified outcome; do not mint another grant/operator identity to defeat one-use closure.
|
||||
|
||||
## Alternatives, costs and close-down
|
||||
|
||||
Preferred durable alternative: implement/use a genuine authenticated owner management path with ordinary PDP admission before creating these facts; slower but requires no exception. Another choice is to decline/expire this R1 and leave catalogue acceptance open. The proposed build-mode alternative unblocks these exact facts sooner, with independently reviewed exception/audit/transaction boundaries. No permanent service bypass is installed.
|
||||
|
||||
Estimated direct incremental cost EUR 0.10, supervisor time 5–15 minutes, no downtime expected. Proposed recovery risk allowance EUR 100 assumes no customer estate and one owner-hour of straightforward metadata repair at EUR 100/h. Unknown or uncontrolled downstream effects are not priced away: stop/new disposition if those assumptions fail. These are supervisor-reviewed estimates, not monetary enforcement or autopilot authority.
|
||||
|
||||
One conditional checklist entry records ordinary authenticated application.register admission as unmet and this exact exception only. Restoration owners User Engine/Access Engine must provide a supported authenticated management path with ordinary allow/deny/attribution before customer production, retire bootstrap use and retain/reconcile evidence. This approval expires for new execution and cleanup removes private local inputs; existing factual records do not silently expire. No active waiver, native grant, trial success or approval exists from this draft.
|
||||
|
|
@ -0,0 +1,16 @@
|
|||
# Exact supervised sequence — prepared only
|
||||
|
||||
1. Validate unchanged packet/executor/transport/records and current package source boundaries. Confirm native founder accept, exact memo/version/packet binding, stale=false, actual resolver identity and native approval receipt. Refusal, stale packet, expiry or missing provenance stops. Record exact original/approved revision under the same R1 trial; no autonomy promotion or inherited R2 authority.
|
||||
2. Refresh read-only target Ready pod UID/image f239 and installed owner package hashes, provider ownership/health and exact absent-or-matched catalogue preflight. Do not read Secret objects/values or export database/token configuration. Freeze current metadata and target refs. A changed package or binding requires review before mutation.
|
||||
3. Create a private mode0600 grant only after independent actual founder-receipt confirmation. Grant schema is attached and authenticates nothing. The independently verified receipt holds founder ID, approved memo/version/executor/transport/records/target/deadline/packet. Grant contains only the executor's closed fields; actual approval ID/receipt hash are unknown until that disposition. Pin canonical sorted compact JSON SHA256 independently; never reuse fixture values.
|
||||
4. Invoke the exact reviewed supervisor transport with mode dry-run, approved executor SHA, private grant SHA and freshly frozen expected pod UID. Source/grant travel on stdin; existing token and DB URL are read inside the workload with raw output suppressed. Stop on unavailable/uncertain deny, unexpected ordinary allow, transport failure, drift or changed source. Dry-run rolls back User Engine state but may leave genuine provider telemetry. Do not interpret exit2 as successful recovery or assert global absence of effects.
|
||||
5. Recheck frozen preconditions, then invoke the same exact grant/source/UID with mode apply. Require result created or exact no-change and record actual transaction/evidence; no second mutation if response is uncertain. Independently read consumed ledger, exact two rows, genuine denial/maintenance audits and original event status/attribution before deciding reconciliation. A transport failure after commit can be ambiguous; first inspect exact native ledger/rows rather than retry blindly.
|
||||
6. Verify actual three-way catalogue and account-facing native projection; labelled advisory policy-fixture allow/deny/TTL/expired/unavailable/cache checks use the existing admitted readback path only and persist no subjects/fixtures. Keep actual registered facts separate from fixture claims and real human browser/MFA acceptance. Verify unchanged ordinary enforcement deny/health. Do not target outbox delivery or replay under this grant; observe already-authorized ordinary delivery metadata/receipt if available and report gaps honestly.
|
||||
7. If independently proved recovery is needed, use only the same original grant mode rollback before expiry; exact rows, no dependencies and locked unclaimed/undelivered original events are mandatory. Stop on missing/claimed/delivered event, changed fact or expired authority. Record retained dead-letter event and audit history; subsequent targeted delivery/replay requires separate owner reconciliation. Recovery failure/unknown outcome does not score success.
|
||||
8. Remove private grant/local transient inputs after success, no-change, refusal or recovery; retain only hashes and actual native receipt/outcome refs. Preserve original failures and supplementary21/6 test proofs. Activate the conditional single-control checklist row only if exact founder accept/native exception occurred, and track restoration before customer production. This sequence itself executes nothing.
|
||||
|
||||
Prepared command shape (values in angle brackets are unresolved evidence slots, never fake authority):
|
||||
|
||||
`python3 tools/run_approved_catalogue_bootstrap.py --executor tools/catalogue_bootstrap.py --executor-sha256 b0dbbb9786e927055030acf849a72e9a44e9d3d55c84efdf245e419d381684f3 --grant-file <private-0600-file> --grant-sha256 <actual-canonical-grant-sha256> --expected-pod-uid <fresh-ready-f239-pod-uuid> --mode dry-run`
|
||||
|
||||
After successful admitted dry-run/fresh checks use mode apply. Conditional recovery uses mode rollback with the unchanged original grant. Both source and transport SHA3e594e0e8561100ae1eeb34d7208cd5b5e387ae56c29689f155aed94219770f3 must independently match the approved packet before running this command. No native command is run by packet preparation.
|
||||
|
|
@ -0,0 +1,39 @@
|
|||
{
|
||||
"proposal_id": "USER-CATALOGUE-INFDEC-20261011-R1",
|
||||
"revision": "executor-preparation-2-owner-findings",
|
||||
"status": "prepared-not-approved-not-executed",
|
||||
"historical_proposal_manifest_sha256": "60b185aabbf6a8448c0c3aef57279b6741db1cd1361b8dab48be29df9f14f78e",
|
||||
"executor_sha256": "b0dbbb9786e927055030acf849a72e9a44e9d3d55c84efdf245e419d381684f3",
|
||||
"supervisor_transport_sha256": "3e594e0e8561100ae1eeb34d7208cd5b5e387ae56c29689f155aed94219770f3",
|
||||
"records_sha256": "23577cc4f3ea6c0ca43eb21ca0e3280eb53fb64e29b030dcd31251593f0f3f2f",
|
||||
"expected_runtime_image": "forgejo.coulomb.social/coulomb/user-engine@sha256:f239bbf332b8eb87320c86390fddca1dcb4f7c628a7af75e79dee8058d446a7b",
|
||||
"fresh_pod_uid_required": true,
|
||||
"deadline": "2026-10-12T23:59:59Z",
|
||||
"authority": "separate founder-approved supervised administrative exception; out-of-band supervisor validates native receipt",
|
||||
"existing_r2_does_not_approve_catalogue_mutation": true,
|
||||
"normal_pdp_refusal_required": true,
|
||||
"catalogue_entities": [
|
||||
"applications/informed-decision",
|
||||
"application_bindings/informed-decision"
|
||||
],
|
||||
"target_tenant": "tenant:platform",
|
||||
"retained_events": [
|
||||
"application.registered"
|
||||
],
|
||||
"new_endpoint": false,
|
||||
"runtime_image_change": false,
|
||||
"iam_grants": false,
|
||||
"credentials_exported": false,
|
||||
"budget_estimate": {
|
||||
"cost_eur_upper_bound": 0.1,
|
||||
"supervised_seconds_estimate": 300,
|
||||
"application_downtime_expected_seconds": 0
|
||||
},
|
||||
"risk": "Exactly one administrative catalogue mutation bypasses ordinary application.register PDP admission under an explicit maintenance exception, retaining genuine denial and truthful service attribution. Public browser login/MFA remains unverified; downstream events may prevent automatic rollback.",
|
||||
"rollback": "Only exact originally created rows; original consumed grant digest; before expiry; no dependencies; delivery lock; refuse any claimed/delivered/missing event; retain audits and dead-letter unsent registered event. No full downstream reversal claim. Dead-lettering stops automatic drain only; existing privileged targeted delivery/replay can revive the retained event. This maintenance grant authorizes neither; any later replay requires separate owner reconciliation/disposition.",
|
||||
"owner_review_required": [
|
||||
"User Engine audit/service attribution and transaction semantics",
|
||||
"NetKingdom exception scope, catalogue facts, event consumers/dead-letter semantics",
|
||||
"Custodian precise founder disposition and conditional close-down obligation"
|
||||
]
|
||||
}
|
||||
|
|
@ -0,0 +1,27 @@
|
|||
{
|
||||
"reviewed_current_owner_inputs": [
|
||||
{
|
||||
"path": "src/user_engine/service.py",
|
||||
"sha256": "1c60b69e08c36eb3f678893a4a945eeeb9c73d5246c6566857cd8c134f75446d"
|
||||
},
|
||||
{
|
||||
"path": "src/user_engine/adapters/postgres.py",
|
||||
"sha256": "528d75431d1f3a7e55423ffa55d34722ac343582e513985db74ba3add36e6da6"
|
||||
},
|
||||
{
|
||||
"path": "src/user_engine/adapters/flex_auth.py",
|
||||
"sha256": "73d645b7b37904ebfe0df6f7ed397b74b4c47f505cd64a30c39e60717ce71455"
|
||||
},
|
||||
{
|
||||
"path": "src/user_engine/domain/models.py",
|
||||
"sha256": "8c9cb8051a930fa05a1657c8b539510588f1788812d68510df55712d2f4df050"
|
||||
},
|
||||
{
|
||||
"path": "src/user_engine/store_records.py",
|
||||
"sha256": "3cec4575434e82e29932a3e9cc7659f3dd8fa7e5be81d5690487033796bbfc16"
|
||||
}
|
||||
],
|
||||
"runtime_sources_modified": false,
|
||||
"transport_native_execution_tested": false,
|
||||
"note": "Executor tested with actual published runtime dependencies and current owner source mounted read-only; not a native service execution approval."
|
||||
}
|
||||
|
|
@ -0,0 +1,241 @@
|
|||
"""One-time supervised catalogue maintenance; no installed runtime endpoint.
|
||||
|
||||
A private, exact-hash supervisor artifact is an out-of-band maintenance grant,
|
||||
not authentication of its JSON author. The operator must independently confirm
|
||||
the founder's native disposition before supplying it. No JWT role is invented.
|
||||
"""
|
||||
from __future__ import annotations
|
||||
import argparse
|
||||
from dataclasses import replace
|
||||
from datetime import datetime, timedelta, timezone
|
||||
import hashlib
|
||||
import json
|
||||
import os
|
||||
from pathlib import Path
|
||||
import re
|
||||
import stat
|
||||
|
||||
from user_engine.adapters.postgres import PostgresUserEngineStore
|
||||
from user_engine.domain import (Actor, Application, ApplicationBinding, AuditRecord,
|
||||
AuthorizationDecision, AuthorizationEffect, PrincipalType)
|
||||
from user_engine.service import UserEngineService, AuthorizationDenied
|
||||
from user_engine.store_records import store_record_for
|
||||
|
||||
APP = Application('informed-decision', 'Informed Decision', 'informed-decision')
|
||||
BINDING = ApplicationBinding('informed-decision', oidc_client_id='informed-decision-approver', protected_system_id='informed-decision')
|
||||
PROPOSAL = 'USER-CATALOGUE-INFDEC-20261011-R1'
|
||||
SCHEMA = 'user-engine.supervised-catalogue-maintenance.v1'
|
||||
KEYS = {'schema','proposal_id','approval_id','memo_id','memo_version','approval_receipt_sha256','executor_sha256','records_sha256','expires_at','operator_id','authority'}
|
||||
|
||||
def digest(value):
|
||||
return hashlib.sha256(json.dumps(value, sort_keys=True, separators=(',', ':')).encode()).hexdigest()
|
||||
|
||||
def records():
|
||||
return [store_record_for(x).__dict__ for x in (APP, BINDING)]
|
||||
|
||||
class Refused(ValueError):
|
||||
pass
|
||||
|
||||
def validate_grant(grant, *, expected_grant_sha256, actual_executor_sha256, now):
|
||||
if (type(grant) is not dict or set(grant) != KEYS
|
||||
or grant['schema'] != SCHEMA or grant['proposal_id'] != PROPOSAL
|
||||
or grant['authority'] != 'founder-approved-one-time-administrative-exception'
|
||||
or grant['memo_id'] != 'infd-20261011-user-catalogue-bootstrap-r1'
|
||||
or type(grant['memo_version']) is not int or grant['memo_version'] != 1
|
||||
or not re.fullmatch(r'[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12}', grant['approval_id'])
|
||||
or not re.fullmatch(r'[a-zA-Z0-9:._-]{3,80}', grant['operator_id'])):
|
||||
raise Refused('closed grant required')
|
||||
for key in ('approval_receipt_sha256', 'executor_sha256', 'records_sha256'):
|
||||
if not re.fullmatch(r'[0-9a-f]{64}', grant[key]):
|
||||
raise Refused('exact evidence digests required')
|
||||
expires = datetime.fromisoformat(grant['expires_at'].replace('Z', '+00:00'))
|
||||
if (expires.tzinfo is None or now.tzinfo is None or now >= expires
|
||||
or expires > datetime(2026, 10, 12, 23, 59, 59, tzinfo=timezone.utc)):
|
||||
raise Refused('expired grant')
|
||||
if (digest(grant) != expected_grant_sha256 or grant['executor_sha256'] != actual_executor_sha256
|
||||
or grant['records_sha256'] != digest(records())):
|
||||
raise Refused('approved source differs')
|
||||
return expires
|
||||
|
||||
def _summary(cursor, audit_id):
|
||||
cursor.execute('SELECT summary FROM user_engine_audit_records WHERE audit_id = %s', (audit_id,))
|
||||
row = cursor.fetchone()
|
||||
return None if row is None else json.loads(row[0])
|
||||
|
||||
def _event_ids(cursor, correlation):
|
||||
cursor.execute('SELECT event_id FROM user_engine_outbox_events WHERE correlation_id = %s ORDER BY event_id', (correlation,))
|
||||
return [r[0] for r in cursor.fetchall()]
|
||||
|
||||
def _actor(grant):
|
||||
return Actor(issuer='urn:supervised-maintenance', subject=grant['operator_id'], tenant='tenant:platform',
|
||||
principal_type=PrincipalType.SERVICE, audience=(), claims={'maintenance_proposal': PROPOSAL})
|
||||
|
||||
class _Capture:
|
||||
def __init__(self, ordinary):
|
||||
self.ordinary = ordinary
|
||||
self.result = None
|
||||
def check(self, request):
|
||||
self.result = self.ordinary.check(request)
|
||||
return self.result
|
||||
|
||||
class _ExceptionAuthorization:
|
||||
def __init__(self, actor, correlation, expires):
|
||||
self.actor, self.correlation, self.expires = actor, correlation, expires
|
||||
self.used = False
|
||||
def check(self, request):
|
||||
now = datetime.now(timezone.utc)
|
||||
if (self.used or now >= self.expires or request.actor != self.actor
|
||||
or request.action != 'application.register' or request.tenant != 'tenant:platform'
|
||||
or request.resource_type != 'user-engine:application'
|
||||
or request.resource_id != APP.application_id or request.application_id != APP.application_id
|
||||
or request.correlation_id != self.correlation):
|
||||
raise Refused('exception outside fixed registration')
|
||||
self.used = True
|
||||
return AuthorizationDecision(effect=AuthorizationEffect.ALLOW, reason='explicit supervised maintenance exception; not a PDP allow',
|
||||
decision_id=None, binding='supervised-maintenance', issued_at=now,
|
||||
lifetime=min(timedelta(seconds=30), self.expires-now))
|
||||
|
||||
def execute(connection, ordinary_authorization, grant, *, expected_grant_sha256,
|
||||
actual_executor_sha256, mode='dry-run', now=None):
|
||||
now = now or datetime.now(timezone.utc)
|
||||
expires = validate_grant(grant, expected_grant_sha256=expected_grant_sha256,
|
||||
actual_executor_sha256=actual_executor_sha256, now=now)
|
||||
if mode not in ('dry-run', 'apply', 'rollback'):
|
||||
raise Refused('unknown operation')
|
||||
store = PostgresUserEngineStore(connection)
|
||||
if not store.ready:
|
||||
raise Refused('existing schema required; no migration')
|
||||
capture = _Capture(ordinary_authorization)
|
||||
service = UserEngineService(store=store, identity_adapter=object(), authorization=capture)
|
||||
actor = _actor(grant)
|
||||
ledger = 'aud_catalogue_bootstrap_' + grant['approval_id']
|
||||
correlation = 'maintenance:' + grant['approval_id']
|
||||
# Construct both services before BEGIN: the owner readiness probe rolls back
|
||||
# its connection. Constructing a service in the transaction would discard
|
||||
# the genuine denial audit and release the native serialization lock.
|
||||
exception_service = UserEngineService(store=store, identity_adapter=object(),
|
||||
authorization=_ExceptionAuthorization(actor, correlation, expires))
|
||||
outcome = None
|
||||
try:
|
||||
with store.transaction():
|
||||
with connection.cursor() as cursor:
|
||||
cursor.execute('SET TRANSACTION ISOLATION LEVEL SERIALIZABLE')
|
||||
cursor.execute('SELECT pg_advisory_xact_lock(hashtextextended(%s, 0))', ('user-engine:one-app-catalogue:informed-decision',))
|
||||
cursor.execute('SELECT clock_timestamp()')
|
||||
if cursor.fetchone()[0] >= expires:
|
||||
raise Refused('native transaction grant expired')
|
||||
previous = _summary(cursor, ledger)
|
||||
rollback_done = _summary(cursor, ledger + '_rollback')
|
||||
if mode == 'rollback':
|
||||
if previous is None or rollback_done is not None or not previous['created']:
|
||||
raise Refused('no unused created-only recovery authority')
|
||||
if previous['grant_sha256'] != expected_grant_sha256:
|
||||
raise Refused('recovery grant differs from consumed authority')
|
||||
if store.application(APP.application_id) != APP or store.binding(APP.application_id) != BINDING:
|
||||
raise Refused('created metadata changed')
|
||||
cursor.execute("SELECT COUNT(*) FROM user_engine_records WHERE application_id = %s AND record_type NOT IN ('applications', 'application_bindings')", (APP.application_id,))
|
||||
if cursor.fetchone()[0]:
|
||||
raise Refused('later dependent records exist')
|
||||
# Match the existing delivery worker's session advisory lock namespace.
|
||||
for event_id in previous['event_ids']:
|
||||
cursor.execute('SELECT pg_advisory_xact_lock(hashtextextended(%s, 0))', ('user-engine:tenant-lifecycle:outbox-event:' + event_id,))
|
||||
for event_id in previous['event_ids']:
|
||||
cursor.execute('SELECT event_id FROM user_engine_outbox_events WHERE event_id = %s FOR UPDATE', (event_id,))
|
||||
if cursor.fetchone() is None:
|
||||
raise Refused('created event missing')
|
||||
event = store.outbox_event(event_id)
|
||||
if (event is None or event.correlation_id != correlation or event.claimed_by is not None
|
||||
or event.claimed_at is not None or event.delivered_at is not None):
|
||||
raise Refused('claimed/delivered event needs owner reconciliation')
|
||||
store.save_outbox(replace(event, dead_lettered_at=now,
|
||||
failure_reason='supervised bootstrap rolled back before delivery'))
|
||||
for row in records():
|
||||
cursor.execute('DELETE FROM user_engine_records WHERE record_type = %s AND record_key = %s AND payload = %s::jsonb',
|
||||
(row['record_type'], row['record_key'], json.dumps(row['payload'])))
|
||||
if cursor.rowcount != 1:
|
||||
raise Refused('created-only compare-and-delete failed')
|
||||
store.append_audit(AuditRecord(ledger + '_rollback', actor, 'application.metadata.bootstrap.rollback', APP.application_id,
|
||||
actor.tenant, correlation, summary=json.dumps({'maintenance_authority': grant['approval_id'], 'grant_sha256': expected_grant_sha256,
|
||||
'removed': ['applications', 'application_bindings'], 'events_retained_dead_lettered': previous['event_ids']})))
|
||||
outcome = {'result': 'rolled-back', 'ordinary_pdp_allow_claimed': False, 'created_entities_removed': 2, 'audit_and_event_history_retained': True}
|
||||
else:
|
||||
if previous is not None:
|
||||
raise Refused('native single-use grant already consumed')
|
||||
a, b = store.application(APP.application_id), store.binding(APP.application_id)
|
||||
if (a is None) != (b is None) or (a is not None and (a != APP or b != BINDING)):
|
||||
raise Refused('partial or conflicting metadata')
|
||||
created = a is None
|
||||
if created:
|
||||
try:
|
||||
service.register_application(actor, APP, binding=BINDING, correlation_id=correlation)
|
||||
except AuthorizationDenied:
|
||||
refusal = capture.result
|
||||
if (refusal is None or refusal.allowed or refusal.decision_id is None
|
||||
or refusal.reason == 'authorization service unavailable'):
|
||||
raise Refused('real ordinary PDP refusal required')
|
||||
else:
|
||||
raise Refused('ordinary authorization unexpectedly allowed; use normal owner path')
|
||||
exception_service.register_application(actor, APP, binding=BINDING, correlation_id=correlation)
|
||||
if store.application(APP.application_id) != APP or store.binding(APP.application_id) != BINDING:
|
||||
raise Refused('post-write readback differs')
|
||||
event_ids = _event_ids(cursor, correlation)
|
||||
for event_id in event_ids:
|
||||
event = store.outbox_event(event_id)
|
||||
store.save_outbox(replace(event, payload={**event.payload, 'maintenance_exception': True,
|
||||
'proposal_id': PROPOSAL, 'approval_id': grant['approval_id'], 'operator_id': actor.subject}))
|
||||
summary = {'created': created, 'grant_sha256': expected_grant_sha256, 'records_sha256': grant['records_sha256'],
|
||||
'executor_sha256': actual_executor_sha256, 'approval_receipt_sha256': grant['approval_receipt_sha256'],
|
||||
'ordinary_pdp_denial_id': capture.result.decision_id if created else None, 'event_ids': event_ids,
|
||||
'authority': grant['authority'], 'not_human_authentication': True}
|
||||
store.append_audit(AuditRecord(ledger, actor, 'application.metadata.bootstrap', APP.application_id,
|
||||
actor.tenant, correlation, summary=json.dumps(summary)))
|
||||
outcome = {'result': 'created' if created else 'no-change', 'ordinary_pdp_refusal_retained': created,
|
||||
'ordinary_pdp_allow_claimed': False, 'created_entities': 2 if created else 0,
|
||||
'created_event_ids': event_ids, 'grant_native_single_use': True}
|
||||
cursor.execute('SELECT clock_timestamp()')
|
||||
if cursor.fetchone()[0] >= expires:
|
||||
raise Refused('grant expired before transaction commit')
|
||||
if mode == 'dry-run':
|
||||
raise _DryRun(outcome)
|
||||
except _DryRun as dry:
|
||||
return {**dry.outcome, 'transaction_committed': False, 'dry_run_rolled_back': True}
|
||||
return {**outcome, 'transaction_committed': True}
|
||||
|
||||
class _DryRun(Exception):
|
||||
def __init__(self, outcome):
|
||||
self.outcome = outcome
|
||||
|
||||
|
||||
def main():
|
||||
parser = argparse.ArgumentParser(description=__doc__)
|
||||
parser.add_argument('--grant-file', required=True, type=Path)
|
||||
parser.add_argument('--expected-grant-sha256', required=True)
|
||||
parser.add_argument('--mode', choices=['dry-run','apply','rollback'], default='dry-run')
|
||||
args = parser.parse_args()
|
||||
# Whole stdout/stderr, including dependency/driver errors, stays contained.
|
||||
saved = os.dup(1)
|
||||
null = os.open(os.devnull, os.O_WRONLY)
|
||||
os.dup2(null, 1); os.dup2(null, 2)
|
||||
try:
|
||||
info = args.grant_file.lstat()
|
||||
if (not stat.S_ISREG(info.st_mode) or info.st_uid != os.getuid()
|
||||
or stat.S_IMODE(info.st_mode) != 0o600 or info.st_size > 8192):
|
||||
raise Refused('private reviewed grant artifact required')
|
||||
grant = json.loads(args.grant_file.read_text())
|
||||
source_hash = hashlib.sha256(Path(__file__).read_bytes()).hexdigest()
|
||||
import psycopg
|
||||
from user_engine.adapters.flex_auth import FlexAuthHTTPAdapter
|
||||
ordinary = FlexAuthHTTPAdapter(base_url=os.environ['USER_ENGINE_FLEX_AUTH_URL'],
|
||||
bearer_token_file=os.environ['USER_ENGINE_FLEX_AUTH_TOKEN_FILE'], timeout_seconds=3)
|
||||
with psycopg.connect(os.environ['USER_ENGINE_DATABASE_URL']) as connection:
|
||||
result = execute(connection, ordinary, grant, expected_grant_sha256=args.expected_grant_sha256,
|
||||
actual_executor_sha256=source_hash, mode=args.mode)
|
||||
status = 0
|
||||
except Exception:
|
||||
result, status = {'result': 'refused-or-rolled-back', 'raw_output_suppressed': True}, 2
|
||||
os.dup2(saved, 1); os.close(saved); os.close(null)
|
||||
print(json.dumps(result, sort_keys=True))
|
||||
return status
|
||||
|
||||
if __name__ == '__main__':
|
||||
raise SystemExit(main())
|
||||
|
|
@ -0,0 +1,63 @@
|
|||
{
|
||||
"reviewed_manifest_sha256": "0ff545d26a0fd72f06040fe377de3efdcc3bd62cdcb6f653247c8ba72f3f34a7",
|
||||
"executor_sha256": "b0dbbb9786e927055030acf849a72e9a44e9d3d55c84efdf245e419d381684f3",
|
||||
"scope": "isolated disposable PostgreSQL only; no estate credentials or native invocation",
|
||||
"attempts": [
|
||||
{
|
||||
"command": "unittest discover current 21 catalogue tests using installed image package",
|
||||
"exit_code": 0,
|
||||
"output": "test_absent_registration_preserves_real_denial_and_explicit_maintenance_attribution (test_catalogue_bootstrap.Tests.test_absent_registration_preserves_real_denial_and_explicit_maintenance_attribution) ... ok\ntest_changed_created_record_stops_rollback (test_catalogue_bootstrap.Tests.test_changed_created_record_stops_rollback) ... ok\ntest_claimed_event_stops_rollback_without_deleting_entities (test_catalogue_bootstrap.Tests.test_claimed_event_stops_rollback_without_deleting_entities) ... ok\ntest_conflicting_or_partial_metadata_refuses_without_mutation (test_catalogue_bootstrap.Tests.test_conflicting_or_partial_metadata_refuses_without_mutation) ... ok\ntest_created_only_rollback_preserves_history_and_deadletters_unsent_event (test_catalogue_bootstrap.Tests.test_created_only_rollback_preserves_history_and_deadletters_unsent_event) ... ok\ntest_delivered_event_stops_recovery_and_retains_entities (test_catalogue_bootstrap.Tests.test_delivered_event_stops_recovery_and_retains_entities) ... ok\ntest_delivery_worker_lock_blocks_recovery_without_partial_delete (test_catalogue_bootstrap.Tests.test_delivery_worker_lock_blocks_recovery_without_partial_delete) ... ok\ntest_dry_run_rolls_back_application_binding_all_audit_and_outbox (test_catalogue_bootstrap.Tests.test_dry_run_rolls_back_application_binding_all_audit_and_outbox) ... ok\ntest_exact_preexisting_match_is_nochange_and_has_no_undo (test_catalogue_bootstrap.Tests.test_exact_preexisting_match_is_nochange_and_has_no_undo) ... ok\ntest_expired_or_extra_or_wrong_source_grant_refuses (test_catalogue_bootstrap.Tests.test_expired_or_extra_or_wrong_source_grant_refuses) ... ok\ntest_grant_is_closed_after_one_use_across_fresh_connection (test_catalogue_bootstrap.Tests.test_grant_is_closed_after_one_use_across_fresh_connection) ... ok\ntest_later_dependent_record_stops_created_only_recovery (test_catalogue_bootstrap.Tests.test_later_dependent_record_stops_created_only_recovery) ... ok\ntest_native_clock_refuses_expired_grant_even_with_stale_caller_clock (test_catalogue_bootstrap.Tests.test_native_clock_refuses_expired_grant_even_with_stale_caller_clock) ... ok\ntest_recovery_requires_original_consumed_grant (test_catalogue_bootstrap.Tests.test_recovery_requires_original_consumed_grant) ... ok\ntest_transaction_failure_after_first_row_leaves_no_partial_data_or_grant (test_catalogue_bootstrap.Tests.test_transaction_failure_after_first_row_leaves_no_partial_data_or_grant) ... ok\ntest_unavailable_or_unexpected_ordinary_allow_cannot_trigger_exception (test_catalogue_bootstrap.Tests.test_unavailable_or_unexpected_ordinary_allow_cannot_trigger_exception) ... ok\ntest_deadline_hard_cap_and_no_timezone_are_refused (test_catalogue_bootstrap_owner_negatives.OwnerNegatives.test_deadline_hard_cap_and_no_timezone_are_refused) ... ok\ntest_exact_request_adapter_cannot_switch_app_tenant_or_identity (test_catalogue_bootstrap_owner_negatives.OwnerNegatives.test_exact_request_adapter_cannot_switch_app_tenant_or_identity) ... ok\ntest_exception_is_single_request_with_no_pdp_decision_id (test_catalogue_bootstrap_owner_negatives.OwnerNegatives.test_exception_is_single_request_with_no_pdp_decision_id) ... ok\ntest_json_boolean_is_not_an_authenticated_memo_revision (test_catalogue_bootstrap_owner_negatives.OwnerNegatives.test_json_boolean_is_not_an_authenticated_memo_revision) ... ok\ntest_other_memo_or_added_scope_cannot_expand_fixed_exception (test_catalogue_bootstrap_owner_negatives.OwnerNegatives.test_other_memo_or_added_scope_cannot_expand_fixed_exception) ... ok\n\n----------------------------------------------------------------------\nRan 21 tests in 1.561s\n\nOK\n"
|
||||
}
|
||||
],
|
||||
"limits": {
|
||||
"memory": "512m",
|
||||
"cpus": "1",
|
||||
"postgres_network": "none",
|
||||
"worker_network": "container:fixture"
|
||||
},
|
||||
"images": {
|
||||
"postgres": "postgres@sha256:b0f9560a2de083e2cc7382e75f808c7381a32852a7ec49117deedb300e552b24",
|
||||
"worker": "forgejo.coulomb.social/coulomb/user-engine@sha256:f239bbf332b8eb87320c86390fddca1dcb4f7c628a7af75e79dee8058d446a7b"
|
||||
},
|
||||
"cleanup": {
|
||||
"stop_exit_code": 0,
|
||||
"container_absent": false,
|
||||
"private_data_tmpfs": true,
|
||||
"worker_auto_removed": true,
|
||||
"final_confirmation": {
|
||||
"container_absent": true,
|
||||
"verified_command": "docker ps -a --filter name=user-owner-review --format names/status returned empty after auto-removal"
|
||||
}
|
||||
},
|
||||
"current_test_count": 21,
|
||||
"current_test_seconds": 1.561,
|
||||
"prior_failed_preparation_retained": {
|
||||
"original_receipt_sha256": "964cc3755e96330bf6d1ada63410f8adfdb3c45602e0446369d6dddace412405",
|
||||
"prior_tests": 11,
|
||||
"prior_failed_assertions": 5,
|
||||
"cause": "readiness probe rolled back transaction inside second service constructor",
|
||||
"old_receipt_unmodified": true
|
||||
},
|
||||
"independently_confirmed_installed_and_checkout_source_hashes": [
|
||||
{
|
||||
"path": "src/user_engine/service.py",
|
||||
"sha256": "1c60b69e08c36eb3f678893a4a945eeeb9c73d5246c6566857cd8c134f75446d"
|
||||
},
|
||||
{
|
||||
"path": "src/user_engine/adapters/postgres.py",
|
||||
"sha256": "528d75431d1f3a7e55423ffa55d34722ac343582e513985db74ba3add36e6da6"
|
||||
},
|
||||
{
|
||||
"path": "src/user_engine/adapters/flex_auth.py",
|
||||
"sha256": "73d645b7b37904ebfe0df6f7ed397b74b4c47f505cd64a30c39e60717ce71455"
|
||||
},
|
||||
{
|
||||
"path": "src/user_engine/domain/models.py",
|
||||
"sha256": "8c9cb8051a930fa05a1657c8b539510588f1788812d68510df55712d2f4df050"
|
||||
},
|
||||
{
|
||||
"path": "src/user_engine/store_records.py",
|
||||
"sha256": "3cec4575434e82e29932a3e9cc7659f3dd8fa7e5be81d5690487033796bbfc16"
|
||||
}
|
||||
]
|
||||
}
|
||||
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
|
|
@ -0,0 +1,141 @@
|
|||
{
|
||||
"id": "infd-20261011-user-catalogue-bootstrap-r1",
|
||||
"version": 1,
|
||||
"question": "Approve the exact one-time User Engine catalogue registration for Informed Decision, with genuine PDP denial retained, explicit supervised maintenance attribution, native dry-run and guarded recovery by October 12 at 23:59 UTC, plus restoration of ordinary authenticated management before customer production?",
|
||||
"requested_act": "approve",
|
||||
"binding_level": "organizational",
|
||||
"brief": "One fixed Application/browser-client/protected-system binding; ordinary application.register admission remains unmet. Exact reviewed executor and transport, 21 isolated PostgreSQL checks and 6 offline transport guards. Separate founder exception required before native dry-run/apply; private JSON/hash is not authentication. No image/config/IAM/human claims; created-only recovery may stop on delivery/expiry. Conditional restoration owner and criterion attached.",
|
||||
"binding": {
|
||||
"principal": {
|
||||
"id": "pending-human-session",
|
||||
"kind": "person",
|
||||
"display_name": "Founder review"
|
||||
},
|
||||
"target": {
|
||||
"kind": "resource",
|
||||
"id": "realm:kubernetes/railiance01/user-engine/catalogue/informed-decision",
|
||||
"label": "Fixed Informed Decision Application and binding in User Engine",
|
||||
"environment": "build"
|
||||
},
|
||||
"terms": "Only USER-CATALOGUE-INFDEC-20261011-R1 and attached executor b0dbbb9786e927055030acf849a72e9a44e9d3d55c84efdf245e419d381684f3 AND supervisor transport 3e594e0e8561100ae1eeb34d7208cd5b5e387ae56c29689f155aed94219770f3 with attached fixed records; execute by 2026-10-12T23:59:59Z after independent native founder-receipt confirmation and fresh frozen pod/image/package/provider/absence checks. Approve native dry-run with external PDP telemetry, one atomic mutation/no-change, read-only verification, private-input cleanup and original-grant created-only recovery before expiry. No targeted replay or future registrations; conditional ordinary management restoration before customer production."
|
||||
},
|
||||
"step_kind": "approve",
|
||||
"packet": [
|
||||
{
|
||||
"item_id": "decision-packet-md",
|
||||
"label": "decision-packet.md",
|
||||
"hash": "sha256:f49244e7dfe4c0aa30fbc1d6ec06ba8ea050968294daf6ec6543d605c55cbb3c"
|
||||
},
|
||||
{
|
||||
"item_id": "execution-and-verification-md",
|
||||
"label": "execution-and-verification.md",
|
||||
"hash": "sha256:b465319b82106a71e3ff73d01a713aef0e8957fdb3111d46b8c25923a89faf62"
|
||||
},
|
||||
{
|
||||
"item_id": "proposal-json",
|
||||
"label": "proposal.json",
|
||||
"hash": "sha256:c9bba99e39ed4119adaa5af81a6a3b03e2959eda340a377c4ee638b840639399"
|
||||
},
|
||||
{
|
||||
"item_id": "private-grant-schema-json",
|
||||
"label": "private-grant.schema.json",
|
||||
"hash": "sha256:b7c17e13fa73e9f2e5328e067befa75f681ee356f0d1587849929d498dd025f8"
|
||||
},
|
||||
{
|
||||
"item_id": "conditional-close-down-entry-md",
|
||||
"label": "conditional-close-down-entry.md",
|
||||
"hash": "sha256:6f14735aae84e82c7b3e582b5851fa6e266097ea97a931017fee6bc91d2e7cc2"
|
||||
},
|
||||
{
|
||||
"item_id": "executor-py",
|
||||
"label": "executor.py",
|
||||
"hash": "sha256:b0dbbb9786e927055030acf849a72e9a44e9d3d55c84efdf245e419d381684f3"
|
||||
},
|
||||
{
|
||||
"item_id": "supervisor-transport-py",
|
||||
"label": "supervisor-transport.py",
|
||||
"hash": "sha256:3e594e0e8561100ae1eeb34d7208cd5b5e387ae56c29689f155aed94219770f3"
|
||||
},
|
||||
{
|
||||
"item_id": "canonical-records-json",
|
||||
"label": "canonical-records.json",
|
||||
"hash": "sha256:ae6fde5f2c879e75fabb53e132261899dae0f4d864e18dd425bc272be713426b"
|
||||
},
|
||||
{
|
||||
"item_id": "executor-proposal-json",
|
||||
"label": "executor-proposal.json",
|
||||
"hash": "sha256:69ad999d70c014472d70e7ba394390e039f295ad0d35ab2d322e2a32ca00877c"
|
||||
},
|
||||
{
|
||||
"item_id": "executor-source-boundary-json",
|
||||
"label": "executor-source-boundary.json",
|
||||
"hash": "sha256:3592168805539ab87133ed88a9c095b81609314dd56968f3a26d8cb23d7e148f"
|
||||
},
|
||||
{
|
||||
"item_id": "original-postgres-receipt-json",
|
||||
"label": "original-postgres-receipt.json",
|
||||
"hash": "sha256:964cc3755e96330bf6d1ada63410f8adfdb3c45602e0446369d6dddace412405"
|
||||
},
|
||||
{
|
||||
"item_id": "final-owner-postgres-receipt-json",
|
||||
"label": "final-owner-postgres-receipt.json",
|
||||
"hash": "sha256:659d29e85da00aaece0da933ca2b25b9e60feae18072745095a66370854a7ee4"
|
||||
},
|
||||
{
|
||||
"item_id": "user-owner-agreement-md",
|
||||
"label": "user-owner-agreement.md",
|
||||
"hash": "sha256:cb9fdadb3a8f432f100e9340e5b94af932c4d11a5705af6a80d336a5026d867b"
|
||||
},
|
||||
{
|
||||
"item_id": "netkingdom-owner-agreement-md",
|
||||
"label": "netkingdom-owner-agreement.md",
|
||||
"hash": "sha256:12d11938eeed8864c5fcec1638b9045d1c96eafbaa7c02a62d17ba599666bd07"
|
||||
},
|
||||
{
|
||||
"item_id": "application-owner-facts-ack-md",
|
||||
"label": "application-owner-facts-ack.md",
|
||||
"hash": "sha256:b2da26b74cb2bb74d26312941673e95f1653f6154a7ef90155562e316f5837c7"
|
||||
},
|
||||
{
|
||||
"item_id": "retained-native-preflight-json",
|
||||
"label": "retained-native-preflight.json",
|
||||
"hash": "sha256:8bc7f73e0a89493ee376383132c47d8e0b6f0723395373153421eb3e058101eb"
|
||||
},
|
||||
{
|
||||
"item_id": "retained-native-entry-metadata-json",
|
||||
"label": "retained-native-entry-metadata.json",
|
||||
"hash": "sha256:9314410240a9997679768e54b2487c0e76c924f8ea8ab8cfff0f623d39e07060"
|
||||
},
|
||||
{
|
||||
"item_id": "retained-keycape-client-presence-json",
|
||||
"label": "retained-keycape-client-presence.json",
|
||||
"hash": "sha256:54657adf2c53ea220d93db5ab2e865fcea2106aaee517a9932d071b842a58912"
|
||||
},
|
||||
{
|
||||
"item_id": "transport-guard-receipt-json",
|
||||
"label": "transport-guard-receipt.json",
|
||||
"hash": "sha256:2919c155c0c0be0a5ac6e054798d9ec89a7b4c254ed6037a69dfaafc50ed4546"
|
||||
},
|
||||
{
|
||||
"item_id": "transport-guard-tests-py",
|
||||
"label": "transport-guard-tests.py",
|
||||
"hash": "sha256:a6362e23e5608c36ed84855c90c3f4593aebca6593844e9caf179ca9192a1f3b"
|
||||
}
|
||||
],
|
||||
"highlights": [
|
||||
{
|
||||
"id": "explicit-maintenance-exception",
|
||||
"item_id": "decision-packet-md",
|
||||
"note": "This overrides genuine ordinary application.register denial for exactly two metadata facts; it does not satisfy normal PDP admission or authenticate a human. Recovery stops on changed dependencies,expiry or claimed/delivered/missing event. Targeted replay/delivery is excluded. Preserve one conditional restoration obligation before customer production.",
|
||||
"required_ack": true,
|
||||
"severity": "warning",
|
||||
"locator": {
|
||||
"kind": "section",
|
||||
"heading": "Requested decision"
|
||||
}
|
||||
}
|
||||
],
|
||||
"sealed": false,
|
||||
"approval_id": null,
|
||||
"approval_binding_digest": null
|
||||
}
|
||||
|
|
@ -0,0 +1,120 @@
|
|||
# NetKingdom owner review — bounded one-app catalogue maintenance exception
|
||||
|
||||
```yaml
|
||||
reviewer: net-kingdom-owner (agent net-kingdom, codex)
|
||||
decision: approved
|
||||
reviewed_at: "2026-10-11"
|
||||
work_item: NK-WP-ADHOC-2026-10-11-T02
|
||||
proposal: USER-CATALOGUE-INFDEC-20261011-R1
|
||||
revision: executor-preparation-2-owner-findings
|
||||
manifest_sha256: 0ff545d26a0fd72f06040fe377de3efdcc3bd62cdcb6f653247c8ba72f3f34a7
|
||||
executor_sha256: b0dbbb9786e927055030acf849a72e9a44e9d3d55c84efdf245e419d381684f3
|
||||
transport_sha256: 3e594e0e8561100ae1eeb34d7208cd5b5e387ae56c29689f155aed94219770f3
|
||||
records_sha256: 23577cc4f3ea6c0ca43eb21ca0e3280eb53fb64e29b030dcd31251593f0f3f2f
|
||||
comment: >-
|
||||
NetKingdom INTENT declares Taxonomy/security canon and orchestration with
|
||||
explicit externally owned identity, PDP and user-domain facts. This exact
|
||||
alternative is one labelled supervised maintenance exception for the two
|
||||
fixed User Engine metadata records, not a normative permission, new login,
|
||||
grant or case type. Technical agreement under NK-WP-ADHOC-2026-10-11-T02
|
||||
preserves real ordinary denial, independent exact founder disposition,
|
||||
recorded exception scope, bounded recovery and distinct owner roles.
|
||||
It provides no founder approval, native runtime go or catalogue completion.
|
||||
```
|
||||
|
||||
## Canonical facts and owner separation
|
||||
|
||||
The nine applied files all match the exact refinement manifest above. Application
|
||||
informed-decision / display Informed Decision / owner informed-decision and
|
||||
binding informed-decision-approver -> protected system informed-decision match
|
||||
User Engine's actual codecs and canonical-records.json. Access Engine's readback
|
||||
registry independently binds issuer https://kc.coulomb.social and that client;
|
||||
KeyCape source/owner registration receipt independently names the exact callback
|
||||
https://decisions.coulomb.social/auth/callback. Existing retained keycape-client-
|
||||
presence and native-preflight receipts support current preparation; no new live
|
||||
issuer or database read was performed in this review. A fresh frozen target/pod/
|
||||
image and unchanged facts still must be rechecked before separately approved use.
|
||||
|
||||
The proposed write does not create a user, membership, group, default role,
|
||||
entitlement, grant or authorization rule. Application and binding are catalogue
|
||||
facts, not allow-list entries or permission. No entry URL is smuggled into the
|
||||
DTO: its model has no URL field, and observed Ingress URL remains context only.
|
||||
This source agreement does not establish a fleet-complete catalogue or supply
|
||||
any application owner's still-required acknowledgement in another owner's voice.
|
||||
User Engine owns record lifecycle/persistence; Access owns the protected system
|
||||
and decisions; KeyCape owns authentication/client registration; InformedDecision
|
||||
owns application semantics. NetKingdom agrees only to security orchestration scope.
|
||||
|
||||
## Explicit exception, not satisfied normal admission
|
||||
|
||||
INTENT and accepted security-layer-model v0.8 retain the sole PDP and ordinary
|
||||
PEP obligations. The tool intentionally overrides genuine ordinary application.
|
||||
register denial after preserving its identified decision and audit. That is a
|
||||
proposed exceptional administrative act, not normal conforming admission and not
|
||||
an outage stance or PDP allow. Maintenance actor is truthfully SERVICE with
|
||||
urn:supervised-maintenance issuer, explicit attribution and no forged human JWT,
|
||||
roles, assurance or invented login. Exception result has no PDP decision ID.
|
||||
No standard, normal service endpoint, IAM policy or existing PDP adapter changes.
|
||||
|
||||
The private mode0600 canonical-hash grant is out-of-band supervised evidence,
|
||||
not authentication of its author. Custodian must independently verify actual
|
||||
founder disposition for this exact executor AND transport, records, Ready pod/
|
||||
immutable image, deadline and recovery. Prior readback R2 authority is insufficient.
|
||||
Both native dry-run and apply require that distinct scope. The dry-run may cause
|
||||
real external PDP telemetry while rolling back local rows/audits/outbox/ledger;
|
||||
it is not globally side-effect free. Future human acceptance must preserve normal
|
||||
admission as unmet and record the exact conditional close-down relaxation. This
|
||||
source preparation creates no active exception or scored execution success.
|
||||
|
||||
## Expiry, one-use and recovery
|
||||
|
||||
Closed grant requires exact integer memo revision, fixed proposal/memo/record/
|
||||
executor hashes and maximum deadline2026-10-12T23:59:59Z. The fixed method/request
|
||||
binding and <=30s lifetime are narrow. SERIALIZABLE transaction, fixed application
|
||||
advisory lock, native DB clock checks and persisted audit-key ledger bind absent/
|
||||
exact admission and prevent replay after process restart. Both services must be
|
||||
constructed before BEGIN because readiness rolls back its connection. Final
|
||||
clock check is precommit; it is not observation of commit completing by expiry.
|
||||
|
||||
Exact pre-existing match consumes with no creation or undo. Partial/conflicting
|
||||
facts, unavailable/uncertain provider deny or unexpected ordinary allow refuse.
|
||||
Created-only recovery requires the original consumed grant hash before expiry,
|
||||
unchanged exact two records, no later dependencies, preserved event IDs and the
|
||||
existing delivery-worker lock. Missing, claimed or delivered events stop recovery.
|
||||
History is retained, not erased. A changed grant/operator cannot defeat one-use
|
||||
or create fresh rollback authority. Failed or expired recovery needs separate
|
||||
owner reconciliation and disposition; no reversal of downstream effects is claimed.
|
||||
|
||||
## Retained event and replay boundary
|
||||
|
||||
The registered event remains attributive, with maintenance_exception/proposal/
|
||||
approval/operator labels, transported through the existing audit envelope. It
|
||||
is not an invitation mail class or a user-authorization grant. Standard pending
|
||||
drain excludes dead-lettered rollback events. Separately authorized targeted
|
||||
delivery/replay can revive retained events; this proposal explicitly grants
|
||||
neither. The reviewer agrees to the added caveat requiring separate owner
|
||||
reconciliation/disposition before any such later action. Preserve rollback/event
|
||||
IDs so a future consumer/reviewer can correlate the retired registration and
|
||||
avoid mistaking delayed evidence for current facts. No complete consumer inventory,
|
||||
faithful-display, native audit arrival or stream-completeness claim is made.
|
||||
|
||||
## Verification and remaining authority
|
||||
|
||||
Fresh dedicated User Engine owner agreement is applied in its own review file;
|
||||
this worker neither replaces it nor signs that role. Its independently recorded
|
||||
21 isolated PostgreSQL checks passed on current exact source and immutable f239
|
||||
installed package dependencies, with private fixtures/cleanup limits retained.
|
||||
That is not a native database invocation or authority grant. This NetKingdom
|
||||
review independently reran the five pure negative tests on the applied executor:
|
||||
all pass, with no network/database/credential access. Earlier sixteen-test receipt
|
||||
and constructor failures remain history, not relabelled as final proof.
|
||||
|
||||
No further source change is required for this narrow technical agreement. Before
|
||||
execution the requester still needs exact human exception and all required owner
|
||||
acknowledgments; freeze concrete grant/target preconditions and supervise the
|
||||
already prepared source transport. Afterwards verify exact two codec payloads,
|
||||
one consumed ledger, genuine denial/maintenance audits, attributed event and
|
||||
native catalogue/readback boundaries. Human MFA/allow and any complete journey
|
||||
remain separate; USER-WP-0026-T03/USER-WP-0028-T02 cannot close from this review.
|
||||
No native write, credential read, login, new agent, runtime publication or founder
|
||||
ruling occurred. This review introduces no NetKingdom standard permission.
|
||||
|
|
@ -0,0 +1,68 @@
|
|||
{
|
||||
"recorded_at": "2026-10-11T01:18:48.808601+00:00",
|
||||
"scope": "isolated disposable PostgreSQL only; no native DB/credentials",
|
||||
"postgres_image": "postgres@sha256:b0f9560a2de083e2cc7382e75f808c7381a32852a7ec49117deedb300e552b24",
|
||||
"python_dependency_image": "forgejo.coulomb.social/coulomb/user-engine@sha256:f239bbf332b8eb87320c86390fddca1dcb4f7c628a7af75e79dee8058d446a7b",
|
||||
"resources": {
|
||||
"postgres_memory_bytes": 536870912,
|
||||
"postgres_cpu_limit": 1,
|
||||
"test_worker_memory_bytes": 536870912,
|
||||
"test_worker_cpu_limit": 1,
|
||||
"postgres_network": "none",
|
||||
"worker_network": "isolated PostgreSQL container namespace only",
|
||||
"read_only_source_mounts": true
|
||||
},
|
||||
"final_test_count": 16,
|
||||
"final_test_exit_code": 0,
|
||||
"final_test_seconds": 1.73,
|
||||
"final_test_output": "Ran 16 tests in 1.730s; OK",
|
||||
"test_opt_in": "USER_ENGINE_ISOLATED_CATALOGUE_PG_TEST=network-none-fixture",
|
||||
"preparation_history": [
|
||||
{
|
||||
"tests": 11,
|
||||
"failed_assertions": 5,
|
||||
"cause": "Second service constructor ran readiness rollback inside transaction, discarded ordinary-denial audit and serialization lock.",
|
||||
"corrected": true
|
||||
},
|
||||
{
|
||||
"tests": 11,
|
||||
"passed": 11
|
||||
},
|
||||
{
|
||||
"tests": 15,
|
||||
"passed": 15
|
||||
},
|
||||
{
|
||||
"tests": 16,
|
||||
"passed": 16
|
||||
},
|
||||
{
|
||||
"tests": 16,
|
||||
"passed": 16,
|
||||
"note": "Final portable test path and explicit isolated-fixture opt-in verified."
|
||||
}
|
||||
],
|
||||
"meaningful_gates": [
|
||||
"genuine denial and explicit maintenance audit/event attribution",
|
||||
"full transaction rollback after first-row failure",
|
||||
"dry-run no durable entities/audits/events/grant",
|
||||
"native clock expiration despite stale caller time",
|
||||
"fresh connection native single-use replay refusal",
|
||||
"partial/conflicting record refusal",
|
||||
"exact existing no-change consumes without recovery",
|
||||
"unavailable or unexpected ordinary allow refusal",
|
||||
"source/closed/expired grant refusal",
|
||||
"exact consumed grant digest recovery",
|
||||
"created-only rollback retains history/deadletters unsent event",
|
||||
"claimed/delivered event stops",
|
||||
"changed metadata and later dependency stop",
|
||||
"existing delivery lock blocks recovery without deletion"
|
||||
],
|
||||
"resources_removed": {
|
||||
"test_worker_auto_removed": true,
|
||||
"postgres_container_removed": true,
|
||||
"private_volume_removed": true
|
||||
},
|
||||
"native_invocation": false,
|
||||
"founder_approval": null
|
||||
}
|
||||
|
|
@ -0,0 +1,72 @@
|
|||
{
|
||||
"recorded_at": "2026-10-11T01:50:28.059508+00:00",
|
||||
"scope": "offline human packet preparation only",
|
||||
"source_inputs": [
|
||||
{
|
||||
"repo": "user-engine",
|
||||
"path": "tools/catalogue_bootstrap.py",
|
||||
"sha256": "b0dbbb9786e927055030acf849a72e9a44e9d3d55c84efdf245e419d381684f3"
|
||||
},
|
||||
{
|
||||
"repo": "user-engine",
|
||||
"path": "tools/run_approved_catalogue_bootstrap.py",
|
||||
"sha256": "3e594e0e8561100ae1eeb34d7208cd5b5e387ae56c29689f155aed94219770f3"
|
||||
},
|
||||
{
|
||||
"repo": "user-engine",
|
||||
"path": "docs/reviews/2026-10-11-catalogue-maintenance-owner-agreement.md",
|
||||
"sha256": "cb9fdadb3a8f432f100e9340e5b94af932c4d11a5705af6a80d336a5026d867b"
|
||||
},
|
||||
{
|
||||
"repo": "user-engine",
|
||||
"path": "docs/evidence/2026-10-11-one-app-catalogue-executor/owner-final-postgres-receipt.json",
|
||||
"sha256": "659d29e85da00aaece0da933ca2b25b9e60feae18072745095a66370854a7ee4"
|
||||
},
|
||||
{
|
||||
"repo": "net-kingdom",
|
||||
"path": "docs/reviews/2026-10-11-catalogue-maintenance-security-owner-review.md",
|
||||
"sha256": "12d11938eeed8864c5fcec1638b9045d1c96eafbaa7c02a62d17ba599666bd07"
|
||||
},
|
||||
{
|
||||
"repo": "informed-decision",
|
||||
"path": "docs/reviews/2026-10-11-one-app-catalogue-facts-review.md",
|
||||
"sha256": "b2da26b74cb2bb74d26312941673e95f1653f6154a7ef90155562e316f5837c7"
|
||||
},
|
||||
{
|
||||
"repo": "informed-decision",
|
||||
"path": "informed_decision/intake.py",
|
||||
"sha256": "a733b4b608b9ea90b2c8293901aa14388a0bf0d3719f121038bfdcc1faca2038"
|
||||
},
|
||||
{
|
||||
"repo": "informed-decision",
|
||||
"path": "informed_decision/lifecycle_commands.py",
|
||||
"sha256": "783ec451dd7ef33dc0cfd72c1633ea5208dfd463afeaa0b68d279f156a9b0828"
|
||||
},
|
||||
{
|
||||
"repo": "informed-decision",
|
||||
"path": "schemas/memo-intake.schema.json",
|
||||
"sha256": "93d2cd665dc4e0e4aff9a2d312084244e9a14f811591e5d108b06d0aa10ea500"
|
||||
},
|
||||
{
|
||||
"repo": "the-custodian",
|
||||
"path": "docs/security-close-down-checklist.md",
|
||||
"sha256": "09fb2ab217b4c6f6cc0134294eb584d358fa9237a9f5bf1683197057cd25708e"
|
||||
}
|
||||
],
|
||||
"executor_commit": "c89614ec816886e9a773da3047e35cb099c6c9ca",
|
||||
"exact_privileged_sources_unchanged": true,
|
||||
"independent_owner_reviews_copied_unchanged": true,
|
||||
"actual_founder_approval_id": null,
|
||||
"actual_founder_id": null,
|
||||
"private_grant_created": false,
|
||||
"native_database_dry_run_or_apply": false,
|
||||
"memo_posted": false,
|
||||
"active_checklist_waiver_created": false,
|
||||
"test_proofs": {
|
||||
"retained_dedicated_owner_postgres": 21,
|
||||
"new_offline_transport": 6
|
||||
},
|
||||
"formal_owner_role_written_by_requester": false,
|
||||
"stable_proposal": "USER-CATALOGUE-INFDEC-20261011-R1",
|
||||
"historical_refinement_manifest_sha256": "0ff545d26a0fd72f06040fe377de3efdcc3bd62cdcb6f653247c8ba72f3f34a7"
|
||||
}
|
||||
|
|
@ -0,0 +1,61 @@
|
|||
{
|
||||
"$schema": "https://json-schema.org/draft/2020-12/schema",
|
||||
"title": "Closed post-disposition supervisor catalogue grant; this schema authenticates nothing",
|
||||
"type": "object",
|
||||
"additionalProperties": false,
|
||||
"required": [
|
||||
"schema",
|
||||
"proposal_id",
|
||||
"approval_id",
|
||||
"memo_id",
|
||||
"memo_version",
|
||||
"approval_receipt_sha256",
|
||||
"executor_sha256",
|
||||
"records_sha256",
|
||||
"expires_at",
|
||||
"operator_id",
|
||||
"authority"
|
||||
],
|
||||
"properties": {
|
||||
"schema": {
|
||||
"const": "user-engine.supervised-catalogue-maintenance.v1"
|
||||
},
|
||||
"proposal_id": {
|
||||
"const": "USER-CATALOGUE-INFDEC-20261011-R1"
|
||||
},
|
||||
"approval_id": {
|
||||
"type": "string",
|
||||
"pattern": "^[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12}$"
|
||||
},
|
||||
"memo_id": {
|
||||
"const": "infd-20261011-user-catalogue-bootstrap-r1"
|
||||
},
|
||||
"memo_version": {
|
||||
"type": "integer",
|
||||
"const": 1
|
||||
},
|
||||
"approval_receipt_sha256": {
|
||||
"type": "string",
|
||||
"pattern": "^[0-9a-f]{64}$"
|
||||
},
|
||||
"executor_sha256": {
|
||||
"const": "b0dbbb9786e927055030acf849a72e9a44e9d3d55c84efdf245e419d381684f3"
|
||||
},
|
||||
"records_sha256": {
|
||||
"const": "23577cc4f3ea6c0ca43eb21ca0e3280eb53fb64e29b030dcd31251593f0f3f2f"
|
||||
},
|
||||
"expires_at": {
|
||||
"type": "string",
|
||||
"format": "date-time",
|
||||
"description": "Future, timezone-aware, no later than2026-10-12T23:59:59Z; executor checks local and native DB clocks"
|
||||
},
|
||||
"operator_id": {
|
||||
"type": "string",
|
||||
"pattern": "^[a-zA-Z0-9:._-]{3,80}$",
|
||||
"description": "Truthful separate SERVICE maintenance attribution, not native founder identity"
|
||||
},
|
||||
"authority": {
|
||||
"const": "founder-approved-one-time-administrative-exception"
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
@ -0,0 +1,72 @@
|
|||
{
|
||||
"proposal_id": "USER-CATALOGUE-INFDEC-20261011-R1",
|
||||
"memo_id": "infd-20261011-user-catalogue-bootstrap-r1",
|
||||
"memo_version": 1,
|
||||
"revision": "human-packet-1-after-independent-owner-reviews",
|
||||
"status": "draft-no-native-execution",
|
||||
"executor_source_commit": "c89614ec816886e9a773da3047e35cb099c6c9ca",
|
||||
"reviewed_executor_manifest_sha256": "0ff545d26a0fd72f06040fe377de3efdcc3bd62cdcb6f653247c8ba72f3f34a7",
|
||||
"executor_sha256": "b0dbbb9786e927055030acf849a72e9a44e9d3d55c84efdf245e419d381684f3",
|
||||
"transport_sha256": "3e594e0e8561100ae1eeb34d7208cd5b5e387ae56c29689f155aed94219770f3",
|
||||
"records_sha256": "23577cc4f3ea6c0ca43eb21ca0e3280eb53fb64e29b030dcd31251593f0f3f2f",
|
||||
"runtime_image": "forgejo.coulomb.social/coulomb/user-engine@sha256:f239bbf332b8eb87320c86390fddca1dcb4f7c628a7af75e79dee8058d446a7b",
|
||||
"target": "railiance01 user-engine catalogue database through the frozen Ready portal workload",
|
||||
"deadline": "2026-10-12T23:59:59Z",
|
||||
"scope": [
|
||||
"fresh read-only exact pod/image/package/provider/absence-conflict checks",
|
||||
"approved native PostgreSQL dry-run with genuine external PDP telemetry retained",
|
||||
"one atomic apply or exact-match no-change consumption of fixed two metadata DTOs",
|
||||
"truthful ordinary denial and SERVICE maintenance registration audit, attributed registered event and native consumed-grant ledger",
|
||||
"read-only native exact payload/ledger/audit/event/three-way catalogue/readback verification",
|
||||
"conditional created-only recovery under unchanged original grant before expiry",
|
||||
"private local grant/input cleanup and retained outcome evidence"
|
||||
],
|
||||
"ordinary_application_register_exception": true,
|
||||
"changes_runtime_configuration_or_image": false,
|
||||
"grants_iam_or_human_claims": false,
|
||||
"authorizes_targeted_delivery_or_replay": false,
|
||||
"global_dry_run_side_effect_free": false,
|
||||
"actual_approval_id": null,
|
||||
"actual_founder_id": null,
|
||||
"grant_created": false,
|
||||
"approval_authenticity": "Supervisor independently verifies native founder disposition and exact packet; privateJSON/hash does not authenticate its author. Founder ID remains only in independently verified native receipt, not an invented extra grant field.",
|
||||
"cost_estimate_eur": 0.1,
|
||||
"risk_estimate_eur": 100,
|
||||
"risk_estimate_assumptions": [
|
||||
"build mode without customers",
|
||||
"exactly two catalogue facts, no permissions or identity memberships",
|
||||
"one hour owner recovery atEUR100/h bounds straightforward local metadata repair; uncontrolled consumer effects are not included and require stop/new disposition",
|
||||
"no downtime expected and no runtime resource change"
|
||||
],
|
||||
"risk_estimate_is_authority": false,
|
||||
"owner_reviews": [
|
||||
{
|
||||
"repo": "user-engine",
|
||||
"path": "/home/worsch/user-engine/docs/reviews/2026-10-11-catalogue-maintenance-owner-agreement.md",
|
||||
"sha256": "cb9fdadb3a8f432f100e9340e5b94af932c4d11a5705af6a80d336a5026d867b"
|
||||
},
|
||||
{
|
||||
"repo": "net-kingdom",
|
||||
"path": "/home/worsch/net-kingdom/docs/reviews/2026-10-11-catalogue-maintenance-security-owner-review.md",
|
||||
"sha256": "12d11938eeed8864c5fcec1638b9045d1c96eafbaa7c02a62d17ba599666bd07"
|
||||
},
|
||||
{
|
||||
"repo": "informed-decision",
|
||||
"path": "/home/worsch/informed-decision/docs/reviews/2026-10-11-one-app-catalogue-facts-review.md",
|
||||
"sha256": "b2da26b74cb2bb74d26312941673e95f1653f6154a7ef90155562e316f5837c7"
|
||||
}
|
||||
],
|
||||
"test_evidence": {
|
||||
"current_owner_isolated_postgres": 21,
|
||||
"offline_transport_guards": 6,
|
||||
"original_failed_preparation_preserved": true
|
||||
},
|
||||
"restoration_owner": [
|
||||
"user-engine",
|
||||
"access-engine"
|
||||
],
|
||||
"restoration_criterion": "Before customer production, provide a supported authenticated operator management path using genuine actor authentication and ordinary access-engine PDP admission; verify allow/deny/attribution, then retire this bootstrap exception while preserving its history.",
|
||||
"normal_management_admission_satisfied": false,
|
||||
"conditional_checklist_entry_active": false,
|
||||
"native_catalogue_complete": false
|
||||
}
|
||||
|
|
@ -0,0 +1,8 @@
|
|||
{
|
||||
"read_only": true,
|
||||
"secret_objects_read": false,
|
||||
"real_human_login_performed": false,
|
||||
"method": "Known client rejects unregistered redirect with native KeyCape redirect_uri error; no login/cookie/state output.",
|
||||
"http_status": 400,
|
||||
"registered_client_rejects_wrong_redirect": true
|
||||
}
|
||||
|
|
@ -0,0 +1,24 @@
|
|||
{
|
||||
"ingress_read": true,
|
||||
"secret_objects_read": false,
|
||||
"entries": [
|
||||
{
|
||||
"name": "informed-decision",
|
||||
"uid": "98d3885a-a62d-49c2-91ea-6616fa5a04ae",
|
||||
"hosts": [
|
||||
"decisions.coulomb.social"
|
||||
],
|
||||
"tls_hosts": [
|
||||
"decisions.coulomb.social"
|
||||
]
|
||||
},
|
||||
{
|
||||
"name": "informed-decision-http-redirect",
|
||||
"uid": "550279fb-c9a1-4585-9b21-27b1c8f90b6d",
|
||||
"hosts": [
|
||||
"decisions.coulomb.social"
|
||||
],
|
||||
"tls_hosts": []
|
||||
}
|
||||
]
|
||||
}
|
||||
|
|
@ -0,0 +1,12 @@
|
|||
{
|
||||
"application_absent": true,
|
||||
"binding_absent": true,
|
||||
"exact_match": false,
|
||||
"fixed_application_id": "informed-decision",
|
||||
"native_mutation": false,
|
||||
"partial_or_conflicting": false,
|
||||
"read_only": true,
|
||||
"pod_uid": "e500bcae-c911-43a2-bd40-6a30b39064ab",
|
||||
"pod_image_match": true,
|
||||
"native_exec_returncode": 0
|
||||
}
|
||||
|
|
@ -0,0 +1,62 @@
|
|||
"""Prepared supervisor-only transport. NEVER run before founder exception approval.
|
||||
No credentials leave the workload. Source/grant are delivered only on stdin.
|
||||
"""
|
||||
import argparse,base64,hashlib,json,os,stat,subprocess,sys
|
||||
from pathlib import Path
|
||||
|
||||
def main():
|
||||
p=argparse.ArgumentParser(description=__doc__)
|
||||
p.add_argument('--executor',type=Path,required=True)
|
||||
p.add_argument('--executor-sha256',required=True)
|
||||
p.add_argument('--grant-file',type=Path,required=True)
|
||||
p.add_argument('--grant-sha256',required=True)
|
||||
p.add_argument('--expected-pod-uid',required=True)
|
||||
p.add_argument('--mode',choices=['dry-run','apply','rollback'],default='dry-run')
|
||||
a=p.parse_args()
|
||||
try:
|
||||
st=a.grant_file.lstat()
|
||||
if not stat.S_ISREG(st.st_mode) or st.st_uid!=os.getuid() or stat.S_IMODE(st.st_mode)!=0o600 or st.st_size>8192:raise ValueError('private grant required')
|
||||
source=a.executor.read_bytes();grant=json.loads(a.grant_file.read_text())
|
||||
sha=lambda b:hashlib.sha256(b).hexdigest()
|
||||
canonical=lambda x:json.dumps(x,sort_keys=True,separators=(',',':')).encode()
|
||||
if sha(source)!=a.executor_sha256 or sha(canonical(grant))!=a.grant_sha256:raise ValueError('source/grant mismatch')
|
||||
packet={'source':base64.b64encode(source).decode(),'executor_sha256':a.executor_sha256,'grant':grant,'grant_sha256':a.grant_sha256,'mode':a.mode}
|
||||
native="""
|
||||
import base64,hashlib,json,os,sys
|
||||
payload=json.loads(base64.b64decode('__PACKET__'))
|
||||
saved=os.dup(1);null=os.open(os.devnull,os.O_WRONLY);os.dup2(null,1);os.dup2(null,2)
|
||||
try:
|
||||
source=base64.b64decode(payload['source'])
|
||||
if hashlib.sha256(source).hexdigest()!=payload['executor_sha256']:raise ValueError('source differs')
|
||||
ns={'__name__':'supervised_catalogue_maintenance'};exec(compile(source,'<reviewed-maintenance-executor>','exec'),ns)
|
||||
import psycopg
|
||||
from user_engine.adapters.flex_auth import FlexAuthHTTPAdapter
|
||||
ordinary=FlexAuthHTTPAdapter(base_url=os.environ['USER_ENGINE_FLEX_AUTH_URL'],bearer_token_file=os.environ['USER_ENGINE_FLEX_AUTH_TOKEN_FILE'],timeout_seconds=3)
|
||||
with psycopg.connect(os.environ['USER_ENGINE_DATABASE_URL']) as conn:
|
||||
result=ns['execute'](conn,ordinary,payload['grant'],expected_grant_sha256=payload['grant_sha256'],actual_executor_sha256=payload['executor_sha256'],mode=payload['mode'])
|
||||
except Exception:result={'result':'refused-or-rolled-back','raw_output_suppressed':True}
|
||||
os.dup2(saved,1);os.close(saved);os.close(null);print(json.dumps(result,sort_keys=True))
|
||||
""".replace('__PACKET__',base64.b64encode(canonical(packet)).decode())
|
||||
remote="""
|
||||
import base64,json,subprocess,sys
|
||||
r=subprocess.run(['kubectl','get','pods','-n','user-engine','-l','app.kubernetes.io/name=user-engine','-o','json'],capture_output=True,text=True)
|
||||
try:
|
||||
pods=[p for p in json.loads(r.stdout)['items'] if p['metadata']['uid']=='__UID__' and p.get('status',{}).get('phase')=='Running' and any(c['type']=='Ready' and c['status']=='True' for c in p.get('status',{}).get('conditions',[]))]
|
||||
if r.returncode or len(pods)!=1:raise ValueError('fixed pod not ready')
|
||||
pod=pods[0];portal=[c for c in pod['spec']['containers'] if c['name']=='portal']
|
||||
if len(portal)!=1 or portal[0]['image']!='forgejo.coulomb.social/coulomb/user-engine@sha256:f239bbf332b8eb87320c86390fddca1dcb4f7c628a7af75e79dee8058d446a7b':raise ValueError('source runtime differs')
|
||||
r=subprocess.run(['kubectl','exec','-i','-n','user-engine',pod['metadata']['name'],'-c','portal','--','python3','-'],input=base64.b64decode('__NATIVE__'),capture_output=True)
|
||||
out=json.loads(r.stdout)
|
||||
if r.returncode:raise ValueError('exec failure')
|
||||
except Exception:out={'result':'refused-or-rolled-back','raw_output_suppressed':True}
|
||||
print(json.dumps(out,sort_keys=True))
|
||||
""".replace('__UID__',a.expected_pod_uid).replace('__NATIVE__',base64.b64encode(native.encode()).decode())
|
||||
import uuid
|
||||
uuid.UUID(a.expected_pod_uid) # only UUID reaches the fixed remote literal
|
||||
r=subprocess.run(['ssh','railiance01','python3 -'],input=remote,text=True,capture_output=True)
|
||||
out=json.loads(r.stdout)
|
||||
if r.returncode:raise ValueError('transport failure')
|
||||
except Exception:out={'result':'refused-or-rolled-back','raw_output_suppressed':True}
|
||||
print(json.dumps(out,sort_keys=True))
|
||||
return 0 if out.get('result') in ('created','no-change','rolled-back') else 2
|
||||
if __name__=='__main__':raise SystemExit(main())
|
||||
|
|
@ -0,0 +1,13 @@
|
|||
{
|
||||
"recorded_at": "2026-10-11T01:48:58.692449+00:00",
|
||||
"tests": 6,
|
||||
"passed": 6,
|
||||
"seconds": 0.022,
|
||||
"test_sha256": "a6362e23e5608c36ed84855c90c3f4593aebca6593844e9caf179ca9192a1f3b",
|
||||
"reviewed_transport_sha256": "3e594e0e8561100ae1eeb34d7208cd5b5e387ae56c29689f155aed94219770f3",
|
||||
"runtime_source_modified": false,
|
||||
"network_calls": 0,
|
||||
"native_dispatch": false,
|
||||
"approval_fixture_is_authority": false,
|
||||
"test_scope": "Mocked subprocess transport guard negatives and exact stdin binding only; not estate transport, founder authentication or native DB proof."
|
||||
}
|
||||
|
|
@ -0,0 +1,65 @@
|
|||
"""Offline transport guards with explicit fixture receipts; never dispatch SSH.
|
||||
The mocked packet is not founder authority or a native execution test.
|
||||
"""
|
||||
import base64
|
||||
import contextlib
|
||||
import hashlib
|
||||
import importlib.util
|
||||
import io
|
||||
import json
|
||||
from pathlib import Path
|
||||
import re
|
||||
import tempfile
|
||||
from types import SimpleNamespace
|
||||
import unittest
|
||||
from unittest.mock import patch
|
||||
|
||||
transport=Path(__file__).resolve().parents[1]/'tools'/'run_approved_catalogue_bootstrap.py'
|
||||
if not transport.is_file():transport=Path('/home/worsch/user-engine/tools/run_approved_catalogue_bootstrap.py') # staged offline test fallback only
|
||||
spec=importlib.util.spec_from_file_location('catalogue_transport',transport)
|
||||
m=importlib.util.module_from_spec(spec);spec.loader.exec_module(m)
|
||||
IMAGE='forgejo.coulomb.social/coulomb/user-engine@sha256:f239bbf332b8eb87320c86390fddca1dcb4f7c628a7af75e79dee8058d446a7b'
|
||||
UID='11111111-1111-4111-8111-111111111111'
|
||||
class Tests(unittest.TestCase):
|
||||
def setUp(self):
|
||||
self.tmp=tempfile.TemporaryDirectory();self.root=Path(self.tmp.name)
|
||||
self.source=self.root/'executor.py';self.source.write_text('# explicit fixture source, not a native executor\n')
|
||||
self.grant=self.root/'private.json';self.grant.write_text(json.dumps({'fixture':'not-authority'}));self.grant.chmod(0o600)
|
||||
self.args=['tool','--executor',str(self.source),'--executor-sha256',hashlib.sha256(self.source.read_bytes()).hexdigest(),'--grant-file',str(self.grant),'--grant-sha256',hashlib.sha256(b'{"fixture":"not-authority"}').hexdigest(),'--expected-pod-uid',UID]
|
||||
def tearDown(self):self.tmp.cleanup()
|
||||
def call(self,args=None):
|
||||
output=io.StringIO()
|
||||
with patch('sys.argv',args or self.args),patch.object(m.subprocess,'run',return_value=SimpleNamespace(returncode=0,stdout='{"result":"created"}')) as dispatch,contextlib.redirect_stdout(output):
|
||||
status=m.main()
|
||||
return status,dispatch,json.loads(output.getvalue())
|
||||
def test_wrong_executor_or_grant_hash_refuses_before_ssh(self):
|
||||
for field in ['--executor-sha256','--grant-sha256']:
|
||||
args=self.args.copy();args[args.index(field)+1]='0'*64
|
||||
status,dispatch,out=self.call(args);self.assertEqual(status,2);dispatch.assert_not_called();self.assertEqual(out['result'],'refused-or-rolled-back')
|
||||
def test_nonprivate_or_symlink_grant_refuses_before_ssh(self):
|
||||
self.grant.chmod(0o644);status,dispatch,_=self.call();self.assertEqual(status,2);dispatch.assert_not_called()
|
||||
self.grant.chmod(0o600);link=self.root/'link';link.symlink_to(self.grant);args=self.args.copy();args[args.index('--grant-file')+1]=str(link)
|
||||
status,dispatch,_=self.call(args);self.assertEqual(status,2);dispatch.assert_not_called()
|
||||
def test_invalid_uid_cannot_enter_remote_python_literal(self):
|
||||
args=self.args.copy();args[args.index('--expected-pod-uid')+1]="invalid'); __import__('os').system('false'); #"
|
||||
status,dispatch,_=self.call(args);self.assertEqual(status,2);dispatch.assert_not_called()
|
||||
def test_transport_binds_source_grant_mode_to_stdin_without_credentials(self):
|
||||
status,dispatch,_=self.call();self.assertEqual(status,0);self.assertEqual(dispatch.call_args.args[0],['ssh','railiance01','python3 -'])
|
||||
remote=dispatch.call_args.kwargs['input'];self.assertIn(UID,remote);self.assertIn(IMAGE,remote)
|
||||
native=base64.b64decode(re.search(r"base64.b64decode\('([^']+)'\)",remote).group(1)).decode()
|
||||
packet=json.loads(base64.b64decode(re.search(r"base64.b64decode\('([^']+)'\)",native).group(1)))
|
||||
self.assertEqual(base64.b64decode(packet['source']),self.source.read_bytes());self.assertEqual(packet['mode'],'dry-run');self.assertEqual(packet['grant'],{'fixture':'not-authority'})
|
||||
self.assertIn("os.environ['USER_ENGINE_DATABASE_URL']",native);self.assertIn("os.environ['USER_ENGINE_FLEX_AUTH_TOKEN_FILE']",native)
|
||||
def test_remote_rejects_wrong_uid_not_ready_and_changed_image_before_exec(self):
|
||||
_,dispatch,_=self.call();remote=dispatch.call_args.kwargs['input']
|
||||
for uid,ready,image in [('22222222-2222-4222-8222-222222222222',True,IMAGE),(UID,False,IMAGE),(UID,True,'fixture:changed')]:
|
||||
pods={'items':[{'metadata':{'uid':uid,'name':'fixture-pod'},'status':{'phase':'Running','conditions':[{'type':'Ready','status':'True' if ready else 'False'}]},'spec':{'containers':[{'name':'portal','image':image}]}}]}
|
||||
out=io.StringIO()
|
||||
with patch('subprocess.run',return_value=SimpleNamespace(returncode=0,stdout=json.dumps(pods))) as native_dispatch,contextlib.redirect_stdout(out):exec(compile(remote,'<fixture-remote>','exec'),{'__name__':'fixture'})
|
||||
self.assertEqual(native_dispatch.call_count,1);self.assertEqual(json.loads(out.getvalue())['result'],'refused-or-rolled-back')
|
||||
def test_remote_exact_ready_pod_executes_only_fixed_portal_stdin(self):
|
||||
_,dispatch,_=self.call();remote=dispatch.call_args.kwargs['input'];pods={'items':[{'metadata':{'uid':UID,'name':'fixture-pod'},'status':{'phase':'Running','conditions':[{'type':'Ready','status':'True'}]},'spec':{'containers':[{'name':'portal','image':IMAGE}]}}]}
|
||||
out=io.StringIO()
|
||||
with patch('subprocess.run',side_effect=[SimpleNamespace(returncode=0,stdout=json.dumps(pods)),SimpleNamespace(returncode=0,stdout=b'{"result":"created"}')]) as native_dispatch,contextlib.redirect_stdout(out):exec(compile(remote,'<fixture-remote>','exec'),{'__name__':'fixture'})
|
||||
self.assertEqual(native_dispatch.call_count,2);self.assertEqual(native_dispatch.call_args.args[0],['kubectl','exec','-i','-n','user-engine','fixture-pod','-c','portal','--','python3','-']);self.assertIsInstance(native_dispatch.call_args.kwargs['input'],bytes)
|
||||
if __name__=='__main__':unittest.main()
|
||||
|
|
@ -0,0 +1,66 @@
|
|||
# User Engine owner agreement — exact catalogue maintenance source
|
||||
|
||||
- reviewer: user-engine-owner (agent user-engine, codex)
|
||||
- decision: approved
|
||||
- comment: INTENT §Layer Engine/PIP, Binding rules 1/3/5/6 and Product Boundaries; exact nine-file preparation manifest SHA256 0ff545d26a0fd72f06040fe377de3efdcc3bd62cdcb6f653247c8ba72f3f34a7, executor SHA256 b0dbbb9786e927055030acf849a72e9a44e9d3d55c84efdf245e419d381684f3 and transport SHA256 3e594e0e8561100ae1eeb34d7208cd5b5e387ae56c29689f155aed94219770f3. Work item USER-WP-ADHOC-2026-10-11-T03.
|
||||
|
||||
This dedicated worker loaded User Engine AGENTS/INTENT and worked from its
|
||||
checkout, independently inspecting registration, authorization, domain codecs,
|
||||
PostgreSQL persistence/transactions, audit and outbox consumers. This entry
|
||||
reviews User Engine only. Approval is source agreement for the precisely
|
||||
labelled maintenance alternative; it is no founder decision, native execution
|
||||
permission, runtime admission, human authentication proof or active relaxation.
|
||||
|
||||
Catalogue application/binding facts belong to this Engine. Ordinary protected
|
||||
registration still requires access-engine authorization. The standalone tool
|
||||
truthfully overrides an identified genuine ordinary denial for exactly
|
||||
informed-decision / OIDC informed-decision-approver / system informed-decision,
|
||||
with a separate one-use service maintenance actor, empty roles/assurance and no
|
||||
PDP allow ID. This is an exception to normal admission, requiring a separate
|
||||
exact founder disposition and independently verified native receipt covering
|
||||
executor AND transport, frozen Ready pod/image, records, deadline and recovery.
|
||||
The private hash-pinned artifact asserts this external authority; it does not
|
||||
authenticate its author. Prior R2 readback authority does not authorize it.
|
||||
|
||||
Strict integer memo revision rejects JSON true. Fixed request/action/actor/tenant
|
||||
bindings, native database clock checks, serializable transaction and advisory
|
||||
lock protect exact admission; durable audit key prevents reuse after restart.
|
||||
Both services are constructed before the transaction because owner readiness
|
||||
rolls back the connection. The prior constructor defect and five failed
|
||||
assertions remain in original preparation history. Exact preexisting match
|
||||
consumes with no undo. Partial/conflicting rows, provider unavailable, uncertain
|
||||
denial and unexpected ordinary allow refuse. Native dry-run rolls back local
|
||||
records/audit/outbox/ledger while external provider telemetry may remain. Final
|
||||
clock check precedes commit; it is not a measured commit-completion deadline.
|
||||
|
||||
Created-only recovery checks the original grant digest and expiry, unchanged
|
||||
metadata, absent dependencies, original events and the existing delivery-worker
|
||||
lock. Claimed/delivered/missing events stop recovery; history survives.
|
||||
Dead-lettering excludes automatic drain only. Ordinary separately authorized
|
||||
targeted delivery and replay can revive a retained event; this exception grants
|
||||
neither. Owner reconciliation is required before that later action. No complete
|
||||
consumer inventory or reversal of downstream effects is asserted.
|
||||
|
||||
The existing HTTP delivery adapter sends the eight-field platform envelope,
|
||||
including maintenance labels in data. application.registered is attributive,
|
||||
not an invitation mail class. Source attribution does not prove native consumer
|
||||
receipt, stream completeness, MFA success or user access. Verify actual bound
|
||||
rows, consumed ledger, genuine denial/maintenance audit, registered event and
|
||||
its intended consumer under existing sender admission after any separately
|
||||
approved execution. USER-WP-0026-T03 and USER-WP-0028-T02 remain open.
|
||||
|
||||
All 21 current checks passed in 1.561s using real disposable PostgreSQL, installed
|
||||
immutable f239 image package, read-only staged executor/test mount, isolated
|
||||
network and 512Mi/1CPU per container. Installed service/postgres/flex-auth/codec/
|
||||
domain hashes match current owner-source boundary. Both fixture workers and
|
||||
PostgreSQL were auto-removed; data existed only on tmpfs. Initial immediate
|
||||
cleanup query raced auto-removal and is retained as false; a later query
|
||||
confirmed absence. No native database/workload write, login, credential read,
|
||||
transport dispatch or human decision occurred. The original16 prior-source
|
||||
receipt is retained unchanged and is supplemented, not relabelled as new proof.
|
||||
|
||||
Before execution, the requesting Custodian must obtain all required independent
|
||||
owner reviews and the exact separate founder exception, record its conditional
|
||||
close-down obligation and preserve ordinary authentication/admission as unmet.
|
||||
Rejection, expiry, recovery failure and unverified execution cannot be scored
|
||||
as successful native catalogue acceptance.
|
||||
|
|
@ -0,0 +1,18 @@
|
|||
{
|
||||
"full_intake_and_schema_valid": true,
|
||||
"lifecycle_document_hashes_valid": 20,
|
||||
"native_admission_or_authenticity_proved": false,
|
||||
"negative_intake_guards": [
|
||||
"packet-content-tamper",
|
||||
"boolean-memo-version",
|
||||
"approval-prebound"
|
||||
],
|
||||
"offline_only": true,
|
||||
"register_payload_bytes": 110703,
|
||||
"source_files_equal_packet": true,
|
||||
"submission_digest": "sha256:026b7daa970920f468bb1cfd9e2df1eaaa99d1d5ce1945ea5db0bb33ee9e6f82",
|
||||
"submitter_grant_is_offline_shape_assumption_only": true,
|
||||
"typed_lifecycle_memo_valid": true,
|
||||
"build_reproducible": true,
|
||||
"command": "python3 tools/validate_catalogue_bootstrap_packet.py <packet-directory>"
|
||||
}
|
||||
65
tests/test_catalogue_bootstrap_transport.py
Normal file
65
tests/test_catalogue_bootstrap_transport.py
Normal file
|
|
@ -0,0 +1,65 @@
|
|||
"""Offline transport guards with explicit fixture receipts; never dispatch SSH.
|
||||
The mocked packet is not founder authority or a native execution test.
|
||||
"""
|
||||
import base64
|
||||
import contextlib
|
||||
import hashlib
|
||||
import importlib.util
|
||||
import io
|
||||
import json
|
||||
from pathlib import Path
|
||||
import re
|
||||
import tempfile
|
||||
from types import SimpleNamespace
|
||||
import unittest
|
||||
from unittest.mock import patch
|
||||
|
||||
transport=Path(__file__).resolve().parents[1]/'tools'/'run_approved_catalogue_bootstrap.py'
|
||||
if not transport.is_file():transport=Path('/home/worsch/user-engine/tools/run_approved_catalogue_bootstrap.py') # staged offline test fallback only
|
||||
spec=importlib.util.spec_from_file_location('catalogue_transport',transport)
|
||||
m=importlib.util.module_from_spec(spec);spec.loader.exec_module(m)
|
||||
IMAGE='forgejo.coulomb.social/coulomb/user-engine@sha256:f239bbf332b8eb87320c86390fddca1dcb4f7c628a7af75e79dee8058d446a7b'
|
||||
UID='11111111-1111-4111-8111-111111111111'
|
||||
class Tests(unittest.TestCase):
|
||||
def setUp(self):
|
||||
self.tmp=tempfile.TemporaryDirectory();self.root=Path(self.tmp.name)
|
||||
self.source=self.root/'executor.py';self.source.write_text('# explicit fixture source, not a native executor\n')
|
||||
self.grant=self.root/'private.json';self.grant.write_text(json.dumps({'fixture':'not-authority'}));self.grant.chmod(0o600)
|
||||
self.args=['tool','--executor',str(self.source),'--executor-sha256',hashlib.sha256(self.source.read_bytes()).hexdigest(),'--grant-file',str(self.grant),'--grant-sha256',hashlib.sha256(b'{"fixture":"not-authority"}').hexdigest(),'--expected-pod-uid',UID]
|
||||
def tearDown(self):self.tmp.cleanup()
|
||||
def call(self,args=None):
|
||||
output=io.StringIO()
|
||||
with patch('sys.argv',args or self.args),patch.object(m.subprocess,'run',return_value=SimpleNamespace(returncode=0,stdout='{"result":"created"}')) as dispatch,contextlib.redirect_stdout(output):
|
||||
status=m.main()
|
||||
return status,dispatch,json.loads(output.getvalue())
|
||||
def test_wrong_executor_or_grant_hash_refuses_before_ssh(self):
|
||||
for field in ['--executor-sha256','--grant-sha256']:
|
||||
args=self.args.copy();args[args.index(field)+1]='0'*64
|
||||
status,dispatch,out=self.call(args);self.assertEqual(status,2);dispatch.assert_not_called();self.assertEqual(out['result'],'refused-or-rolled-back')
|
||||
def test_nonprivate_or_symlink_grant_refuses_before_ssh(self):
|
||||
self.grant.chmod(0o644);status,dispatch,_=self.call();self.assertEqual(status,2);dispatch.assert_not_called()
|
||||
self.grant.chmod(0o600);link=self.root/'link';link.symlink_to(self.grant);args=self.args.copy();args[args.index('--grant-file')+1]=str(link)
|
||||
status,dispatch,_=self.call(args);self.assertEqual(status,2);dispatch.assert_not_called()
|
||||
def test_invalid_uid_cannot_enter_remote_python_literal(self):
|
||||
args=self.args.copy();args[args.index('--expected-pod-uid')+1]="invalid'); __import__('os').system('false'); #"
|
||||
status,dispatch,_=self.call(args);self.assertEqual(status,2);dispatch.assert_not_called()
|
||||
def test_transport_binds_source_grant_mode_to_stdin_without_credentials(self):
|
||||
status,dispatch,_=self.call();self.assertEqual(status,0);self.assertEqual(dispatch.call_args.args[0],['ssh','railiance01','python3 -'])
|
||||
remote=dispatch.call_args.kwargs['input'];self.assertIn(UID,remote);self.assertIn(IMAGE,remote)
|
||||
native=base64.b64decode(re.search(r"base64.b64decode\('([^']+)'\)",remote).group(1)).decode()
|
||||
packet=json.loads(base64.b64decode(re.search(r"base64.b64decode\('([^']+)'\)",native).group(1)))
|
||||
self.assertEqual(base64.b64decode(packet['source']),self.source.read_bytes());self.assertEqual(packet['mode'],'dry-run');self.assertEqual(packet['grant'],{'fixture':'not-authority'})
|
||||
self.assertIn("os.environ['USER_ENGINE_DATABASE_URL']",native);self.assertIn("os.environ['USER_ENGINE_FLEX_AUTH_TOKEN_FILE']",native)
|
||||
def test_remote_rejects_wrong_uid_not_ready_and_changed_image_before_exec(self):
|
||||
_,dispatch,_=self.call();remote=dispatch.call_args.kwargs['input']
|
||||
for uid,ready,image in [('22222222-2222-4222-8222-222222222222',True,IMAGE),(UID,False,IMAGE),(UID,True,'fixture:changed')]:
|
||||
pods={'items':[{'metadata':{'uid':uid,'name':'fixture-pod'},'status':{'phase':'Running','conditions':[{'type':'Ready','status':'True' if ready else 'False'}]},'spec':{'containers':[{'name':'portal','image':image}]}}]}
|
||||
out=io.StringIO()
|
||||
with patch('subprocess.run',return_value=SimpleNamespace(returncode=0,stdout=json.dumps(pods))) as native_dispatch,contextlib.redirect_stdout(out):exec(compile(remote,'<fixture-remote>','exec'),{'__name__':'fixture'})
|
||||
self.assertEqual(native_dispatch.call_count,1);self.assertEqual(json.loads(out.getvalue())['result'],'refused-or-rolled-back')
|
||||
def test_remote_exact_ready_pod_executes_only_fixed_portal_stdin(self):
|
||||
_,dispatch,_=self.call();remote=dispatch.call_args.kwargs['input'];pods={'items':[{'metadata':{'uid':UID,'name':'fixture-pod'},'status':{'phase':'Running','conditions':[{'type':'Ready','status':'True'}]},'spec':{'containers':[{'name':'portal','image':IMAGE}]}}]}
|
||||
out=io.StringIO()
|
||||
with patch('subprocess.run',side_effect=[SimpleNamespace(returncode=0,stdout=json.dumps(pods)),SimpleNamespace(returncode=0,stdout=b'{"result":"created"}')]) as native_dispatch,contextlib.redirect_stdout(out):exec(compile(remote,'<fixture-remote>','exec'),{'__name__':'fixture'})
|
||||
self.assertEqual(native_dispatch.call_count,2);self.assertEqual(native_dispatch.call_args.args[0],['kubectl','exec','-i','-n','user-engine','fixture-pod','-c','portal','--','python3','-']);self.assertIsInstance(native_dispatch.call_args.kwargs['input'],bytes)
|
||||
if __name__=='__main__':unittest.main()
|
||||
30
tools/prepare_catalogue_bootstrap_memo.py
Normal file
30
tools/prepare_catalogue_bootstrap_memo.py
Normal file
|
|
@ -0,0 +1,30 @@
|
|||
"""Offline exact human packet preparation; no submission or credential access."""
|
||||
import argparse,base64,hashlib,json
|
||||
from pathlib import Path
|
||||
|
||||
FILES=['decision-packet.md','execution-and-verification.md','proposal.json','private-grant.schema.json','conditional-close-down-entry.md','executor.py','supervisor-transport.py','canonical-records.json','executor-proposal.json','executor-source-boundary.json','original-postgres-receipt.json','final-owner-postgres-receipt.json','user-owner-agreement.md','netkingdom-owner-agreement.md','application-owner-facts-ack.md','retained-native-preflight.json','retained-native-entry-metadata.json','retained-keycape-client-presence.json','transport-guard-receipt.json','transport-guard-tests.py']
|
||||
ID='infd-20261011-user-catalogue-bootstrap-r1'
|
||||
PROPOSAL='USER-CATALOGUE-INFDEC-20261011-R1'
|
||||
EX='b0dbbb9786e927055030acf849a72e9a44e9d3d55c84efdf245e419d381684f3'
|
||||
TR='3e594e0e8561100ae1eeb34d7208cd5b5e387ae56c29689f155aed94219770f3'
|
||||
|
||||
def build(root):
|
||||
sha=lambda b:'sha256:'+hashlib.sha256(b).hexdigest()
|
||||
assert sha((root/'executor.py').read_bytes())=='sha256:'+EX
|
||||
assert sha((root/'supervisor-transport.py').read_bytes())=='sha256:'+TR
|
||||
contents=[];items=[];documents=[]
|
||||
for name in FILES:
|
||||
data=(root/name).read_bytes();item=name.replace('.','-');media='application/json' if name.endswith('.json') else 'text/markdown' if name.endswith('.md') else 'text/plain'
|
||||
contents.append({'item_id':item,'media_type':media,'content':data.decode()});items.append({'item_id':item,'label':name,'hash':sha(data)});documents.append({'digest':sha(data),'media_type':media,'content_base64':base64.b64encode(data).decode()})
|
||||
question='Approve the exact one-time User Engine catalogue registration for Informed Decision, with genuine PDP denial retained, explicit supervised maintenance attribution, native dry-run and guarded recovery by October 12 at 23:59 UTC, plus restoration of ordinary authenticated management before customer production?'
|
||||
memo={'id':ID,'version':1,'question':question,'requested_act':'approve','binding_level':'organizational','brief':'One fixed Application/browser-client/protected-system binding; ordinary application.register admission remains unmet. Exact reviewed executor and transport, 21 isolated PostgreSQL checks and 6 offline transport guards. Separate founder exception required before native dry-run/apply; private JSON/hash is not authentication. No image/config/IAM/human claims; created-only recovery may stop on delivery/expiry. Conditional restoration owner and criterion attached.','binding':{'principal':{'id':'pending-human-session','kind':'person','display_name':'Founder review'},'target':{'kind':'resource','id':'realm:kubernetes/railiance01/user-engine/catalogue/informed-decision','label':'Fixed Informed Decision Application and binding in User Engine','environment':'build'},'terms':'Only '+PROPOSAL+' and attached executor '+EX+' AND supervisor transport '+TR+' with attached fixed records; execute by 2026-10-12T23:59:59Z after independent native founder-receipt confirmation and fresh frozen pod/image/package/provider/absence checks. Approve native dry-run with external PDP telemetry, one atomic mutation/no-change, read-only verification, private-input cleanup and original-grant created-only recovery before expiry. No targeted replay or future registrations; conditional ordinary management restoration before customer production.'},'step_kind':'approve','packet':items,'highlights':[{'id':'explicit-maintenance-exception','item_id':'decision-packet-md','note':'This overrides genuine ordinary application.register denial for exactly two metadata facts; it does not satisfy normal PDP admission or authenticate a human. Recovery stops on changed dependencies,expiry or claimed/delivered/missing event. Targeted replay/delivery is excluded. Preserve one conditional restoration obligation before customer production.','required_ack':True,'severity':'warning','locator':{'kind':'section','heading':'Requested decision'}}],'sealed':False,'approval_id':None,'approval_binding_digest':None}
|
||||
intent={'action':'administer','principal':'user-engine','purpose':'Approve one supervised catalogue metadata exception with exact source/transport, expiry, verification and guarded recovery; ordinary management admission remains unmet.','target':{'id':PROPOSAL,'type':'catalogue-maintenance-exception','system':'railiance01'}}
|
||||
intake={'kind':'informed-decision.memo-intake','version':1,'idempotency_key':ID+'-v1','memo_class':'decision-record','review_group':'net-kingdom-admins','drafted_by':'custodian-codex','approval_intent':intent,'memo':memo,'packet':contents}
|
||||
lifecycle=[{'id':ID,'register':{'memo':memo,'documents':documents},'publish':{'version':1,'audience':{'subjects':[],'groups':['net-kingdom-admins']}},'review':{'version':1,'options':{'submitter':'state-hub','memo_class':'decision-record','review_group':'net-kingdom-admins','approval_intent':intent}}}]
|
||||
# Prepared whole register payload stays <=256KiB; no network call is made.
|
||||
assert len(json.dumps(lifecycle[0]['register'],separators=(',',':')).encode())<=256*1024
|
||||
for name,value in [('memo.json',memo),('intake.json',intake),('lifecycle-commands.json',lifecycle)]:
|
||||
(root/name).write_text(json.dumps(value,indent=2,ensure_ascii=False)+'\n')
|
||||
return {'memo_id':ID,'packet_items':len(items),'register_payload_bytes':len(json.dumps(lifecycle[0]['register'],separators=(',',':')).encode())}
|
||||
if __name__=='__main__':
|
||||
p=argparse.ArgumentParser(description=__doc__);p.add_argument('packet',type=Path);args=p.parse_args();print(json.dumps(build(args.packet)))
|
||||
34
tools/validate_catalogue_bootstrap_packet.py
Normal file
34
tools/validate_catalogue_bootstrap_packet.py
Normal file
|
|
@ -0,0 +1,34 @@
|
|||
"""Offline human packet validation; does not authenticate or submit its author."""
|
||||
import argparse,base64,copy,hashlib,json,sys
|
||||
from pathlib import Path
|
||||
|
||||
def validate(root,infd_root):
|
||||
sys.path.insert(0,str(infd_root))
|
||||
import jsonschema
|
||||
from informed_decision.intake import validate_submission,SubmitterGrant,IntakeRefused
|
||||
from informed_decision.lifecycle_commands import decode_memo,decode_documents
|
||||
env=json.loads((root/'intake.json').read_text());commands=json.loads((root/'lifecycle-commands.json').read_text())
|
||||
schema=json.loads((infd_root/'schemas/memo-intake.schema.json').read_text());jsonschema.validate(env,schema)
|
||||
grant=SubmitterGrant('state-hub',frozenset({'decision-record'}),frozenset({'net-kingdom-admins'}))
|
||||
parsed=validate_submission(env,submitter_id='state-hub',grant=grant);memo=decode_memo(commands[0]['register']['memo']);docs=decode_documents(commands[0]['register']['documents'],memo)
|
||||
assert env['memo']==commands[0]['register']['memo']==json.loads((root/'memo.json').read_text())
|
||||
assert commands[0]['review']['options']['approval_intent']==env['approval_intent']
|
||||
assert len(docs)==len(memo.packet)==len(parsed.packet)==20
|
||||
for item in env['packet']:
|
||||
source=root/next(x['label'] for x in env['memo']['packet'] if x['item_id']==item['item_id'])
|
||||
assert item['content'].encode()==source.read_bytes()
|
||||
assert len(json.dumps(commands[0]['register']).encode())<=256*1024
|
||||
assert hashlib.sha256((root/'executor.py').read_bytes()).hexdigest()=='b0dbbb9786e927055030acf849a72e9a44e9d3d55c84efdf245e419d381684f3'
|
||||
assert hashlib.sha256((root/'supervisor-transport.py').read_bytes()).hexdigest()=='3e594e0e8561100ae1eeb34d7208cd5b5e387ae56c29689f155aed94219770f3'
|
||||
negatives=[]
|
||||
for label in ['packet-content-tamper','boolean-memo-version','approval-prebound']:
|
||||
trial=copy.deepcopy(env)
|
||||
if label=='packet-content-tamper':trial['packet'][0]['content']+='\nchanged'
|
||||
elif label=='boolean-memo-version':trial['memo']['version']=True
|
||||
else:trial['memo']['approval_id']='fixture-unapproved'
|
||||
try:validate_submission(trial,submitter_id='state-hub',grant=grant)
|
||||
except IntakeRefused:negatives.append(label)
|
||||
else:raise AssertionError('negative accepted')
|
||||
return {'offline_only':True,'full_intake_and_schema_valid':True,'typed_lifecycle_memo_valid':True,'lifecycle_document_hashes_valid':len(docs),'source_files_equal_packet':True,'negative_intake_guards':negatives,'register_payload_bytes':len(json.dumps(commands[0]['register']).encode()),'submission_digest':parsed.submission_digest,'submitter_grant_is_offline_shape_assumption_only':True,'native_admission_or_authenticity_proved':False}
|
||||
if __name__=='__main__':
|
||||
p=argparse.ArgumentParser(description=__doc__);p.add_argument('packet',type=Path);p.add_argument('--informed-decision-root',type=Path,default=Path('/home/worsch/informed-decision'));a=p.parse_args();print(json.dumps(validate(a.packet,a.informed_decision_root),sort_keys=True))
|
||||
Loading…
Add table
Add a link
Reference in a new issue