Skip to content

Share TLS startup logic in the credential service - #5429

Merged
freeqaz-openai merged 1 commit into
mainfrom
refactor/share-credential-service-startup
Nov 11, 2026
Merged

freeqaz-openai merged 1 commit into
mainfrom
refactor/share-credential-service-startup

Conversation

@freeqaz-openai

Copy link
Copy Markdown
Collaborator

Problem

The prepared-registry and development-token paths each read and validate TLS files during startup. Duplicating that sequence makes it easier for validation and cleanup to drift between backends.

Change

Use one sequence inside the configuration loader for TLS reads, validation, and common options. Each backend keeps its existing input checks and reads in the same order before TLS setup.

Verification

  • Local workspace checks, type checking, lint, formatting, and build passed. All 16 maintained configuration and projected-input tests and all 12 emitted-package tests passed, with zero skips.
  • Four paired local cases exercised the actual configuration loader and protected-file reader, with instrumentation for file descriptors and buffers. The source hook served the expected source once per variant. Before and after outcomes matched for a missing key and for successful startup followed by close in each backend.
  • Hosted checks are pending.

Risks

  • In both paths, the loader still takes ownership of each TLS buffer as soon as it reads it. A missing key still wipes the acquired certificate buffer, and normal close still wipes both original TLS buffers.

@clawsweeper

clawsweeper Bot commented Nov 11, 2026 •

Copy link
Copy Markdown
Contributor

🦞👀
ClawSweeper picked this up.

Pull request received. I will update this pull request when review starts.

ClawSweeper review complete

ClawSweeper finished reviewing this revision. The review result is being finalized.

View the workflow run.

@clawsweeper clawsweeper Bot added P3 Low-risk cleanup, docs, polish, ergonomics, or speculative feature. rating: 🦐 gold shrimp Decent PR readiness signal, but merge confidence is limited. status: 👀 ready for maintainer look ClawSweeper has no concrete contributor-facing blocker left for this PR. labels Nov 11, 2026
@clawsweeper

clawsweeper Bot commented Nov 11, 2026

Copy link
Copy Markdown
Contributor

Codex review: needs maintainer review before merge.

What this changes

This PR shares TLS loading, validation, and factory options between the prepared-registry and development-token startup paths.

Review scores

Measure Result What it means
Overall readiness 🦐 gold shrimp (3/6) A focused, apparently correct refactor supported by source inspection and reported local validation.
Proof confidence 🦐 gold shrimp (3/6) This maintainer-authored refactor is outside the ordinary contributor proof gate and changes no authority boundary; the body reports local loader instrumentation rather than supplying shipped-runtime output, and no target code was executed during review.
Patch quality 🦞 diamond lobster (5/6) No actionable review findings were identified.

Product

Kind: Refactor · Worth it: Yes · Fix scope: Complete
Reason: The maintainer-authored change consolidates security-sensitive startup mechanics within their existing owner while preserving both supported backend paths.

Merge readiness

✅ Ready for maintainer review

Keep open for maintainer triage: this focused refactor preserves startup validation and buffer cleanup, with no introduced defect found.

Priority: P3
Reviewed head: 5c232be6e42cb123b9d94f6f35c0bc00355f961d

Before merge

None.

Findings

None.

Agent review details

How this fits together

The controller’s credential-service composition reads protected operator configuration and TLS files, constructs the selected repository factory, and supplies TLS material to the service listeners while retaining cleanup ownership.

flowchart TD
  A[Protected configuration] --> B[Backend validation]
  B --> C[Shared TLS loading]
  C --> D[Repository factory]
  C --> E[Service listeners]
  D --> E
  E --> F[Shutdown and buffer cleanup]
Loading

Technical review

Best possible solution:

Retain the shared startup sequence and its existing immediate buffer ownership and cleanup semantics.

Do we have a high-confidence way to reproduce the issue?

No user-visible bug is claimed; source inspection confirms the duplicated TLS sequences on current main.

Is this the best way to solve the issue?

The local extraction uses the existing configuration owner and preserves validation order, TLS settings, factory inputs, and cleanup without introducing another runtime layer.

AGENTS.md: found and applied where relevant.

Codex review notes: model internal, reasoning medium; reviewed against 7fa7a37738bb.

Provenance checked

  • Backend-specific validation and factory construction keeps the original intent (09a17c8: Construct each factory in the branch validating its backend while retaining authority modes and TLS cleanup, as recorded in Simplify repository credential backend selection #4589.)
  • Owned TLS material and disposal keeps the original intent (10fc818: The original credential core established bounded credential custody and configuration ownership; history traces TLS disposal through the former startup path and its later composition move.)

Testing

Proof path: in-process harness.

Security

None.

Evidence

What I checked:

Likely related people:

  • Free Wortley: Raw commit 09a17c8 adds apps/controller/src/composition/repository-credentials/config.ts:141 relative to its recorded parents. This identifies author metadata, not feature responsibility or a PR merger. (role: source-line author; confidence: high; commits: 09a17c8f7521; files: apps/controller/src/composition/repository-credentials/config.ts)

Preflight source

Source unknown. Source comparison at the observed PR snapshot only. Completion is self-reported; body, policy, tests, execution, and report bytes are not verified.

Labels

Label changes:

  • add P3: This is bounded maintenance that reduces duplicated startup logic without changing supported behavior.
  • add rating: 🦐 gold shrimp: Overall readiness is 🦐 gold shrimp; proof is 🦐 gold shrimp and patch quality is 🦞 diamond lobster.
  • add status: 👀 ready for maintainer look: ClawSweeper has no concrete contributor-facing blocker left for this PR.

Label justifications:

  • P3: This is bounded maintenance that reduces duplicated startup logic without changing supported behavior.
  • rating: 🦐 gold shrimp: Overall readiness is 🦐 gold shrimp; proof is 🦐 gold shrimp and patch quality is 🦞 diamond lobster.
  • status: 👀 ready for maintainer look: ClawSweeper has no concrete contributor-facing blocker left for this PR.

Rating scale

6/6 🦀 challenger crab · 5/6 🦞 diamond lobster · 4/6 🐚 platinum hermit · 3/6 🦐 gold shrimp · 2/6 🦪 silver shellfish · 1/6 🧂 unranked krab. Overall follows the weaker of proof and patch quality; ✨ marks media proof (a screenshot, video, or linked artifact) that directly shows the changed behavior.

Workflow

ClawSweeper edits this one comment on every review. Comment @clawsweeper re-review for a fresh review only. Repair and merge execution lanes are retired.

Reviewed November 11, 2026, 2:55 AM ET / 07:55 UTC.

@freeqaz-openai
freeqaz-openai marked this pull request as ready for review November 11, 2026 07:59
@freeqaz-openai
freeqaz-openai requested a review from a team as a code owner November 11, 2026 07:59
@freeqaz-openai
freeqaz-openai merged commit b30d3de into main Nov 11, 2026
66 checks passed
@freeqaz-openai
freeqaz-openai deleted the refactor/share-credential-service-startup branch November 11, 2026 08:01
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

P3 Low-risk cleanup, docs, polish, ergonomics, or speculative feature. rating: 🦐 gold shrimp Decent PR readiness signal, but merge confidence is limited. status: 👀 ready for maintainer look ClawSweeper has no concrete contributor-facing blocker left for this PR.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant