Skip to content

refactor(api): Align route slices and audit ownership - #217

Merged
yuanzui-cf merged 10 commits into
mainfrom
refactor/control-api-conventions
Sep 13, 2026
Merged

yuanzui-cf merged 10 commits into
mainfrom
refactor/control-api-conventions

Conversation

@yuanzui-cf

@yuanzui-cf yuanzui-cf commented Sep 13, 2026

Copy link
Copy Markdown
Member

Summary

Control API previously mixed multiple URL paths in feature files, reused controller modules as business utilities, and split audit persistence and logging across layers. Features now mirror the URL tree, with each endpoint owning its controllers and local request/response types and each parent composing its immediate child routers.

  • Preserve the existing 220 method/path contracts, authentication boundaries, body limits, Node wire contracts and preview protections across 177 endpoint owners.
  • Centralize audit writes, queries, retention, context, redaction and structured logs in infra/audit. Critical mutations share their audit transaction; success logs are emitted only after commit.
  • Give shared deployment, project, authentication, preview and host-binding capabilities named domain modules, with technical adapters in infrastructure.
  • Make PATCH clearing explicit: sending {"display_name":null} now clears the personal display name. Preserve database state representations and retain redacted diagnostic sources; distinguish region usage conflicts from infrastructure failures.
  • Keep complex response types endpoint-local, reorganize shared fixtures and HTTP regression tests, and inherit workspace dependencies, including X.509 parser 0.18.1.

Review entry points and lasting conventions are recorded in docs/agents/control-api-refactor-review.md, docs/agents/control-api-conventions.md and docs/agents/control-api-routes.md.

Validation

  • just quality passed before each commit: formatting, workspace Clippy, Rust tests, Console tests/checks, workspace checks/builds and license checks.
  • Control API: 523 passed, 32 ignored. Node: 134 passed, 2 ignored. Console: 239 passed across 63 files.
  • Targeted checks cover route ownership, Node wire fixtures, response contracts, nullable PATCH updates, audit commit/rollback/logging/redaction, certificate parsing and mock ACME issuance.
  • Route ownership inspection found 177 endpoint owners with no violations; git diff --check passed.
  • CI explicitly selects the 10 delivery and 6 Node deletion PostgreSQL tests against its existing disposable database, preserving their previous CI coverage after marking them ignored by default. Both test filters were verified with --ignored --list locally.
  • CI run 34761427615 passed on commit 51846430: Quality, Node delivery smoke and Release images. The selected PostgreSQL suites passed 10 + 6 tests, and both database schema checks passed.

Tracking

Parent: #207.

Closes #208
Closes #209
Closes #210
Closes #211
Closes #212
Closes #213
Closes #214
Closes #215

The TODO cleanup in #216 remains open until this implementation is merged; it then removes the complete temporary standardization group. The parent issue remains open until that cleanup is complete.

Known Limitations

No dedicated local PostgreSQL or Redis test environment was configured. Local ignored database/schema/Redis cases were compiled but not executed, and external-tool Node cases remain ignored locally. CI separately runs the selected PostgreSQL lifecycle suites, schema checks and Node delivery smoke test. Other ignored cases remain outside these checks. This change does not modify the database schema.

@yuanzui-cf yuanzui-cf added this to the 0.1.0 milestone Sep 13, 2026
@yuanzui-cf yuanzui-cf added the area: backend Control API and backend domain logic label Sep 13, 2026
@yuanzui-cf yuanzui-cf self-assigned this Sep 13, 2026
Explicitly run delivery and Node deletion suites against the disposable CI database now that environment-dependent tests are ignored by default.

Refs #214
@yuanzui-cf
yuanzui-cf merged commit 4d942e9 into main Sep 13, 2026
3 checks passed
@yuanzui-cf
yuanzui-cf deleted the refactor/control-api-conventions branch September 13, 2026 15:31
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment