fix(tests): resolve pre-existing unit test failures in 5 feature files

Fix five pre-existing BDD test failures that were present on master
before PR #10988 was opened:

1. **architecture.feature** — Converted `IndexEntry` from `@dataclass` to
   Pydantic `BaseModel` and `ACMSIndex` to a plain class so the "all
   dataclasses should use Pydantic models" check passes.

2. **pr_compliance_checklist.feature** — Fixed `PROJECT_ROOT` path
   resolution from `parents[3]` to `parents[2]` so the agent definition
   file at `.opencode/agents/implementation-supervisor.md` is located
   correctly within the `/app` workspace.

3. **acms/index_data_model_and_traversal.feature** — Added missing Gherkin
   table header rows (`| key | value |` and `| filter | value |`) to the
   "Create an index entry" and "Combined query with multiple filters"
   scenarios so behave correctly resolves column references.

4. **cli_init_yes_flag.feature** — Added a `getattr` guard around
   `context.temp_dir` in `_restore_cwd()` so cleanup does not crash with
   a `TypeError` when `temp_dir` was never assigned.

5. **security_audit.feature** — Renamed the ACMS step from "the count
   should be {count:d}" to "the ACMS entry count should be {count:d}" to
   resolve a step ambiguity where ACMS's `step_check_entry_count_value`
   shadowed security_audit's `step_count_is`, causing `AttributeError` on
   `context.entry_count` for audit scenarios.

These failures are pre-existing on master and are independent of the
PassSuppressFormatter feature in the preceding commit. They are fixed in
a separate commit to maintain commit atomicity — the feature commit
remains solely about the output suppression change.

Refs: #10987
This commit is contained in:
2026-05-07 08:16:24 +00:00
parent 49f1cfcdb6
commit 4fe87d9eec
5 changed files with 14 additions and 11 deletions
@@ -9,6 +9,7 @@ Feature: ACMS Index Data Model and File Traversal Engine
Scenario: Create an index entry with file metadata
When I create an index entry with:
| key | value |
| path | /project/src/main.py |
| file_type | python |
| size_bytes | 1024 |
@@ -116,7 +117,7 @@ Feature: ACMS Index Data Model and File Traversal Engine
Scenario: Get entry count from index
Given I have an index with 10 entries
When I get the entry count
Then the count should be 10
Then the ACMS entry count should be 10
Scenario: Remove entry from index
Given I have an index with 3 entries
@@ -131,6 +132,7 @@ Feature: ACMS Index Data Model and File Traversal Engine
| /project/tests/test_main.py | python | test | cold |
| /project/docs/readme.md | markdown | docs | cold |
When I query the index with filters:
| filter | value |
| path_pattern | src |
| file_type | python |
| tier | hot |