docs+mocks: v4.0.1 follow-ups from PR #1 review closure (Taiga #199) - #12
docs+mocks: v4.0.1 follow-ups from PR #1 review closure (Taiga #199)#12t0kubetsu wants to merge 3 commits into
Conversation
…ly 500 - api-design §2.4 and data-model §8.1 now describe the computed `trend` (`TrendDirection`), previously present only in the contract and core/enums.py (review A4 residual, Taiga #199). - `GET /statements` no longer declares a 500: the global fallback handler answers problem+json everywhere, and no artifact explained why this one operation advertised a special failure mode (review A19, Taiga #199).
- Revoked-feed sample: `revoked_at` now falls after `last_used_at` instead
of preceding it by two months.
- Cancel sample: `POST /scans/{id}/cancel` returns a `canceled` job with a
cancellation `status_reason`; `canceled` appeared in no other sample.
- Verification challenge sample: requested recently enough that its answer
window is still open at the recorded recheck, so a `pending` verification
no longer carries an unanswerable challenge.
|
No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info⚙️ Run configurationConfiguration used: Organization UI Review profile: ASSERTIVE Plan: Pro Plus Run ID: 📒 Files selected for processing (1)
📝 WalkthroughWalkthroughThe change updates statement API error documentation, documents the computed ChangesResponse examples
Scan result trend documentation
Statements API contract
Estimated code review effort: 2 (Simple) | ~10 minutes Suggested reviewers: 🚥 Pre-merge checks | ✅ 5✅ Passed checks (5 passed)
✨ Finishing Touches📝 Generate docstrings
🧪 Generate unit tests (beta)
Comment |
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 `@src/nc3_testing_platform/domains/assets/examples.py`:
- Around line 35-37: The example configuration must ensure the challenge remains
answerable through the _T1 recheck. Add an assertion near
_CHALLENGE_REQUESTED_AT that the computed token expiration, token_expires_at, is
later than _T1, while preserving the existing TTL behavior.
🪄 Autofix
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: 9c29e532-a088-4fe3-99b2-e8cb386d9cf1
📒 Files selected for processing (8)
api/openapi.jsondocs/reference/api-design-v4_0_1.mddocs/reference/data-model-v4_0_1.mdsrc/nc3_testing_platform/domains/assets/examples.pysrc/nc3_testing_platform/domains/assets/router.pysrc/nc3_testing_platform/domains/scans/examples.pysrc/nc3_testing_platform/domains/scans/router.pysrc/nc3_testing_platform/domains/statements/router.py
💤 Files with no reviewable changes (2)
- api/openapi.json
- src/nc3_testing_platform/domains/statements/router.py
VERIFICATION_TOKEN_TTL is env-configurable; a short TTL would silently recreate the pending-with-unanswerable-challenge incoherence this branch fixes. The invariant now fails at import instead (CodeRabbit round 1).
|
@coderabbitai review |
|
|
@coderabbitai review |
|
t0kubetsu
left a comment
There was a problem hiding this comment.
ECC review (/code-review, PR mode): clean — no findings above LOW. Validation green on the branch (ruff, pyright, 103 tests, OpenAPI regenerated in sync). Docs/trend semantics match the computed-not-stored pattern; the new fixtures cover the canceled-job and revoked-feed shapes clients must render. Advisory only: merge still waits on Nicky's review. Artifact: .claude/reviews/pr-12-review.md.
|
@coderabbitai review |
|
|
@coderabbitai review |
✅ Action performedReview finished.
|
Mechanical follow-ups from the PR #1 review closure, per Taiga task #199 (documentation touch-ups + mock-fixture coherence). All additive/corrective; no endpoint or schema shape changes.
Documentation
ScanResult.trenddocumented (review A4 residual): api-design §2.4 and data-model §8.1 now describe the computedtrend/TrendDirection, which existed in the contract andcore/enums.pybut in neither reference doc. The data-model note states it is computed at read and backed by no PostgreSQL enum, mirroring the computed verification status (§4.2).GET /statementswas the sole operation declaring a 500, with no stated rationale. The global fallback handler already guarantees problem+json for unhandled faults everywhere, so the declaration implied a special failure mode that does not exist.api/openapi.jsonre-exported.Mock coherence
revoked_at = created_at(June 1) whilelast_used_atwas July 31 — a feed used two months after revocation.revoked_atnow falls after the last delivery.POST /scans/{scan_id}/cancelreturned apartialjob; it now returnsstatus = canceledwith a cancellationstatus_reason.canceledappeared in no other sample, and the cancel response is where a client learns the terminal shape it must render.pendingsample's challenge was requested June 1 with a 7-day window, yet its recheck was recorded July 31 — a recheck against an unanswerable challenge. The challenge is now requested July 28, keeping the window open at the recheck and keepingpendingtruthful.Checks
make export-openapicommitted in sync ·make lintclean ·make typecheck0 errors ·make test103/103.Refs: Taiga #199 (v4.0.1 contract follow-ups from PR #1 review closure).
Summary by CodeRabbit
New Features
Documentation
Bug Fixes