Skip to content

test(fixtures): restore apps-installed fixture with assertions - #8675

Merged
chenmingwei23 merged 1 commit into
mainfrom
fx/fixture-apps-installed
Sep 5, 2026
Merged

test(fixtures): restore apps-installed fixture with assertions#8675
chenmingwei23 merged 1 commit into
mainfrom
fx/fixture-apps-installed

Conversation

@pepmach

@pepmach pepmach commented Sep 5, 2026

Copy link
Copy Markdown
Contributor

Summary

Restores the apps-installed seed fixture, which seeds a KIROCREW_HOME containing one
locally installed app rather than a bare home:

  • config.json — an onboarded home (default workspace default -> workspace, dark theme,
    host 127.0.0.1, UTC).
  • apps/fixture-notes/installed.json — the persisted install record: enabled: true,
    origin: local, resources: gateway, lifecycle: gateway.
  • apps/fixture-notes/app.json — a valid app manifest (name, displayName, version,
    description, author).
  • apps/fixture-notes/data/notes.md — app-scoped data, so the data-dir resolver has a real
    file to find.
  • fixture.yaml — fixture metadata at schema-version: 2026-04-28.

The point of the fixture is to give app-manager consumers a non-builtin subject: an
enabled local app with gateway-managed resources and gateway lifecycle metadata.

Consumer test

test/test_fixture_apps_installed.py drives the production readers only — it never re-reads
the fixture files it seeded, so the fixture is validated through the code path real callers
use:

  • kiro_crew.apps.manager.list_apps() — asserts fixture-notes is listed with
    enabled is True, origin == "local", resources == "gateway",
    lifecycle == "gateway", and a parsed manifest["name"] == "fixture-notes".
  • kiro_crew.apps.manager.app_data_dir("fixture-notes") — asserts the resolver locates the
    seeded notes.md.

Both run inside kiro_crew.testing.fixtures.seeded_home("apps-installed"), so a schema the
production reader rejects fails the test instead of passing silently.

Schema repairs

The install record drifted from what the app manager now persists. Repaired against the
preserved pre-split copy:

  • installed_at renamed to installedAt (camelCase, matching the persisted key).
  • Four newer persisted fields added: displayName, schemaVersion, dev,
    defaultOnBackfilled.

Everything else in the pre-split copy is preserved as-is.

Verification

.venv/bin/python -m pytest test/test_fixture_apps_installed.py test/test_pod_scenarios_command.py test/test_pod_seed_scenarios.py test/test_seed.py -q

125 passed, 0 failed.

The acceptance criterion is that this passes with the fixture present: main already
carries the registry-tolerant scenarios test from #8222, and the scenario/seed suites
enumerate the fixture registry, so a malformed or unregistered fixture would surface there
rather than only in its own test.

Style gates on the touched test file, all clean: isort --check-only, flake8,
black --check --target-version py310.

Pattern harvest

Not generalizable: fixture restoration validated against current production readers; no new rule.

Backend-only change, no screenshots: the diff adds test fixture data under
src/kiro_crew/tests_fixtures/apps-installed/ plus one test file under test/. No dashboard,
CLI-output, or other user-visible surface is touched.

Seed fixture-notes as an enabled local app with gateway-managed resources,
gateway lifecycle metadata, a valid app manifest, and app-scoped notes data.

Prove the production app manager lists the seeded app with the expected
identity and state and resolves its seeded data file.
@pepmach
pepmach requested a review from a team as a code owner September 5, 2026 06:25
@pepmach
pepmach requested a review from cixuuz September 5, 2026 06:25
@github-actions github-actions Bot added the readiness: checking Automated validation is still running label Sep 5, 2026
@github-actions

github-actions Bot commented Sep 5, 2026

Copy link
Copy Markdown
Contributor

Design Review (Fable 5) — ✅ PASS

Design-level review of d096bf965f230f4591214f46ccb8dcef2242ea93 — updated in place on each push. A BLOCK verdict blocks PR readiness; PASS/CONCERNS are advisory.

The verification checks out: the fixture's installed.json fields match the manager's current InstalledApp dataclass (installedAt, schemaVersion: 2, dev, defaultOnBackfilled), the fixture registry resolves by directory name so no registration edit is needed, packaging globs (setup.cfg, MANIFEST.in) already include tests_fixtures/**, and the test consumes only production readers (list_apps, app_data_dir) inside seeded_home, matching the pattern the fixtures helper was designed for.

Design-Verdict: PASS

Fixture is validated through the production readers it exists to serve, with schema fields verified against the manager's current persisted record.

[DESIGN-REVIEWED] d096bf9

@github-actions

github-actions Bot commented Sep 5, 2026

Copy link
Copy Markdown
Contributor

Opus 4.8 Review — ✅ no blocking findings

Reviewed d096bf965f230f4591214f46ccb8dcef2242ea93 — this comment is updated in place on each push.

Review details

No findings.

[OPUS-REVIEWED] d096bf9

Verdict parsed from the review's SHA-scoped output markers for commit d096bf965f230f4591214f46ccb8dcef2242ea93.

False positive or not applicable? A repository writer can comment:
/ai-review override fable d096bf965f230f4591214f46ccb8dcef2242ea93: <one-sentence reason>

@github-actions

github-actions Bot commented Sep 5, 2026

Copy link
Copy Markdown
Contributor

GPT 5.6 Review — ✅ no blocking findings

GPT 5.6 completed its review of d096bf965f230f4591214f46ccb8dcef2242ea93 and found no blocking issues.

This comment is updated in place on each push.

Review details

No findings.
[GPT-REVIEWED] d096bf9

False positive or not applicable? A repository writer can comment:
/ai-review override gpt d096bf965f230f4591214f46ccb8dcef2242ea93: <one-sentence reason>

@github-actions

github-actions Bot commented Sep 5, 2026

Copy link
Copy Markdown
Contributor

First Principles Review (Fable 5) — ✅ PASS

Premise-level review of d096bf965f230f4591214f46ccb8dcef2242ea93 — why this exists and whether the shipped surface is the smallest honest version. Updated in place on each push. A BLOCK verdict blocks PR readiness; PASS/CONCERNS are advisory.

All checks are done. The fixture's schema fields match what manager.py persists (installedAt, schemaVersion: 2, dev, defaultOnBackfilled at src/kiro_crew/apps/manager.py:117-138), the registry-driven pod suite auto-covers any new fixture, and no doc enumerates fixture names, so nothing else needed updating. Emitting the review.

First-Principles-Verdict: PASS

A data-only seed scenario the registry mechanism was built to absorb, validated through the production readers instead of by re-reading itself.

What this change ships

Intent: give operators and app-manager tests a seedable home containing one installed non-builtin app — a FIX by the author's framing (restoring a pre-split fixture), functionally an ADDITION of one scenario.

  1. kirocrew pod scenarios / pod up --seed gains an apps-installed row, auto-discovered — justified
  2. Scenario seeds one enabled local app: manifest, persisted install record, data file — justified; fields match manager.py's persisted schema
  3. Scenario's home arrives onboarded (config.json with workspace, host, theme) — declared, skips onboarding in a seeded pod
  4. New test drives manager.list_apps() / app_data_dir() against the seeded home — justified, the only reader-path validation the fixture has
  5. Five small files join the runtime wheel as package data — inherent to the shipped-fixture mechanism seed.py documents

Every item is declared in the description; the registry suite (test/test_pod_seed_scenarios.py _ALL_FIXTURES) automatically extends manifest, seedability, JSON-parse, credential, and size gates to the new fixture, exactly as the description claims.

Watch

The byte-for-byte seed-fidelity contract is parametrized over hardcoded names, not the registry: 5 literal lists in test/test_fixtures_helper.py (grepped ["empty", "minimal", "rich"] — lines 34, 42, 160, 171, 190), so apps-installed sits outside the copytree-fidelity check while the pod suite already shows the registry-driven spelling. Replacing the two universal lists (34, 42) with the existing available_fixtures() registry would delete the divergence this fixture just created.

[FIRST-PRINCIPLES-REVIEWED] d096bf9

@github-actions github-actions Bot added readiness: passed Eligible automated validation passed for the current revision and removed readiness: checking Automated validation is still running labels Sep 5, 2026
@chenmingwei23
chenmingwei23 enabled auto-merge (squash) September 5, 2026 07:05

@chenmingwei23 chenmingwei23 left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Tier 1 auto-approve: test (6 files). Criteria: no conflict, no requested changes, security path denylist clean, design-doc gate clean, SAST annotations clean, security checklist all-NO, AI reviewers green. Category: test(fixtures) restore apps-installed fixture data plus one test assertion file, no runtime code.

@chenmingwei23
chenmingwei23 merged commit 5158d25 into main Sep 5, 2026
64 checks passed
@chenmingwei23
chenmingwei23 deleted the fx/fixture-apps-installed branch September 5, 2026 07:05
@github-actions github-actions Bot removed the readiness: passed Eligible automated validation passed for the current revision label Sep 5, 2026

@dwu96 dwu96 left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Tier 1 auto-approve: test (6 files). Criteria: no conflict, no requested changes, security path denylist clean, design-doc gate clean, SAST annotations clean, security checklist all-NO, AI reviewers green. Category: purely additive test fixture — new tests_fixtures/apps-installed data tree plus one new test/ consumer test; no existing file modified and no runtime code path changed.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants