Skip to content

feat(api): actress sync API surface (phase 4/6) - #210

Merged
seeyabye merged 3 commits into
integ/actress-sync-p12from
feat/actress-sync-api
Aug 12, 2026
Merged

seeyabye merged 3 commits into
integ/actress-sync-p12from
feat/actress-sync-api

Conversation

@seeyabye

Copy link
Copy Markdown
Contributor

Summary

Phase 4 of 6: the HTTP surface for actress sync — sync-job create/list/status/cancel/tasks endpoints, slim+paginated sync-candidates, actress merge preview/apply, config presence plumbing, and swagger. This is the first user-facing phase; phases 1-3 shipped infrastructure with no endpoints.

Stacked on integ/actress-sync-p12 (epic PR #209 carrying P1+P2+P3 on current main).

Audit findings addressed (API-2..API-8)

Finding Fix
API-2 All 8 mutating actress routes moved to writeProtected (POST/PUT/DELETE/merge/import + sync create/cancel)
API-3 Every 500 via core.RespondInternalError — no raw err.Error() leak
API-4/R1 Typed-sentinel status matrix via errors.Is/errors.As — 409 NoCandidates, 503 Unavailable (never 202), cancel terminal→409/404
API-5 view= + limit validation (unknown→400, non-numeric/≤0→400, >1000→clamp, default 500)
API-6 actress_ids cap 10000
API-7/R6 Slim+paginated sync-candidates {items,total,limit,offset} + filter= validation
API-8/R8-5 Symmetric retry_count/timeout presence plumbing (explicit-0 survives, omitted inherits)

Frozen contracts consumed

  • ErrActressSyncManagerUnavailable (phase 3) → 503 via errors.Is
  • NoCandidatesError{SkippedIDs} / ErrActressSyncNoCandidates (phase 2/3) → 409 with skipped_ids
  • CreateJob triple-return (job, skippedIDs, err) from phase 3
  • ListSyncCandidatesPaged(ctx, filter, limit, offset) from phase 2

R-SCOPE: P3-carried hunks finalized

PR #200 (phase 3) carried early impls of the presence plumbing + swagger aliases schema for compile coherence. This phase finalizes both: symmetric timeout presence, marshal_presence_test.go/scrapers_yaml_presence_test.go coverage, and endpoint-path swagger additions.

Local review gate

Passed 4 rounds of kadode/kimi-k3 max-thinking review (13→9→6→0 findings). All production-code defects resolved in round 1; rounds 2-3 were test/spec-completion items.

Test plan

  • go build ./... green
  • go test -short ./... clean
  • golangci-lint run ./... — 0 issues
  • go vet clean
  • swagger regenerated (all 6 endpoints + filter param + fence fields)
  • openspec validate --strict actress-sync-api valid
  • CI green on the combined tree
  • @codex reviewcodex: ok

Supersedes no PRs (stacks on epic #209). OpenSpec artifacts: openspec/changes/actress-sync-api/.

@chatgpt-codex-connector

Copy link
Copy Markdown

Summary

  • Added merge-request validation requiring target_updated_at and source_updated_at to be supplied together. This prevents partially versioned merge requests from being treated as valid optimistic-concurrency fences while preserving unfenced backward-compatible requests. internal/api/actress/merge.goL97-L114
  • Added focused handler coverage confirming a partial version fence returns HTTP 400 with a clear validation error. internal/api/actress/handlers_test.goL906-L918
  • Committed the changes as c2bc7da (fix(api): reject partial actress merge version fences).

Testing

  • go test ./internal/api/actress -run '^TestActressMergeRejectsPartialVersionFence$' -count=1 -timeout=30s
  • git diff --check
  • ⚠️ go test ./internal/api/actress (the full package run did not complete and was interrupted after producing no output)
  • ⚠️ make_pr (the configured MCP server could not start because its environment lacks mcp.server.fastmcp; dependency installation was blocked by the environment’s package-proxy policy)

View task →

@seeyabye

Copy link
Copy Markdown
Contributor Author

@codex review

@chatgpt-codex-connector chatgpt-codex-connector 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.

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: 6acdba60f6

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

Comment thread internal/api/system/config_service.go
@github-actions github-actions Bot added the 🤖 codex: needs work Codex review found issues that need addressing label Aug 12, 2026
@github-actions github-actions Bot removed the 🤖 codex: needs work Codex review found issues that need addressing label Aug 12, 2026
@seeyabye

Copy link
Copy Markdown
Contributor Author

@codex review

@chatgpt-codex-connector chatgpt-codex-connector 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.

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: f3b79b916d

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

Comment thread internal/scraperconfig/config.go
Comment thread internal/scraperconfig/config.go
Comment thread internal/api/system/scrapers.go Outdated
Comment on lines +90 to +92
func supportsActressMetadata(scraper models.Scraper) bool {
_, ok := scraper.(models.ActressMetadataResolver)
return ok

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

P2 Badge Advertise only actress resolvers the sync worker can invoke

For a registered scraper outside the built-in name set that implements ActressMetadataResolver, this endpoint reports supports_actress_metadata: true and the new priority validator accepts it, but worker.actressMetadataScrapers only admits the hard-coded names dmm, r18dev, javdb, and minnanoav (internal/worker/actress_sync.go:1035-1049). Selecting such a resolver exclusively therefore produces no resolver calls even though the API declares it supported; either discovery in the worker should use the interface or this capability must reflect the worker's actual allowlist.

Useful? React with 👍 / 👎.

@github-actions github-actions Bot added the 🤖 codex: needs work Codex review found issues that need addressing label Aug 12, 2026
@seeyabye
seeyabye force-pushed the feat/actress-sync-api branch from 8545589 to b6eb871 Compare August 12, 2026 09:54
@github-actions github-actions Bot removed the 🤖 codex: needs work Codex review found issues that need addressing label Aug 12, 2026
@seeyabye

Copy link
Copy Markdown
Contributor Author

@codex review

@chatgpt-codex-connector chatgpt-codex-connector 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.

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: b6eb871180

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

Comment thread internal/api/actress/merge.go
Comment thread internal/api/actress/sync_jobs.go
@github-actions github-actions Bot added the 🤖 codex: needs work Codex review found issues that need addressing label Aug 12, 2026
@seeyabye
seeyabye force-pushed the feat/actress-sync-api branch from b6eb871 to 8d57197 Compare August 12, 2026 10:13
@seeyabye

Copy link
Copy Markdown
Contributor Author

@codex review

@github-actions github-actions Bot removed the 🤖 codex: needs work Codex review found issues that need addressing label Aug 12, 2026
@chatgpt-codex-connector

Copy link
Copy Markdown

Codex Review: Didn't find any major issues. Can't wait for the next one!

Reviewed commit: 8d57197c23

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

@github-actions github-actions Bot added the 🤖 codex: ok Codex review found no major issues label Aug 12, 2026
@seeyabye
seeyabye merged commit 44d7715 into integ/actress-sync-p12 Aug 12, 2026
2 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

🤖 codex: ok Codex review found no major issues

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant