Skip to content

test(BA-7843): add scenario tests for the runtime variant adapter - #14535

Draft
jopemachine wants to merge 3 commits into
mainfrom
test/BA-7843-runtime-variant-scenarios
Draft

test(BA-7843): add scenario tests for the runtime variant adapter#14535
jopemachine wants to merge 3 commits into
mainfrom
test/BA-7843-runtime-variant-scenarios

Conversation

@jopemachine

@jopemachine jopemachine commented Sep 11, 2026

Copy link
Copy Markdown
Member

Resolves BA-7843

Summary

  • Fill api/adapters/runtime_variant/KNOWLEDGE.md with the scenarios the adapter guarantees, following the shape api/adapters/domain/KNOWLEDGE.md set in test(BA-7779): PoC of scenario-table tests through the adapter layer #14448, and transcribe it into tests/scenario/bai_scenario/manager/runtime_variant/ — 29 rows over five modules (creating, reading, searching, editing, retiring) — with seeds/runtime_variant/runtime_variant.py and components/runtime_variant.py.
  • All eight calls are exercised, resolve_by_name and batch_load_by_ids included.

What the rows pin:

  • The reads (by id, by name, by many ids) ask for authentication alone; a user granted nothing reads, and an unknown name resolves to not-found because no permission check follows the lookup.
  • Create is behind the superadmin role; update and delete are behind the entity gate, which no role can reach since the variant is created in no scope. With rbac.enforcement_enabled=false a user granted nothing edits and deletes but still cannot create.
  • Renaming to a taken name is refused with the raw unique-violation error, not the conflict error the create path maps it to.
  • bulk_delete is a loop, not a transaction: an unknown id behind a known one is refused as not-found after the known one is gone.

Deferred, stated in the document: deleting a variant with presets attached — the preset's variant column has a foreign key in the alembic migration but not in the ORM, so the result differs between a migrated database and one built by schema oneshot.

tests/scenario/bai_scenario/components/system.py — the caller-only situation every system-concern table shares — travels in each of the eight sibling PRs byte for byte (#14535, #14536, #14538, #14542, #14543, #14544, #14545). Whichever merges first, the rest rebase clean.

Test plan

  • python3 scripts/knowledge/check.py passes
  • The rows passed in CI run 34558080395 of the unsplit branch (0 failing); report.md is generated from that run's artifacts with scripts/scenario-report.py --split
  • test-scenario and verify-scenario-report pass on this PR

🤖 Generated with Claude Code

https://claude.ai/code/session_01Snp9H2jEVbB2s1C6ixUHGn

Fill adapters/runtime_variant/KNOWLEDGE.md with the scenarios the adapter guarantees and
transcribe it into tests/scenario/bai_scenario/manager/runtime_variant/ — 29 rows over
five modules. components/system.py is the caller-only situation every system concern
table shares; the sibling PRs carry the same file byte for byte. The report is generated
from CI run 34558080395.

Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01Snp9H2jEVbB2s1C6ixUHGn
…arios for readability

The knowledge document, the component docstrings and every scenario sentence
used a terse, metaphorical style (문, 줄, 훑기, 심다, 실리다, 해석, 배선) that
did not read at a glance. Rewrite them in plain technical Korean:
생성/조회/검색/수정/삭제 for the operations, 이름을 id로 변환 for resolve,
권한 검사 for enforcement, 미리 만들어 둔 for seeded data, Arabic numerals for
the page sizes, and 역할 부족으로 거부 for the role refusals. report.md follows
from the CI run in the next commit.

Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01NQiEEB2mfJtFWnMnHLDFnT
jopemachine added a commit that referenced this pull request Sep 11, 2026
…et scenarios for readability

The knowledge document, the component docstrings and every scenario sentence
used a terse, metaphorical style (문, 줄, 훑기, 심다, 실리다, 배선) that did not
read at a glance. Rewrite them in plain technical Korean: 생성/조회/검색/수정/삭제
for the operations, 권한 검사 for enforcement, 미리 만들어 둔 for seeded data,
Arabic numerals for the order gap and page sizes, and 역할 부족으로 거부 for the
role refusals. The shared runtime_variant component carries the same rewrite as
#14535. report.md follows from the CI run in the next commit.

Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01NQiEEB2mfJtFWnMnHLDFnT
…ten wording

Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_013qjgCzggSejnvDrLt4tG3a
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

size:XL 500~ LoC

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant