Skip to content

Prepare audited host staff and replica maintenance - #194

Merged
Yoshiofthewire merged 8 commits into
masterfrom
feat/tenancy-staff-cli
Nov 24, 2026
Merged

Yoshiofthewire merged 8 commits into
masterfrom
feat/tenancy-staff-cli

Conversation

@Yoshiofthewire

@Yoshiofthewire Yoshiofthewire commented Nov 23, 2026 •

Copy link
Copy Markdown
Member

Prepare staff-only accounts and explicit shared-setting acceptance on an existing PostgreSQL tenancy target. Hosted startup remains refused, and standalone account/bootstrap behavior stays unchanged.

Merged validation: reviewed head 06bd1d18 passed 12 CI checks with 2 intentional publication skips; trusted current-head security and Guide cleared, and the default-branch base was clean. Guarded merge: fcbf98ca225ca1b6ad6f366e992a89e780af95a8.

  • Multi-mode user add --admin --username accepts bounded derived credentials on stdin, with target/staff-org/region in environment. Create the account and platform audit atomically, then emit the recovery code; refuse customer/everyday creation and password/DSN argv.
  • Prepare staff-only bootstrap with real password hashing before N3, an in-lock target/emptiness recheck and audit. Independent pools create one administrator. Everyday bootstrap variables refuse; the missing-admin warning honors the staff-org boundary.
  • Add accept-replica-config --confirm-stopped over the complete app field map, using a read-only loader without local key minting. Preserve retained encryption keys and fixed install bindings; commit changed-name audit and fingerprint together. The fingerprint map has no unchecked capacity arithmetic.
  • Include current master 69cbd5c, retaining merged object/part I/O, final shared-client pin and Prepare bounded primary-object credentials #197 credential preparation. Resolve documentation overlaps by retaining both contracts; existing staff/fingerprint/maintenance code is unchanged.
  • Keep the approved suite-scope constraint and the dedicated native-PG CI cases. No new Notes feature, backup transport, erasure protocol or supported hosted-startup workflow is selected.

Review this: staff_user.go owns credential/target/output boundaries; staff_bootstrap.go owns concurrent seeding; replica_accept.go and the maintenance loader own retained-key acceptance. The runbook states the stopped-replica precondition.

Checked: exact head 06bd1d18fac90f9fbd390622b5f3ff96125b2091: affected race compile first, whole-repo build/vet, normal/FIPS affected races on SQLite/PostgreSQL 17.12. Includes staff/password/bootstrap/fingerprint/acceptance/restore/golden checks, complete blobstore/object/part suite and inherited credential refusal/redaction/startup-fence checks. PG-only tests pass on PG and explicitly skip on SQLite. mdBook, 285 local links, strong-crypto compose and actionlint pass. Session54611 actually exited0; exact source hashes remain unchanged.

Not checked: Live hosted lifecycle/provider/replica qualification remains unverified. Preserved local queued full-suite jobs are not counted as passes.

You need to: nothing for this merged PR. Relevant owner interface approval is recorded; deployment, live maintenance and hosted launch retain their separate gates.

Detail

Archive SHA-256 880038e435ed530648bbe6993662240ddd3d0c7c7c39edc62ed7dbc30800f02f; commit ID and all 1,579 blobs match git. Fresh local Linux test material has no checkout/second writer, uses Go1.27.4/default toolchain policy, verified dependencies/default caches, the host lock and 6 GiB/no-swap/400% CPU scope with blank relays. Owned UTF8/C/C PG17.12 fixture cleaned on exit. Major full material is ~/.local/state/kynotes-tenancy/verification/06bd1d1-full.

A 459-entry source-identity manifest covers both repaired layers: existing staff/fingerprint/CLI/config sources match prior7184ed5, existing SSO sources match priorad0b4fb, and object/credential code plus go.mod/go.sum match master69cbd5c. Documentation retains the object, credential and host sections; only shared78's merged-but-unconsumed status is corrected. The consumed pin remains79823f9; no new shared API or erasure protocol is selected. All prior frozen worktrees, archive inputs and jobs remain intact, including the prior-base integration checks.

Normal startup still refuses multi. Maintenance opens the exact current PG schema without migration and never recovers backup bytes or initializes a hosted deployment. Stop every replica before acceptance and retain the server salt, which also encrypts the sealed recovery token. Owner approval is separate from technical gates.

🤖 Generated with Claude Code

Yoshiofthewire and others added 5 commits November 23, 2026 17:35
Keep single-mode commands and hosted startup refusal intact while preparing audited staff creation and retained-key configuration acceptance.

Co-Authored-By: GPT 6.1 Sol <noreply@openai.com>
Use exact existing PostgreSQL schemas for host staff creation and explicit stopped-replica configuration acceptance. Seed staff-only administrators once across replicas, audit every creation, and retain the normal multi startup refusal.

Co-Authored-By: GPT 6.1 Sol <noreply@openai.com>
Record the owner direction relayed in board 7767 without changing frozen staff review inputs or creating password-manager, VPN, AI or other Notes feature work.

Co-Authored-By: GPT 6.1 Sol <noreply@openai.com>
Document exact-schema staff creation and stopped-replica fingerprint acceptance, required secret boundaries and owner interface review. Keep native backup transport, primary object storage and hosted startup explicitly unbuilt.

Co-Authored-By: GPT 6.1 Sol <noreply@openai.com>
Give the deliberately unauthorized customer administrator explicit empty credential fields so PostgreSQL reaches the staff warning and audit rollback assertions.

Co-Authored-By: GPT 6.1 Sol <noreply@openai.com>
Comment thread internal/storage/replica_config.go Fixed
@Yoshiofthewire

Yoshiofthewire commented Nov 23, 2026 •

Copy link
Copy Markdown
Member Author

PR Reviewer Guide 🔍

Here are some key observations to aid the review process:

⏱️ Estimated effort to review: 4 🔵🔵🔵🔵⚪

🧪 PR contains tests

⚡ No major issues detected


Advisory only: this comment never gates the pull request.
gpt-6.1-sol using pr-agent on behalf of Yoshi

@Yoshiofthewire

Yoshiofthewire commented Nov 23, 2026 •

Copy link
Copy Markdown
Member Author

Security review - cleared

Detail withheld: this repository is public, and posting an unfixed finding here would be public disclosure. The full report was posted to the hand-off board at https://myslop.urlxl.us/f/pr-reviewer-busnes-app-kynotes-server-194, where it is readable by the operator and expires seven days after the last post.


gpt-6.1-sol using security-audit on behalf of Yoshi

@Yoshiofthewire

Yoshiofthewire commented Nov 23, 2026 •

Copy link
Copy Markdown
Member Author

Autonomous review - 1/1 personas cleared

  • security: cleared

Merging remains a human decision; this bot never approves.


gpt-6.1-sol using security-audit on behalf of Yoshi

Let the runtime size the fingerprint map without unchecked length arithmetic. Preserve every field, HMAC domain, digest and serialized fingerprint. The allocation hint has no effect on outputs.

Co-Authored-By: GPT 6.1 Sol <noreply@openai.com>
@Yoshiofthewire

Copy link
Copy Markdown
Member Author

Note

🤖 GPT 6.1 Sol responding on behalf of Yoshiofthewire

Fixed the unchecked capacity arithmetic in 7184ed5d9073f98b6eead48a3cfbe22388bbe925: the fingerprint map now uses make(map[string]string). Field iteration, HMAC domain/input, key marker and encoding are unchanged, so existing persisted fingerprints remain compatible.

Fresh existing fingerprint/config-acceptance, maintenance, bootstrap, password and single-tenant golden checks passed under normal and FIPS race profiles on SQLite and PostgreSQL, plus build/vet and documentation checks, from the exact commit archive. Required full Major checks for this head are queued behind the shared lock; that is not a pass or a claim about the new CodeQL run. DOX pass: contracts and required verification are unchanged.

Merge current master e94c561 into the staff-maintenance branch. Resolve five documentation-only overlaps by retaining both exact object and host contract blocks in build order. Preserve staff/fingerprint/maintenance source byte for byte and retain master object code and the final shared-client pin.

Co-Authored-By: GPT 6.1 Sol <noreply@openai.com>
@Yoshiofthewire

Copy link
Copy Markdown
Member Author

Note

🤖 GPT 6.1 Sol responding on behalf of Yoshiofthewire

Repaired integration with master e94c561 in a88eab73a493f675ee96b2ba234ae2921c890284. All five conflicts were documentation-only; both object and host contract blocks are retained. Staff/maintenance/fingerprint/CLI/CI source is byte-identical to 7184ed5; object source, go.mod and go.sum match master, including final shared-client pin 79823f9 and the map-capacity correction.

Fresh exact-archive affected normal/FIPS SQLite/PostgreSQL race checks passed, including real-password/staff/bootstrap/fingerprint/acceptance/restore/golden and the complete object/part suite, plus build/vet/docs (session55416 exit0). The new-head full suite is queued once under the shared lock; all previous frozen sources/jobs remain intact. Existing owner operator-interface approval and fresh current-head CI/security/Guide gates remain required.

Integrate master 69cbd5c, retaining the reviewed object credential source and both credential/host documentation blocks. Keep every staff/fingerprint/maintenance source unchanged, preserve the 79823f9 object pin, and correct only the dispatcher-reported merged status of the unconsumed 78 API. No startup or protocol selection changes.

Co-Authored-By: GPT 6.1 Sol <noreply@openai.com>
@Yoshiofthewire

Copy link
Copy Markdown
Member Author

Note

🤖 GPT 6.1 Sol responding on behalf of Yoshiofthewire

Updated the repair to master 69cbd5c in 06bd1d18fac90f9fbd390622b5f3ff96125b2091, including both merged #196 and #197. Documentation retains object, credential and staff contracts; only shared78's merged-but-unconsumed metadata is corrected. Existing staff/fingerprint/maintenance code matches7184ed5; object/credential code and pins match master. #193's audited source is untouched.

Fresh exact-archive normal/FIPS SQLite/PostgreSQL affected races, complete object/part tests, inherited credential cases, staff/password/bootstrap/fingerprint/acceptance/restore/golden, build/vet/docs and actionlint passed (session54611 exit0). Current full verification is queued once, session58522; all previous frozen inputs/jobs remain preserved. Owner operator-interface approval is still required, separately from fresh current-head CI/security/Guide gates.

@Yoshiofthewire

Copy link
Copy Markdown
Member Author

Note

🤖 gpt-6.1-sol responding on behalf of Yoshiofthewire

The owner approved this interface with “All Approved” after the dispatcher's four-item explanation.

For this PR, approval covers staff-account provisioning and offline accept-replica-config --confirm-stopped maintenance, reviewed at 06bd1d18fac90f9fbd390622b5f3ff96125b2091. The interface-approval hold is lifted. Root retains current-head CI/security/Guide checks, dependency-order integration and merge responsibility.

This is approval to merge the described interface. Live maintenance, deployment and hosted startup/launch retain their separate gates.

@Yoshiofthewire
Yoshiofthewire merged commit fcbf98c into master Nov 24, 2026
14 checks passed
@Yoshiofthewire
Yoshiofthewire deleted the feat/tenancy-staff-cli branch November 24, 2026 03:59
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants