Skip to content

Define the release capability policy for operations (1.1.3)#5

Open
leynos wants to merge 3 commits into
mainfrom
1-1-3-define-the-release-capability-policy-for-operations
Open

Define the release capability policy for operations (1.1.3)#5
leynos wants to merge 3 commits into
mainfrom
1-1-3-define-the-release-capability-policy-for-operations

Conversation

@leynos

@leynos leynos commented May 11, 2026

Copy link
Copy Markdown
Owner

Summary

This branch adds the pre-implementation ExecPlan for roadmap task (1.1.3), defining how the release capability policy for scriptable, engine-backed, stubbed, and unsupported operations should be implemented after approval. It exists to let reviewers approve the policy shape before runtime code changes land.

Roadmap task: (1.1.3)
ExecPlan: docs/execplans/1-1-3-define-the-release-capability-policy-for-operations.md

Review walkthrough

Validation

  • bun fmt: passed.
  • make generate: passed; regenerated inherited GraphQL resolver types needed by the current test suite.
  • make check-fmt: passed.
  • make lint: passed.
  • env -u FORCE_COLOR make test: passed, 113 tests, 0 failures, 2 snapshots.
  • make markdownlint: passed.
  • coderabbit review --agent: run three times. Valid prose findings were addressed; remaining automated -ise spelling suggestions were left unapplied because this repository uses en-GB-oxendict -ize forms.

Notes

This is a draft pre-implementation pull request. It does not mark roadmap task (1.1.3) as done because the roadmap success criteria require generated docs and 501 Not Implemented behaviour to be implemented after the plan is approved.

Add the pre-implementation ExecPlan for roadmap task 1.1.3 so the
capability policy can be reviewed before code changes land.

Record the approval gate, implementation milestones, validation gates,
CodeRabbit expectations, and research inputs for the future feature work.

@sourcery-ai sourcery-ai Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Sorry @leynos, you have reached your weekly rate limit of 2500000 diff characters.

Please try again later or upgrade to continue using Sourcery

@coderabbitai

coderabbitai Bot commented May 11, 2026

Copy link
Copy Markdown

Review Change Stack

Pre-implementation ExecPlan for release capability policy (task 1.1.3)

This pull request introduces a new ExecPlan document (docs/execplans/1-1-3-define-the-release-capability-policy-for-operations.md) that defines the strategy for assigning release capability classifications—scriptable, engine-backed, stubbed, or unsupported—to all DigitalOcean /v2 operations. The plan is currently in draft status and explicitly pre-implementation: it authorises the planning phase only and requires explicit user approval before work proceeds to execution.

ExecPlan scope and constraints

The ExecPlan establishes six key constraints grounded in existing architectural decisions:

  • Keep Simulacrum as the HTTP and routing backplane (ADR 0001)
  • Preserve the pinned DigitalOcean OpenAPI contract as the source of truth (ADR 0002)
  • Optimise for the Nile Valley DOKS path, not broad DigitalOcean emulation (ADRs 0003 and 0006)
  • Enforce hexagonal boundaries: policy logic at the application boundary; HTTP handlers and response writers as adapters
  • Default unsupported operations to return a DigitalOcean-shaped 501 Not Implemented response
  • Prevent engine side effects in public handlers

The plan includes detailed tolerances (scope, file count, lines, dependencies, API stability) and risk mitigations addressing OpenAPI pin availability, policy–handler coupling, ambiguous operation classifications, and invariant validation strategy.

Supporting infrastructure changes

The PR also delivers foundational work needed to execute the plan:

  • OpenAPI artefact pinning (roadmap task 1.3.1, now marked complete): adds a Bun/TypeScript script (scripts/refresh-digitalocean-openapi.ts) that fetches and pins the DigitalOcean OpenAPI v2 contract with provenance metadata (src/openapi/digitalocean.openapi.provenance.json) recording source URL, upstream commit, fetch timestamp, byte length, SHA-256 hash, and redaction notes
  • Security remediation: pins fast-uri to version 3.1.2 via a package.json override to address two high-severity vulnerabilities (GHSA-q3j6-qgpj-74h6 and GHSA-v39h-62p7-jpjc)
  • Documentation updates: clarifies in the technical design, developers' guide, and new src/openapi/README.md how the pinned contract and capability policy fit into the DigitalPuddle architecture

Validation and next steps

The PR passed local validation gates (formatting, linting, tests, markdown checks). The ExecPlan is explicitly waiting for user approval before the execution phase begins; silence is not approval. The plan document guides implementers through staged execution: creating a pure capability policy registry, generating a capability matrix, wiring the unsupported response adapter, and updating documentation and roadmap records. Success is measured by every operation being classified exactly once, unsupported operations returning correct 501 responses, and the generated capability matrix remaining synchronised with runtime dispatch.

Walkthrough

The PR establishes automated management of the pinned DigitalOcean OpenAPI contract through a Bun refresh script with provenance tracking, whilst introducing comprehensive planning documentation for the release capability policy feature. The refresh script validates upstream responses, redacts secrets, and records source metadata; supporting docs guide developers through the refresh process and design implications.

Changes

OpenAPI Artefact Pinning and Refresh Infrastructure

Layer / File(s) Summary
Refresh script and fetch validation
scripts/refresh-digitalocean-openapi.ts, package.json
Bun/TypeScript script fetches upstream OpenAPI YAML with header validation via zod, redacts Slack webhook examples, computes SHA-256 hashes, and resolves upstream commit metadata. Includes 30-second timeout enforcement. Adds fast-uri dependency override.
Provenance metadata and documentation
src/openapi/digitalocean.openapi.provenance.json, src/openapi/README.md, docs/developers-guide.md, docs/digitalpuddle-technical-design.md, docs/roadmap.md
Records source URL, upstream commit, fetch timestamp, content hash, byte length, redaction configuration, and response headers in JSON. Updates technical and developer guides with refresh process and compatibility review expectations. Marks roadmap task 1.3.1 complete with provenance reference.

Release Capability Policy ExecPlan

Layer / File(s) Summary
Complete ExecPlan for release capability policy
docs/execplans/1-1-3-define-the-release-capability-policy-for-operations.md
Comprehensive draft planning document establishing approval gates, architectural constraints (hexagonal separation, fail-closed defaults, 501 envelope shape, adapter-only side effects), risk mitigations, and structured implementation stages from ADR creation through capability policy module creation and documentation updates. Includes concrete command sequences, validation and acceptance criteria, idempotence guidance, and external research references.

Possibly related PRs

  • leynos/corbusier#79: Updates fast-uri dependency override (also touched in this PR's package.json changes), though addresses a separate concern of audit-gate readiness rather than OpenAPI provenance.

Suggested labels

Roadmap, Documentation, Tooling

Poem

📋 A script that fetches, hashes, and stores,
With provenance notes on every door,
And planning maps for what's to come—
One artefact pinned, one roadmap begun! 🚀


Caution

Pre-merge checks failed

Please resolve all errors before merging. Addressing warnings is optional.

  • Ignore

❌ Failed checks (1 error, 3 warnings)

Check name Status Explanation Resolution
Unit Architecture ❌ Error Module-level procedural code mixes queries/commands, lacks error handling, embeds wall-clock time and hard-coded dependencies without abstraction, has no tests separating read paths from mutations. Wrap code in async main function; inject dependencies; abstract time; extract pure transforms from I/O; add try-catch at boundaries; add unit tests proving query/command separation.
Testing (Unit And Behavioural) ⚠️ Warning The refresh-digitalocean-openapi.ts script performs network I/O, executes git commands, and writes files. Per the check, end-to-end tests are required for such functionality. No tests were added. Add test file tests/openapi/refresh-digitalocean-openapi.test.ts with mocked network/git calls, covering success paths, error handling, webhook redaction, and provenance JSON output.
Testing (Compile-Time / Ui) ⚠️ Warning The PR adds executable TypeScript script (refresh-digitalocean-openapi.ts) with UI-adjacent console.log output and structured JSON/YAML generation but includes no snapshot tests for these outputs. Add snapshot test for the refresh script's console output and provenance JSON structure, with explicit redaction of non-deterministic fields (fetchedAt timestamp, dynamic upstreamCommit, sha256 hash).
Concurrency And State ⚠️ Warning Refresh script lacks explicit concurrency safeguards. Multiple concurrent executions would corrupt output files via interleaved writes. Document that the refresh script must run serially. Add lock file check at startup to fail-fast on concurrent execution attempts.
✅ Passed checks (14 passed)
Check name Status Explanation
Title check ✅ Passed The title clearly captures the main change—defining the release capability policy for operations—and includes the required roadmap reference (1.1.3).
Description check ✅ Passed The description comprehensively covers the PR's purpose, the ExecPlan document, review guidance, validation steps, and explicitly notes this is pre-implementation. It directly relates to the changeset across all affected files.
Docstring Coverage ✅ Passed Docstring coverage is 100.00% which is sufficient. The required threshold is 80.00%.
Linked Issues check ✅ Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check ✅ Passed Check skipped because no linked issues were found for this pull request.
Testing (Overall) ✅ Passed Pre-implementation PR adds only documentation and utility scripts; no substantive behaviour changes. ExecPlan shows all implementation items unchecked. Testing applies post-implementation.
User-Facing Documentation ✅ Passed Pre-implementation PR adding no new user-facing functionality. Pinned OpenAPI artefact fulfils already-promised feature, not new behaviour.
Developer Documentation ✅ Passed All documentation requirements met: ExecPlan created, developers-guide updated with refresh script, technical-design describes provenance, roadmap correctly reflects task status.
Module-Level Documentation ✅ Passed The single code module added (scripts/refresh-digitalocean-openapi.ts) carries comprehensive JSDoc documentation explaining purpose, utility, functions, and relationships to other components.
Testing (Property / Proof) ✅ Passed The ExecPlan already specifies property testing (fast-check) for registry invariants and LemmaScript proofs only for substantive axioms, with explicit guidance against ceremonial testing.
Domain Architecture ✅ Passed PR introduces documentation, ExecPlan, tooling scripts, and metadata only—no domain code. ExecPlan explicitly mandates hexagonal boundaries and pure policy separation.
Observability ✅ Passed Script is a manual maintenance utility, not a runtime service. Provides success logging and throws errors for failure cases appropriately.
Security And Privacy ✅ Passed PR contains no secrets or credentials. Refresh script redacts webhook examples, validates all inputs safely, and logs only metadata. Fast-uri override addresses real vulnerabilities.
Performance And Resource Use ✅ Passed The refresh script is a maintenance utility (manually invoked), performs bounded operations on ~3MB OpenAPI spec with acceptable memory patterns and explicit 30-second timeout.
✨ Finishing Touches
📝 Generate docstrings
  • Create stacked PR
  • Commit on current branch
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch 1-1-3-define-the-release-capability-policy-for-operations

Warning

There were issues while running some tools. Please review the errors and either fix the tool's configuration or disable the tool if it's a critical failure.

🔧 ESLint

If the error stems from missing dependencies, add them to the package.json file. For unrecoverable errors (e.g., due to private dependencies), disable the tool in the CodeRabbit configuration.

ESLint skipped: no ESLint configuration detected in root package.json. To enable, add eslint to devDependencies.


Comment @coderabbitai help to get the list of available commands and usage tips.

@leynos

leynos commented May 14, 2026

Copy link
Copy Markdown
Owner Author

@coderabbitai Please suggest a fix for this audit violation and supply a prompt for an AI coding agent to enable it to apply the fix.

Run bun audit
bun audit v1.3.11 (af24e281)
fast-uri  <=3.1.1
  @simulacrum/foundation-simulator › openapi-backend › ajv › fast-uri
  high: fast-uri vulnerable to host confusion via percent-encoded authority delimiters - https://github.com/advisories/GHSA-v39h-62p7-jpjc
  high: fast-uri vulnerable to path traversal via percent-encoded dot segments - https://github.com/advisories/GHSA-q3j6-qgpj-74h6

2 vulnerabilities (2 high)

To update all dependencies to the latest compatible versions:
  bun update

To update all dependencies to the latest versions (including breaking changes):
  bun update --latest

Error: Process completed with exit code 1.

@coderabbitai

This comment was marked as resolved.

leynos added 2 commits May 14, 2026 11:42
Force transitive `fast-uri` consumers onto 3.1.2 to remediate
GHSA-v39h-62p7-jpjc / CVE-2026-6321 while preserving the existing direct
production and development dependency declarations.

Refresh `bun.lock` with `bun install` so the override is applied
consistently across the dependency graph.
Check in the bundled DigitalOcean public API v2 OpenAPI contract
with provenance that records the upstream source, commit, refresh
command, response metadata, byte length, and SHA-256 hash.

Add a Bun refresh script so future compatibility updates can reproduce
the pin deliberately, and mark roadmap task 1.3.1 done.
@lodyai
lodyai Bot force-pushed the 1-1-3-define-the-release-capability-policy-for-operations branch from 557b879 to 30ff6ad Compare May 14, 2026 21:45
@leynos
leynos marked this pull request as ready for review May 21, 2026 08:52

@sourcery-ai sourcery-ai Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Sorry @leynos, your pull request is larger than the review limit of 500000 diff characters

@coderabbitai coderabbitai Bot added the Roadmap label May 21, 2026

@coderabbitai coderabbitai Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actionable comments posted: 2

🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

Inline comments:
In `@docs/execplans/1-1-3-define-the-release-capability-policy-for-operations.md`:
- Line 82: Update each occurrence of the phrase "if implementation" to "if the
implementation" to improve grammar and clarity; specifically search for the
exact token sequence "if implementation" in the document (e.g., the instances at
the current mentions around lines where "File count: if implementation needs to
modify more than twelve tracked files" appears) and insert the definite article
"the" immediately before "implementation" in all such occurrences.
- Line 144: Replace all American spellings of "normalized" and "normalization"
with en-GB-oxendict spellings "normalised" and "normalisation" throughout the
document; specifically search for the tokens "normalized" and "normalization"
(including plural/inflected forms) and update them in each occurrence (notably
the instances flagged in the review), ensuring consistency and leaving
surrounding punctuation/formatting unchanged.
🪄 Autofix (Beta)

Fix all unresolved CodeRabbit comments on this PR:

  • Push a commit to this branch (recommended)
  • Create a new PR with the fixes

ℹ️ Review info
⚙️ Run configuration

Configuration used: Organization UI

Review profile: ASSERTIVE

Plan: Pro Plus

Run ID: 6e555fcf-fb56-4833-93e0-c6b3051c8017

📥 Commits

Reviewing files that changed from the base of the PR and between ad4c78f and 30ff6ad.

⛔ Files ignored due to path filters (1)
  • bun.lock is excluded by !**/*.lock
📒 Files selected for processing (9)
  • docs/developers-guide.md
  • docs/digitalpuddle-technical-design.md
  • docs/execplans/1-1-3-define-the-release-capability-policy-for-operations.md
  • docs/roadmap.md
  • package.json
  • scripts/refresh-digitalocean-openapi.ts
  • src/openapi/README.md
  • src/openapi/digitalocean.openapi.provenance.json
  • src/openapi/digitalocean.openapi.yaml

- Scope: if implementation requires a broad source-layout migration beyond
`src/openapi`, narrowly needed route assembly seams, tests, and documentation,
stop and ask for approval.
- File count: if implementation needs to modify more than twelve tracked files

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🧹 Nitpick | 🔵 Trivial | 💤 Low value

Add definite articles before "implementation" for clarity.

Lines 82, 381, and 607 use "if implementation" as a mass noun. Add "the" before "implementation" to improve readability.

Triage: [type:grammar]

Proposed changes

Line 82:

-- Scope: if implementation requires a broad source-layout migration beyond
+- Scope: if the implementation requires a broad source-layout migration beyond

Line 381:

-Keep this API small. If implementation needs more fields, document why in the
+Keep this API small. If the implementation needs more fields, document why in the

Line 607:

-- A LemmaScript proof is added only if implementation introduces an axiom or
+- A LemmaScript proof is added only if the implementation introduces an axiom or

Also applies to: 381-381, 607-607

🧰 Tools
🪛 LanguageTool

[uncategorized] ~82-~82: Possible missing article found.
Context: ... and ask for approval. - File count: if implementation needs to modify more than twelve tracke...

(AI_HYDRA_LEO_MISSING_THE)

🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In `@docs/execplans/1-1-3-define-the-release-capability-policy-for-operations.md`
at line 82, Update each occurrence of the phrase "if implementation" to "if the
implementation" to improve grammar and clarity; specifically search for the
exact token sequence "if implementation" in the document (e.g., the instances at
the current mentions around lines where "File count: if implementation needs to
modify more than twelve tracked files" appears) and insert the definite article
"the" immediately before "implementation" in all such occurrences.

spec evolution.
Severity: medium.
Likelihood: medium.
Mitigation: key registry records by method and normalized path, treat

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

⚠️ Potential issue | 🟡 Minor | ⚡ Quick win

Change "normalized" to "normalised" throughout.

The document uses American spelling "normalized" and "normalization" in multiple locations. Change all instances to "normalised" and "normalisation" to comply with en-GB-oxendict spelling requirements.

Triage: [type:spelling]

Proposed corrections

Line 144:

-  Mitigation: key registry records by method and normalized path, treat
+  Mitigation: key registry records by method and normalised path, treat

Line 244:

-  normalized OpenAPI path, with `operationId` as a lookup alias.
+  normalised OpenAPI path, with `operationId` as a lookup alias.

Line 367:

-The module should accept normalized operation metadata rather than reading
+The module should accept normalised operation metadata rather than reading

Line 387:

-- path normalization without losing OpenAPI path parameters;
+- path normalisation without losing OpenAPI path parameters;

Line 593:

-  exactly once by method and normalized path.
+  exactly once by method and normalised path.

As per coding guidelines: "Use en-GB-oxendict (-ize / -yse / -our) spelling and grammar (examples: 'recognize,' 'synthesized,' 'polymerization,' 'analyse,' 'colour,' 'behaviour')." The word "normalise" takes the -ise suffix in this spelling system.

Also applies to: 244-244, 367-367, 387-387, 593-593

🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In `@docs/execplans/1-1-3-define-the-release-capability-policy-for-operations.md`
at line 144, Replace all American spellings of "normalized" and "normalization"
with en-GB-oxendict spellings "normalised" and "normalisation" throughout the
document; specifically search for the tokens "normalized" and "normalization"
(including plural/inflected forms) and update them in each occurrence (notably
the instances flagged in the review), ensuring consistency and leaving
surrounding punctuation/formatting unchanged.

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

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant