Skip to content

[DDD] Replace direct runtime env reads with a bounded configuration registry #139

Description

@seonghobae

Problem and bounded context

Wardnet must capture non-secret process/bootstrap settings once, validate them at the delivery edge, and expose one immutable runtime snapshot to application/domain code. Runtime Configuration is a Supporting Subdomain. Process environment may remain an outer bootstrap transport, while CredentialRegistry remains authoritative for secret-bearing credential bootstrap. Runtime Configuration must not become a generic catch-all, secret store, or cross-service configuration database.

Protected/default truth is main@5829a0f08d78de464dd24393ce5d0f25fba9d126 through #159.

Current owning candidate — 2026-09-05

PR #140, refactor(config): centralize runtime bootstrap snapshot, is the canonical owning candidate at exact 054c11aafe835e497d6149efb09f1ccdee9d03bd on exact protected main@5829a0f08d78de464dd24393ce5d0f25fba9d126. GitHub reports it Ready and mergeable. Fresh compare keeps protected main as the merge base with no behind commits. The branch integrated protected #159 non-destructively and retains the Runtime Configuration/Credential Registry boundary rather than duplicating protected workflow ownership.

The candidate:

  • adds src/runtime_config.rs as the non-secret bootstrap adapter;
  • loads one immutable RuntimeConfiguration before listener startup;
  • derives application configuration from that snapshot plus CredentialRegistry;
  • keeps secret environment/file bootstrap behind CredentialRegistry;
  • recursively rejects new std::env::{var,var_os} reads outside designated Runtime Configuration/Credential Registry bootstrap adapters;
  • documents Runtime Configuration as supporting/delivery architecture rather than domain authority;
  • retains the deterministic lookup/test seam and standard-library temporary-directory repair, avoiding process-global environment races and undeclared test dependencies.

All current review threads are resolved. Three early Devin findings are outdated after their repairs; the credential-path thread is resolved and remains non-outdated because the causal fix removed WAF_IDS_CREDENTIALS_PATH from non-secret Runtime Configuration rather than creating duplicate path authority. The later public-API/documentation finding was repaired by the current docs/rustdoc increment. Resolved automated review is finding evidence, not independent human approval.

Latest hostile RED → causal GREEN

A fresh boundary review found that the positive integer bootstrap parser admitted zero for settings whose zero value is not a valid runtime bound.

  • hostile RED 0f22aaffcf1db5f54190497f9fece5969cd89441 adds fail-closed regressions for RATE_LIMIT_WINDOW=0 and MAX_BODY_BYTES=0;
  • causal GREEN d28a0119d4708b535dc04763dd51a11c835dba45 makes the positive-u64 bootstrap parser reject zero;
  • current exact 054c11aafe835e497d6149efb09f1ccdee9d03bd is a linear child whose sole intervening commit, docs: raise runtime bootstrap doc coverage, changes rustdoc/documentation only and does not alter runtime authority or runner behavior;
  • the distinct, intentional RATE_LIMIT=0 disable semantic remains unchanged rather than being conflated with positive-bound settings.

No predecessor workflow/review conclusion transfers to the current exact head.

Current exact-head evidence

Exact 054c11aafe835e497d6149efb09f1ccdee9d03bd remains non-passing at hosted execution:

  • CI 33923492873 — queued; sole rust job 101186801054 is pre-checkout with steps=[], runner_id=0, empty runner identity, and explicit ubuntu-24.04;
  • Fuzz 33923492809 — pending;
  • Security Scan 33923492923 — queued;
  • SAST Semgrep 33923493032 — queued;
  • CodeQL PR 33923492956 — queued.

The exact candidate remains compatible with current protected main and mergeable at the PR graph layer. The current non-passing state is .github#712 runner/control-plane evidence, not ancestry breakage and not permission for no-op source churn or bypass. Fresh exact evidence is recorded on .github#712 comment 5547036615.

Live solo-maintainer governance also remains unreconciled: organization ruleset 18156473 still requires one generic approving review with no required reviewer/team and retains routine OrganizationAdmin/always bypass. .github#772 and current owner-plane PR .github#1644 own that repair; fresh Wardnet handoff is .github#772 comment 5547038262. Self/model approval and routine administrator bypass remain forbidden.

Required contract

  1. Inventory every runtime process-environment read and classify secret bootstrap, non-secret runtime configuration, build/test-only input and external-tool input separately.
  2. Build one immutable/versioned validated Runtime Configuration snapshot at the delivery/bootstrap boundary.
  3. Preserve or explicitly version defaults, blank/unset semantics, bounds, URL/path validation, precedence and fail-closed startup behavior.
  4. Move non-secret process settings behind the configuration port; no competing application/domain direct environment reads.
  5. Keep secrets under CredentialRegistry; do not merge secret and non-secret authority.
  6. Keep executable architecture fitness preventing provider/environment APIs from leaking inward.
  7. Maintain realistic RED→GREEN coverage for defaults, malformed/boundary values, precedence, version mismatch and startup denial.
  8. Keep architecture/ADR/runbook/threat model/gap baseline/CHANGELOG aligned with protected versus candidate maturity.
  9. Preserve standalone operation and modular-monolith discipline; no service split solely for DDD terminology.

Completion gate

Close only after #140 or a verified successor carrying every unique code/test/docs delta reaches protected main, the resulting protected tree satisfies architecture fitness, and one unchanged exact integration candidate has terminal current repository/security/coverage/package/SBOM/provenance/review/thread/governance evidence. No documentation-only closure, predecessor evidence reuse, self/model approval, no-op dispatch commit, routine bypass, force push, or gate weakening.

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions