Repository navigation
📝 docs(sync): correct openapi/example/site drift from audit pass 2 - #59
Conversation
Second correctness + completeness pass over the surfaces pass 1 (#58) did not diff field-by-field. 25 verified findings, fixed across docs, deployment examples, the OpenAPI contract, and fuzz coverage. - 📝 docs(openapi): document the GET /_portwing/audit and POST /_portwing/mcp agent endpoints, GET /api/watchers/{type}/{name}, GET /api/log/entries, the dd:watcher-snapshot SSE event, the timestamps log query param, DELETE 404/409 responses, and the ContainerResult/ContainerError digest/link/ timestamp fields; bump info.version and example version strings to 0.6.0 - 🐛 fix(k8s): mount the DaemonSet Compose stacks dir as hostPath instead of emptyDir so stack state survives pod recreation (emptyDir wiped it, breaking down/ps/stop/restart/logs); add the missing `> portwing_ed25519.pem` redirect to the edge keygen setup step, and document the supplementalGroups socket-GID prerequisite in examples/README.md - 📝 docs(site): fix the GET /_portwing/audit response example (ts, no level/msg), the portwing_auth_failures_total reason labels, the generic adapter capabilities list, the audit key_id sample, the core-fields table, and stale 0.1.0/0.3.0 version examples across the audit-logging, observability, standalone-mode, and api-reference pages - 🧪 test(fuzz): wire FuzzEnvelope (internal/protocol; the portwing/1.0 parser on the untrusted edge-WS input path) into the ci.yml smoke tier, the nightly and monthly deep-fuzz matrices, the lefthook pre-push hook, and CONTRIBUTING - 📝 docs(process): describe the actual trunk-based flow in CONTRIBUTING (no dev/* branch), correct the RELEASING/release-cut BREAKING-CHANGE major-bump claim (subjects only), fix the Dockerfile.armv7 comment, and split SPEC's image package list into its Wolfi and Alpine variants
📝 WalkthroughWalkthroughThe OpenAPI specification adds audit and MCP schemas and endpoints, extends response metadata, and documents additional compatibility operations. Related API, audit, observability, and standalone-mode documentation is synchronized. FuzzEnvelope is added to local, continuous, nightly, and monthly fuzzing. Contribution and release guidance now reflects trunk-based development and current version rules. Docker image documentation and Kubernetes examples are updated for architecture-specific packages, persistent stack storage, and key generation. 🚥 Pre-merge checks | ✅ 2✅ Passed checks (2 passed)
✨ Finishing Touches🧪 Generate unit tests (beta)
Comment |
There was a problem hiding this comment.
Actionable comments posted: 2
Caution
Some comments are outside the diff and can’t be posted inline due to platform limitations.
⚠️ Outside diff range comments (3)
.github/workflows/ci.yml (1)
392-406: 📐 Maintainability & Code Quality | 🟡 Minor | ⚡ Quick winStale count in harden-runner comment.
Matrix now has 6 fuzzer variants but comment at line 398 still says "5".
diff
- # One allowlist shared by all 5 matrix variants (harden-runner config + # One allowlist shared by all 6 matrix variants (harden-runner config🤖 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 @.github/workflows/ci.yml around lines 392 - 406, Update the harden-runner comment near the egress policy to state that the allowlist is shared by all 6 matrix variants instead of 5..github/workflows/release-cut.yml (1)
100-112: 🎯 Functional Correctness | 🟡 Minor | ⚡ Quick winTighten the major-bump regex in
.github/workflows/release-cut.yml.^.+!\s*:matches!anywhere before a later:, sofix: embed !: in quoted textcan bump major. Match the prefix only, e.g.grep -qP '^[^:]+!:'.🤖 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 @.github/workflows/release-cut.yml around lines 100 - 112, Update the major-bump check in the commit-subject loop to use a regex that only matches an exclamation mark in the conventional-commit prefix before the first colon, such as `^[^:]+!:`; retain the existing major-bump behavior while preventing later punctuation in the subject from triggering it.docs/content/docs/api-reference.mdx (1)
56-68: 🗄️ Data Integrity & Integration | 🟠 Major | ⚡ Quick winStale capabilities example — out of sync with
api/openapi.yaml.
InfoResponse.capabilitiesinapi/openapi.yaml(line 158) was updated to["compose", "exec", "metrics", "events", "dd:watch", "dd:trigger", "dd:container-sync", "dd:logs"], but this doc still shows only the first six entries, missingdd:container-syncanddd:logs.Fix
"capabilities": ["compose", "exec", "metrics", "events", "dd:watch", "dd:trigger"] + "capabilities": ["compose", "exec", "metrics", "events", "dd:watch", "dd:trigger", "dd:container-sync", "dd:logs"]As per path instructions, docs should be reviewed for accuracy against the code (in this case, the OpenAPI spec).
🤖 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/content/docs/api-reference.mdx` around lines 56 - 68, Update the capabilities array in the GET /_portwing/info example to match InfoResponse.capabilities in api/openapi.yaml by adding "dd:container-sync" and "dd:logs" after the existing dd:trigger entry.Source: Path instructions
🧹 Nitpick comments (2)
examples/kubernetes/edge.yaml (1)
143-152: 🔒 Security & Privacy | 🔵 Trivial | 💤 Low valuehostPath for stacks is correct but widens the container's reach into the node's filesystem.
Switching from
emptyDirtohostPathis the right fix for restart persistence, and the comment correctly notesfsGroupdoesn't apply tohostPath. Two things worth a second look:
DirectoryOrCreatemeans kubelet will auto-create/var/lib/portwing/stacks(root-owned) if the operator skips the documentedinstall -dstep — the pod will then fail to write. That's already flagged in the comment, so acceptable as-is.- This grants the agent write access to an arbitrary path on the node's disk, in addition to the already-required Docker socket access. Given the agent already needs
docker-sockhostPath, this is a modest incremental widening, not a new class of risk — flagging for awareness only.🤖 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 `@examples/kubernetes/edge.yaml` around lines 143 - 152, The hostPath change is acceptable as-is; retain the stacks volume configuration and its documentation. No code changes are required, but ensure deployment guidance clearly instructs operators to pre-create /var/lib/portwing/stacks with ownership for the non-root container UID before starting the pod.api/openapi.yaml (1)
502-539: 🗄️ Data Integrity & Integration | 🔵 Trivial | ⚖️ Poor tradeoffMCPResponse doesn't enforce result/error exclusivity.
resultanderrorare both plain optional object properties; nothing models the JSON-RPC "exactly one of result or error" contract. ConsideroneOfwithrequiredper branch.🤖 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 `@api/openapi.yaml` around lines 502 - 539, Update the MCPResponse schema to enforce exactly one of result or error using oneOf branches, with one branch requiring result and the other requiring error. Preserve the shared jsonrpc and id fields while ensuring each response cannot contain both or neither property.
🤖 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 `@api/openapi.yaml`:
- Around line 757-765: Update the limit query parameter schema in the OpenAPI
definition to match the documented API behavior: remove the minimum: 1
constraint so zero and negative integer values are accepted, while retaining the
existing description and example.
In `@docs/content/docs/standalone-mode.mdx`:
- Line 168: Deduplicate capabilities returned by handleInfo before encoding the
response. Update the capability aggregation around handleInfo to filter repeated
values, including events already present in the base capabilities and generic
adapter capabilities, while preserving the existing order.
---
Outside diff comments:
In @.github/workflows/ci.yml:
- Around line 392-406: Update the harden-runner comment near the egress policy
to state that the allowlist is shared by all 6 matrix variants instead of 5.
In @.github/workflows/release-cut.yml:
- Around line 100-112: Update the major-bump check in the commit-subject loop to
use a regex that only matches an exclamation mark in the conventional-commit
prefix before the first colon, such as `^[^:]+!:`; retain the existing
major-bump behavior while preventing later punctuation in the subject from
triggering it.
In `@docs/content/docs/api-reference.mdx`:
- Around line 56-68: Update the capabilities array in the GET /_portwing/info
example to match InfoResponse.capabilities in api/openapi.yaml by adding
"dd:container-sync" and "dd:logs" after the existing dd:trigger entry.
---
Nitpick comments:
In `@api/openapi.yaml`:
- Around line 502-539: Update the MCPResponse schema to enforce exactly one of
result or error using oneOf branches, with one branch requiring result and the
other requiring error. Preserve the shared jsonrpc and id fields while ensuring
each response cannot contain both or neither property.
In `@examples/kubernetes/edge.yaml`:
- Around line 143-152: The hostPath change is acceptable as-is; retain the
stacks volume configuration and its documentation. No code changes are required,
but ensure deployment guidance clearly instructs operators to pre-create
/var/lib/portwing/stacks with ownership for the non-root container UID before
starting the pod.
🪄 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: Path: .coderabbit.yaml
Review profile: CHILL
Plan: Pro Plus
Run ID: 2a7b240e-b9a1-4cfe-8a07-d3861af212cc
⛔ Files ignored due to path filters (1)
CHANGELOG.mdis excluded by!CHANGELOG.md
📒 Files selected for processing (17)
.github/workflows/ci.yml.github/workflows/quality-fuzz-monthly.yml.github/workflows/quality-fuzz-nightly.yml.github/workflows/release-cut.ymlCONTRIBUTING.mdDockerfile.armv7RELEASING.mdSPEC.mdapi/openapi.yamldocs/content/docs/api-reference.mdxdocs/content/docs/audit-logging.mdxdocs/content/docs/observability.mdxdocs/content/docs/standalone-mode.mdxexamples/README.mdexamples/kubernetes/edge.yamlexamples/kubernetes/standard.yamllefthook.yml
- 🐛 fix(release-cut): match `!` only in the conventional-commit prefix (`^[^:]+!:`) so a stray `!:` later in a subject can't trigger a major bump - 🔧 config(openapi): drop `minimum: 1` on the /_portwing/audit `limit` param — the handler treats 0/negative as "return all", which the schema now permits - 📝 docs(api-reference): add dd:container-sync/dd:logs to the GET /_portwing/info capabilities example to match the OpenAPI InfoResponse - 🔧 config(ci): correct the harden-runner comment (6 fuzz matrix variants, not 5)
|
Addressed the review in 0143186. Applied:
Not doing here (with reasons):
|
There was a problem hiding this comment.
Actionable comments posted: 1
🤖 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 @.github/workflows/release-cut.yml:
- Around line 101-105: Restrict the major-bump check in the release workflow’s
commit-subject loop to valid Conventional Commit syntax: accept only recognized
types such as feat or fix, with an optional scope, followed by !:. Update the
regex used by the subject check and add coverage for feat!:, fix(api)!, and an
invalid free-form subject like urgent deployment!:.
🪄 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: Path: .coderabbit.yaml
Review profile: CHILL
Plan: Pro Plus
Run ID: 77d9485e-56a2-49d1-8723-a4ca17970800
📒 Files selected for processing (4)
.github/workflows/ci.yml.github/workflows/release-cut.ymlapi/openapi.yamldocs/content/docs/api-reference.mdx
💤 Files with no reviewable changes (1)
- api/openapi.yaml
✅ Files skipped from review due to trivial changes (1)
- docs/content/docs/api-reference.mdx
🚧 Files skipped from review as they are similar to previous changes (1)
- .github/workflows/ci.yml
ALARGECOMPANY
left a comment
There was a problem hiding this comment.
Pass-2 audit fixes reviewed. OpenAPI contract additions match the served routes, the k8s example fixes are correct (hostPath persistence + keygen redirect), FuzzEnvelope wiring is sound, and the CodeRabbit follow-ups are handled (regex over-tightening correctly declined — its suggestion breaks the emoji-prefixed commit convention). LGTM.
biggest-littlest
left a comment
There was a problem hiding this comment.
Second approval. Docs-site and process-doc corrections are accurate against the code, CI fuzz coverage gap closed, and verification (build/vet/actionlint/zizmor/qlty) is clean. LGTM.
What
Second correctness + completeness pass over the portwing surfaces that pass 1 (#58, merged) didn't diff field-by-field:
api/openapi.yaml, the Kubernetes/Compose examples, the audit/observability/standalone/api-reference docs pages, the Dockerfiles, and the release/CI process docs. A multi-agent audit surfaced 25 verified findings (find → adversarial verify → completeness critic); all are fixed here. Nothing contradicts pass 1 — the README/SPEC/security-model/website edge-auth and version claims still hold.Highlights (the ones that weren't just wording)
examples/kubernetes/{standard,edge}.yamlmounted the Compose stacks dir (/data/stacks) asemptyDir, which Kubernetes wipes on pod recreation — silently breakingdown/ps/stop/restart/logsfor every stack a priorupdeployed (the non-upcompose ops reuse the fileupwrote to disk). NowhostPath, with a note to pre-create it owned by UID 65532 sincefsGroupdoesn't apply tohostPath. The edge manifest'sportwing keygenstep was also missing its> portwing_ed25519.pemredirect, so thekubectl create secret --from-file=…that followed referenced a file that was never written.FuzzEnvelopewas in no fuzz tier. The wire-envelope fuzzer (internal/protocol) exercises theportwing/1.0parser on the untrusted edge-WebSocket input path — arguably the highest-value target in the tree — but was wired into none of ci/nightly/monthly/lefthook/CONTRIBUTING. Now in all five. (Ran 28M+ execs locally and in the pre-push smoke, no crashers.)OpenAPI contract gaps
api/openapi.yamlnow documents: theGET /_portwing/auditandPOST /_portwing/mcpagent endpoints (were entirely absent); a realGETop on/api/watchers/{type}/{name}(previously onlyPOST→501, but the GET is a live 200/404 lookup);GET /api/log/entries; thedd:watcher-snapshotSSE event; thetimestampslog query param;404/409onDELETE /api/containers/{id}; and thedigest/link/timestampContainerResult/ContainerErrorfields.info.versionand example version strings bumped to 0.6.0.Docs-site + process drift
audit-logging.mdx:GET /_portwing/auditresponse example now usests(nolevel/msg) to match the ring-buffer schema;key_idsample uses the real bare-hex format; the "core fields" table scopesmethod/pathto the events that actually emit them.observability.mdx:portwing_auth_failures_totalreason labels corrected to the real values (bad_token,no_credentials,timestamp-skew, …).standalone-mode.mdx: generic-adapter capabilities array corrected (base caps are always prepended;eventsappears twice).0.1.0/0.3.0example version strings →0.6.0across the docs site.CONTRIBUTING.md: describes the actual trunk-based flow (nodev/*branch).RELEASING.md+release-cut.yml: aBREAKING CHANGEfooter does not trigger a major bump (the workflow only reads commit subjects).Dockerfile.armv7: comment points at the real unifiedDockerfile.release.SPEC.md: image package list split into its accurate Wolfi/Alpine variants.Verification
go build ./...,go vet,actionlint,zizmor,qlty check(markdownlint/shellcheck) all clean.FuzzEnvelope.Still uncovered (candidate pass 3)
authentication.mdxanddrydock-integration.mdxwire-shape tables not diffed field-by-field;configuration.mdxenv-var table vsinternal/config;quality-mutation-monthly.ymlpackage matrix scope; soak-benchmark scenarios vs docs; security-scanning workflows vs README/SECURITY claims.Changelog
MCPtag)./api/eventsSSE example updates.FuzzEnvelopeas a new Go fuzz target across CI workflows (quality monthly/nightly),lefthookpre-push, and contributor guidance.0.6.0(agent/version/capabilities examples) and refreshed related docs pages (API reference, audit logging, observability, standalone mode).stacksvolume fromemptyDirtohostPath) and correcting edge key-generation instructions/redirect output and clarified key contents.minimum: 1from the auditlimitparameter schema (allow0/non-positive to mean “return all”).!:(tightened regex/logic; body/footer not read).SPEC.md, and release/cutting/tag wording).main) and aligned fuzz-testing instructions accordingly.Concerns
hostPathrequirements in all supported environments (pre-create directory with correct non-root UID/GID; ensure node filesystem permissions hold).!vsBREAKING CHANGEfooter and that the!:subject-only interpretation is correct end-to-end.