qdb Platform Docs Download

Repository source: docs/plans/publish_local_public_keys/publish_local_public_keys_assessment_evidence.txt

Title: Public-key publisher Step 1 evidence and boundaries
Date: 2026-11-22
Cycle: v3/publish_local_public_keys
Status: Planning only; awaiting Approved Step 1
Baseline: 22fc9f10a4d4f8cba9ecaed501aba2ea90d129e4
Authorization: User said please go ahead after the proposed Step 1 comparison. No implementation, remote publication, production read/write, deployment or commit authorized.
Documentation-Scope: docs/plans/publish_local_public_keys_step1_solution_assessment.md; this evidence file; docs/plans/publish_local_public_keys_debug_log.md; docs/plans/effort_ledger/publish_local_public_keys.md
Dependencies: zero new or updated; no manifests, installs or remote service used

Feedback and prior work:
Searched current main docs/feedback/items by outcome and existing sources. PF-20261104-F24 concerns cloning an individual post and is separate. Accepted records PF-20261121-F03 (reverse instance import) and PF-20261121-F11 (local approvals surviving on production) are in the saved triage under /home/wsl/v3-feedback-triage-save/docs/feedback/items/. They have not reached current main; do not allocate replacement IDs or silently copy the whole triage into this cycle.
Reverse-import source: https://zenmemes.com/posts/thread-20261113040435-b6ef35e4
Approval-transfer source: https://zenmemes.com/posts/thread-20261113042221-2b0920bf
Current main and available branch/history searches found no publisher cycle matching this outcome. No new build is inferred from those searches beyond the inspected ordinary CLI/API paths. Import-with-approvals is existing pull-side work and remains distinct. This cycle is a public-key-only slice of F03; it does not complete F03/F11.

Canonical reuse:
- v3 and scripts/import_instance.php: ordinary CLI conventions, explicit source/destination options, preview, failure and resume reporting. Proposed publisher is an ordinary local CLI, not a background service.
- src/ForumRewrite/Security/OpenPgpKeyInspector.php: derives full primary fingerprint and initial username from public armor. Reuse; do not add another key parser.
- src/ForumRewrite/Canonical/IdentityBootstrapRecordParser.php and existing canonical paths: determine which public keys are associated with local identities. Never scan browser storage, agent keyrings, private files or a whole home directory.
- src/ForumRewrite/Http/ApiTextController.php::getProfile: public fingerprint-derived slug lookup returns Identity-ID, Username, Approved and Retired; missing profile returns 404. Its response does not include full public-key armor, so an exact-armor comparison is not presently supported by that response alone.
- src/ForumRewrite/Http/ApiRouteCatalog.php: get_profile and link_identity are existing public routes. Restricted instance policy can still refuse discovery or writes; catalog membership is not proof of production availability.
- src/ForumRewrite/Http/ComposeAndAccountKeyController.php::linkIdentityApi: POST public_key invokes the existing linkIdentity writer and returns plain-text identity, profile, username, bootstrap and commit fields. No holder signature or private key is required for this route.
- src/ForumRewrite/Write/LocalWriteService.php::linkIdentity: inspects public armor, rejects locally retired identities at the destination, refuses an existing fingerprint, writes public-key/identity records and creates a destination bootstrap anchor when none is supplied. Do not send local bootstrap post IDs to another instance or replace this existing writer.
- prepare_identity/create_identity is a distinct signed path requiring the corresponding holder key. Do not require every local private key merely to republish public keys.
- public/quill.py: existing request and profile lookup/registration patterns; its saved signing identity and credentials are not a general inventory of local public identities. Reuse appropriate transport conventions without silently switching its saved identity or copying state across sites. Command location and helper boundaries remain Step 3 decisions.
- src/ForumRewrite/Import/ContentImportPlanner.php: recognizes identity/public-key records and separates authority/private records. Option B would need a real selective public-identity mode; the existing full-content import does not already provide this scope.

Material risks and early checks for the selected slice:
Names: local signed profile-name history can differ from the name encoded in public armor. Impact: misleading publication and unintended username grouping. Before allowing publication, compare the local name with the derived destination registration name. Refuse/report mismatches until an identity-history transfer is separately approved; do not fabricate a rename or silently discard the difference.
Retirement: publishing a locally retired key to a destination without its retirement record could revive an unwanted identity. Identify and exclude local retired keys; treat destination retirement as refusal, not success. No retirement record transfer or retirement redesign in this slice.
Authority: public registration is neither proof of private-key possession nor approval, operator status or message access. Verify approval state stays unchanged and display the destination's actual name/state; no automatic approvals or seeds.
Existing identities: duplicate registration is an error, not an idempotent success. Preflight by fingerprint, distinguish retirement and policy refusal from absence, and read back after an uncertain response. Never infer absence from timeout, HTML, authentication failure or generic non-200.
Partial acceptance: retain per-key results and allow rerun without replacing existing records. Changed source bytes or a changed destination need a fresh preview. Do not call a lost response a definite failure or regenerate identities.
Retired/changed public armor: a fingerprint match is a useful identity match, not proof every public armor byte/subkey is equal. Define this slice as missing-identity publication; existing identities are skipped, not updated. Surface mismatched local profile metadata; do not claim key-update synchronization.
Destination and credentials: require an explicit destination and clearly bind preview and publication to it. Preserve public/private instance access policy; no embedded production defaults, credential transfer, unsolicited peer discovery, production requests or new authentication bypass.
Source records: read only canonical public-key/identity/name/retirement evidence needed for classification, using existing models. Reject private-key armor or other private material before preview/network work, even if it appears in a public-key directory. Verify outgoing payloads contain only the selected public key. No private keys or private-message stores are transmitted or logged.

Completion and verification boundary:
The deliverable now is the reviewable Step 1 comparison, its reproducible evidence, study snapshots and debug log. Correct Step 1 in place on feedback; no later step is drafted without Approved Step 1.
Future implementation acceptance must use the ordinary local CLI against fixture destinations: preview, selected publish, already-present skip, renamed/retired/refused states, malformed key, lost response after a committed remote write, mixed success, retry and fingerprint/name read-back. Shared registration consumers and both public and restricted-site refusal need appropriate existing checks. No schema change or new dependency is expected. Actual production success and message-history recovery remain unverified until separately authorized/replayed.
Checks now: source/document review only; current baseline changes to PRINCIPLES.md, CONTRIBUTING.md and Railspike since the prior review are empty. Three frozen R1 snapshot hashes match the existing ledger. Local document links, artifact scope and whitespace are checked before handoff. Later-step navigation links are deliberately placeholders. No application tests or full suite run for planning-only changes; no runtime or production verification claimed.

Step 2 authorization and evidence update (2026-11-22T21:13:08+00:00):
- Maintainer approved Step 1 Option A with "approved step 1". Current authority extends to drafting Step 2, not application changes, production requests, a branch/planning commit or Step 3.
- The Step 2 feature description joins the current documentation scope. Other application/test/concept inventories remain proposals until the required later approvals.
- No scope change or new enhancement request. Scope v1/A retains public-key-only publication; registration's normal hidden bootstrap anchor is not a user-post transfer. Preview binding is a required outcome; its storage/command mechanism remains a Step 3 decision.
- Current HEAD remains 22fc9f10a4d4f8cba9ecaed501aba2ea90d129e4. Applicable host, principle, contributor and Railspike files have no changes since Step 1. Restored the recorded enabled debug/extended modes and R1/P2 study state; all three frozen hashes match.
- Completion check for this planning step: requirements, normal CLI entry, known WSL-to-production boundary, failure/retry, material risks, reuse and touched concepts recorded. Links/source paths/whitespace checked; Step 3 and Step 4 absent. Runtime tests, production/device checks, deployment and the full suite are not run because no runtime behavior changed.

Step 3 planning decisions (2026-11-22T21:43:30+00:00):
Approval: Maintainer said "approved step 2". No enhancement or scope change; Step 3 planning only. Step 1/2 text stays unchanged.
Ordinary interface: publish-keys accepts an explicit HTTP(S) destination, normal --repository-root override and a timeout. Default invocation previews only. --plan=FILE writes a local human-readable plan. --publish=FILE plus one or more explicit --key fingerprints publishes that selection; there is no automatic all-keys publication or repeated confirmation prompt. Unknown/empty options fail before remote writes. Existing import behavior is untouched.
Plan record: Use the existing Key: value text convention and GenericTextRecordParser, with a destination, canonical source-root binding, selected fingerprint/name/armor digest and name/retirement evidence digests. Bind the exact public payload to its source bytes. Require a new preview after relevant source/destination/selection changes. Public metadata only; never include private keys, cookies or credentials. This is local review data, not a signed authority record. Document its supported shape with the command; do not introduce JSON or a new canonical server record.
Source selection: Walk only canonical public-key/identity/name/retirement paths. Use IdentityBootstrapRecordParser, ProfileNames and KeyRetirement; do not trust an unrefreshed derived display name or scan browser/agent storage. Reject paths escaping the chosen root, ambiguous/unassociated/malformed keys and private material. Use the established retirement model; uncertain evidence is a refusal, not active status.
Strict inspection probe: Generated one disposable Ed25519 fixture in a temporary isolated GPG home, outside the repository. Public export showed colon record pub. Secret export showed sec. Relabeling secret armor as PUBLIC KEY BLOCK still showed sec. Appending secret armor after a public block showed pub,sec. All commands exited zero. Therefore armor labels and successful inspection are insufficient to enforce public-only payloads. No key bytes printed; fixture/keyring removed.
Strict inspection decision: Extend OpenPgpKeyInspector with an opt-in public-only method returning the existing fingerprint/username metadata. Validate one supported public block and all GPG public/secret record classes; reject secret primary/subkeys and extra payload. Keep inspect() and legacy callers unchanged. Test both ordinary private armor and secret packets under a public label before enabling any destination request.
New helper rationale: The archive downloader only supports fixed archive paths and follows redirects; it is not a profile/registration client. scripts/publish_text.php contains top-level CLI/signing behavior, not a safely importable generic client. Add a bounded project-owned public-key publisher and narrowly scoped destination helper under src/ForumRewrite/Support/, reusing platform stream conventions, existing URL validation and canonical parsers. Do not copy a second key parser, registration writer or general HTTP framework.
Planned helper boundaries: collect(root) returns checked canonical identities; profile(destination, fingerprint) returns typed present/missing/refused/unknown metadata; preview(inventory, destination) produces the text plan; publish(plan, fingerprints) revalidates and returns per-key outcomes. Keep data and parsing in the publisher; the scripts entry handles arguments/output/exit status. These are proposed helper contracts, not new server API signatures.
Transport: Validate the explicit base URL (HTTP/HTTPS, no userinfo/query/fragment); preserve a supported base path. Bound request deadlines and response size, retain TLS peer checks, and reject redirects so publication cannot drift to another host. Read get_profile as its existing Key: value protocol and link_identity as its existing key=value protocol; canonical local plans/output remain Key: value. Do not turn HTML, a generic 404, timeout, refusal or malformed profile into missing status. Use no borrowed browser sessions or cross-site credentials; restricted targets fail with an actionable next step.
Publication: Submit only public_key to link_identity; do not send local bootstrap anchors. Compare destination read-back identity/name and retirement state. Existing fingerprints are skipped rather than updated; conflicting name/retirement metadata is reported. On an uncertain POST, query the exact identity before retry. Failure of read-back leaves an unknown outcome with retry guidance; success does not imply possession, approval, operator status or message access.
Results: Print a concise human-readable per-key result and summary. The reviewed plan remains available; completed keys are discoverable remotely, so an interrupted run can use the same selection without a second transaction journal. Selected unknown/refused/conflicting keys produce unsuccessful status while confirmed/already-present keys remain distinguishable. Do not overwrite existing identities or approvals to repair a failed run.
Fault matrix: zero-write default/plan preview; valid selection; repeated already-present skip; explicit multi-key mixed success; renamed local profile; malformed and escaped source path; public-label secret packets and appended private block; local retirement/broken retirement evidence; destination retirement/name conflict; profile and registration refusal; HTML, unexpected/malformed 404 and non-200; redirects/TLS/connectivity failures; oversized response; another client registers between GET and POST; accepted POST with dropped response; failed read-back then successful rerun; changed source key/name/retirement state or destination between preview and publish. Verify no body includes private bytes and no preview sends POST.
Shared checks: OpenPgpKeyInspectorTest, CanonicalRecordParsersTest, WriteApiSmokeTest and IdentityBootstrapDiagnosticsTest as affected; new PublishKeysCommandTest/PublicKeyPublisherTest cover ordinary CLI and real loopback destinations. Run only smoke plus affected tests, never the full suite. Keep successful legacy inspector behavior and normal browser/Quill registration contracts. No theme/nav checks are required because this slice adds no web UI; no schema/dependency/migration change.
Release and production: Required local checks must pass or retained baseline failures must be reproduced and documented. A production refusal or unavailable authorization remains unresolved, not proof of a broken publisher. No live instance requests are authorized by these planning approvals. Supply exact operator preview/publish/retry guidance and retain pending production acceptance in the handoff and feedback notes.
Feedback integration: F03 is the reverse-import outcome; this slice does not close it, and F11 remains separate. At Step 4 inspect freshly fetched main and the saved accepted F03 record. If main lacks it, bring only that exact approved intake identity into this cycle before adding partial-progress evidence; preserve all original request/sources. Resolve any collision explicitly; do not repurpose an ID or import the full unrelated triage. Future addressing commits update that record and include Feedback: PF-20261121-F03, without implying full reverse import complete.
Commit and evidence ownership: On Approved Step 3, use the required fresh-main feature branch, move/commit approved Steps 1-3 with allowed organization/debug references before implementation. Auxiliary evidence and cycle ledger do not bypass the narrow planning-commit gate; include their accumulated material with the appropriate approved stage/closeout commit. Create Step 4 summary only after planning commit; each completed stage and its summary update commit before the next stage. Stop and split/replan a stage before coding if it grows beyond the workflow's bounded work allowance. No stage is claimed implemented now.

Step 4 authorization: Maintainer approved Step 3. Implementation on freshly fetched main 8b00a78be, planning commit 68e4c4269. Approved content moved without substantive changes; only relative paths/index repaired. The earlier planning-only statements above are dated history, not current execution authority. Source paths and packet/type checks reused as recorded. Stage 1 evidence and baseline failures are in the implementation summary.