Skip to content

test(BA-7853): add scenario tests for the user resource policy - #14550

Draft
jopemachine wants to merge 3 commits into
mainfrom
test/BA-7853-user-policy-scenarios
Draft

test(BA-7853): add scenario tests for the user resource policy#14550
jopemachine wants to merge 3 commits into
mainfrom
test/BA-7853-user-policy-scenarios

Conversation

@jopemachine

@jopemachine jopemachine commented Sep 11, 2026

Copy link
Copy Markdown
Member

Resolves BA-7853

Summary

  • Replace the TODO stub in api/adapters/resource_policy/KNOWLEDGE.md with the intro every policy shares and the user policy's chapter, and transcribe that chapter into tests/scenario/bai_scenario/manager/resource_policy: 27 rows over 6 modules, every one of its 6 adapter calls reached. Reading one's own user policy goes straight off the user's row, so it has no not-found row.
  • components/resource_policy.py holds the frame the three policies share and the user family (an OwnFamily, like the keypair one). The project (test(BA-7851): add scenario tests for the project resource policy #14548) and keypair (test(BA-7852): add scenario tests for the keypair resource policy #14549) PRs carry the same frame so each runs on its own; whichever merges first keeps it. Nothing under runner/, seeder.py or components/answers.py changes.
  • SeedUserPolicy takes a max_concurrent_logins, for the row that clears it. None stays the default, so every row laid so far — and every existing report.md — reads the same.

Behaviours the rows pin, worth a reviewer's eye:

  • Reading one's own user policy is guarded by READ at the caller's own scope, not merely narrowed to it.
  • Clearing the nullable concurrent-login cap clears it; clearing the non-nullable folder count leaves it as it was.
  • A duplicate name on create and a purge of a policy a user still references are stopped by the database, so the refusal is the repository's (BA-7839, BA-7840); a name nobody has is cannot resolve for everyone (BA-7841).

Test plan

  • python3 scripts/knowledge/check.py passes
  • test-scenario on CI: 27 scenarios, 0 failing
  • report.md generated from the CI run's scenarios.jsonl with scripts/scenario-report.py --split; the project and keypair calls are listed as not exercised until their PRs land

🤖 Generated with Claude Code

https://claude.ai/code/session_019vFCmtPMD6GLPBJxJoFroD

Write the intro every policy shares and the user policy chapter of
api/adapters/resource_policy/KNOWLEDGE.md, and transcribe the chapter into
tests/scenario/bai_scenario/manager/resource_policy: 27 rows over six modules,
every one of its six adapter calls reached. Reading one's own user policy goes
straight off the user's row, so it has no not-found row. The report.md is
what the CI run produced.

The component holds the frame the three policies share and this policy's
family; the project and keypair policies land the same frame in PRs of their
own. The row that clears the concurrent-login cap needs the user policy seed
to carry one, so SeedUserPolicy takes a max_concurrent_logins here; None stays
the default and every row laid so far reads the same.

Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_019vFCmtPMD6GLPBJxJoFroD
@jopemachine
jopemachine force-pushed the test/BA-7853-user-policy-scenarios branch from bada249 to 294e7cd Compare September 11, 2026 04:16
jopemachine and others added 2 commits September 11, 2026 13:45
…s 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, and
particles no longer attached to English identifiers. 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
…io 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