Skip to content

feat: seed engine apps over their workflows' runs, one waiting for an admin - #428

Merged
jkobgnther merged 3 commits into
mainfrom
feat/seed-engine-screens
Oct 11, 2026
Merged

jkobgnther merged 3 commits into
mainfrom
feat/seed-engine-screens

Conversation

@jkobgnther

Copy link
Copy Markdown
Contributor

What and why

GRA-430 follow-up to #417. After seeding, every engine said "No apps yet", and the dashboard had no app waiting for an admin. This adds an app (core's screen) to three of the demo engines.

scripts/seed/screens.ts holds one screen template, built only on what any App's screen gets: useWorkflow from @grasp-os/sdk/screen, and @grasp-os/ui components. No permission or connection is needed. Each screen shows:

  • how many of the workflow's runs completed, failed or are waiting over the last 30 days;
  • the decisions waiting, each with Approve and Reject, which answer the decision in place (decide);
  • the latest runs, with their status.

The three apps:

  • Finance → Invoice approvals, over supplier-invoices.
  • Client onboarding → File handovers, over file-handover.
  • Service desk → Complaints, over complaint-acknowledgement.

An admin approves the Finance and Client onboarding apps as the seed runs (screenTrust.review, then approve with the built artifacts), so their people see live data. Service desk's app is left unapproved, so admins get "Service desk has 1 app whose code nobody approved" under "Waiting elsewhere" on the dashboard.

Idempotent: a new engine gets its apps in its first version. An engine seeded before this PR gets the missing screens as its next version, made current by an admin. Approval happens only while a screen is unapproved. If a screen doesn't build, the seed says so and stops.

How it was tested

  • Fresh stack (state deleted, vp run dev started anew): vp run seed succeeds, and a second run adds nothing.
  • The upgrade path, an engine seeded by feat: seed the local stack with a demo company #417 that gets its screens as version 2, committed and was made current. Its first attempt surfaced a design-kit lint error (text-2xl on CardTitle), which is now fixed.
  • Each screen was built with the real screen compiler through core. All three build (screens.open answers screen.unreviewed, not screen.build_failed).
  • Screenshots, which I couldn't attach:
    • Engines: Client onboarding, Service desk and Finance each show "1 app".
    • Finance → Invoice approvals, signed in as Eva: 26 completed, 3 failed and 1 waiting; "Approve invoice KU-… from Kantoorhuis Utrecht" with Approve and Reject; and the latest runs with their dates and statuses.
    • Dashboard, as admin: "Waiting elsewhere → Apps to approve: Service desk has 1 app whose code nobody approved", next to the pending Knowledge request.
  • vp check passes.

Checklist

  • vp check and vp test pass. vp check passes; no tests change.
  • Schema changes are expand-only (no drops or renames in the same release). There are none.
  • New external calls go through connect; new model calls through the model gateway. There are none.
  • No secrets, client names or client configuration.

@greptileai review

🤖 Generated with Claude Code

https://claude.ai/code/session_01DGjkfKxJZ9eCUeQ9YexmJF


Generated by Claude Code

Copilot AI balanced review requested due to automatic review settings October 11, 2026 22:30

Copilot AI 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.

Copilot was unable to review this pull request because the user who requested the review has reached their quota limit.

@greptile-apps

greptile-apps Bot commented Oct 11, 2026 •

Copy link
Copy Markdown

RetriggerConfidence Score: 5/5

[Medium impact] The latest changes appear safe to merge; no new blocking issue was found.

Summary

Adds demo apps for Finance, Client onboarding, and Service desk. The latest change keeps unrelated unpublished versions out of screen upgrades.

  • Demo engines now have screens for their workflow runs and decisions.

The three earlier threads were checked against the current code. Interrupted upgrades can resume, unapproved screens get build checks, and existing unrelated unpublished versions are left alone. None supplied a Comment number, so previousFindings has no entries.

Diagram

%%{init: {'theme': 'neutral'}}%%
flowchart TD
  A[Existing engine] --> B{Has seeded screens?}
  B -->|No| Z[Skip upgrade]
  B -->|Yes| C{Current screens match?}
  C -->|Yes| Z
  C -->|No| D{Later version exists?}
  D -->|No| E[Commit changed screens]
  E --> F[Make committed version current]
  D -->|Yes| G{Files equal current plus seed screens?}
  G -->|Yes| F
  G -->|No| H[Warn and leave version alone]
Loading

Reviews (3) · Last reviewed commit: "fix: make current only a version that ho..." · Reviewed by Greptile

Comment thread scripts/seed.ts Outdated
Comment thread scripts/seed.ts Outdated
…een builds

The upgrade compares against the engine's latest version, so one committed before a stop is made
current instead of committed again; every engine's screens must build, approved or not.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01DGjkfKxJZ9eCUeQ9YexmJF

Copy link
Copy Markdown
Contributor Author

@greptileai review: 4c390d5 fixes both findings.


Generated by Claude Code

Comment thread scripts/seed.ts Outdated
… change

An engine without seeded screens is never touched, and a later version with anyone else's changes
is left unreleased, with the engine's apps as they are.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01DGjkfKxJZ9eCUeQ9YexmJF

Copy link
Copy Markdown
Contributor Author

@greptileai review: b9508cd fixes the unpublished-version finding.


Generated by Claude Code

Copy link
Copy Markdown
Contributor Author

check failed on one core test this PR doesn't touch: apps/core/test/run-lineage-pruning.test.ts:186. The test came from #419. It expected an "old" lineage's spend and alerts to be pruned to 0, but they were still 1.

This PR only changes scripts/seed.ts and scripts/seed/screens.ts, which core's tests never load. The same suite passed on this PR's previous commit (4c390d5), and the change since then is confined to upgradeScreens in scripts/seed.ts. I haven't found a fix for it. I'm re-running the failed job once.


Generated by Claude Code

@jkobgnther
jkobgnther merged commit ac15d3a into main Oct 11, 2026
16 of 17 checks passed
@jkobgnther
jkobgnther deleted the feat/seed-engine-screens branch October 11, 2026 23:22
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