← Back to Pull requests

feat(studio): let people follow one slice, its fields and its findings #197

Closed
unknown closed this pull request without merging on Oct 20, 2026 03:26 UTC
View on GitHub
unknown unknown commented on Oct 19, 2026 23:15 UTC
Author

Summary

Studio shows every slice at once. To check one slice, a reader must find its cards, trace its fields by hand and filter the validation drawer. This PR adds a read-only Slice view that shows one slice with the step that feeds it and the step it feeds.

What changes

  • A new "Slice" tab (?view=slice). Studio offers it only when the model has at least one slice. The selected slice stays in the URL (?slice=<namespace>/<slug>), so a link opens the same slice.

  • The picker groups slices by storyboard, in storyboard order. With no ?slice=, the view opens the slice of the selected entity, or else the first slice.

  • Fields: pick a field to see which cards carry it and where it stops. The trace uses top-level field names and swimlane state, the same inputs the validator uses. A stop is drawn in neutral grey, because a stop is not always a finding.

  • Validation: the validator findings for the slice and its members, grouped by entity, each with a copy fix prompt button. The view adds no rules of its own, so findings stay owned by the validator.

  • Story: previous, next and play through the storyboard, one slice at a time.

  • Scenarios: step through given, when and then. The board highlights the entities that each step names, and a rejected command shows its reason code.

  • A card click selects the entity in the Inspector. Nothing in the view edits the model.

  • IssueList and ExampleBlock move out of the Inspector, so both views share one rendering of findings and scenario examples.

  • Every view now reads one slice per slug, at its highest loaded version, through latestSliceBySlug in model.ts. Before, each view kept whichever version the model listed last, and an older version that no storyboard names showed up as a second slice. The picker, the URL and story playback must agree on one version, so the Board, Plan, Sequence, UI and sitemap builders now use the same lookup.

  • The field trace skips fields with a DerivedFieldAnnotation, because the validator exempts them from the sourcing rules.
  • How to test

    1. In tsworkspace/webapps/studio, run pnpm lint, pnpm typecheck and pnpm test.
    2. Open an event model that has slices and pick the Slice tab.
    3. Pick a slice from the picker. Check that the URL holds ?slice=.
    4. In Fields, pick a field that a read model does not project. Check that a cross marks the link where it stops.
    5. In Validation, check that the findings match the validation drawer for the same entities.
    6. In Story, use previous, next and play. In Scenarios, step through a scenario.
    7. Click a card. Check that the Inspector opens on that entity.
    8. Open a model with no slices. Check that the Slice tab is not offered.

    Known limits

  • The neighborhood is structural: one hop, with no time order. A read model that many slices feed shows all of its feeders, stacked.

  • Only top-level fields are traced.

  • Only stops on event to read model links match a validator rule (RM_SOURCE_EVENT_FIELD_NOT_PROJECTED). Other stops are information only.

  • A slice that is in several storyboards is listed under its first storyboard in the picker.
  • <!-- codesmith:footer -->
    ---
    <a href="https://app.blacksmith.sh/TrogonStack/codesmith/atlas/pr/197?autoLogin=true&ref=codesmith_pr_footer"><picture><source media="(prefers-color-scheme: dark)" srcset="https://pr-comments-assets.blacksmith.sh/codesmith/view-with-codesmith-dark-v3.svg"><source media="(prefers-color-scheme: light)" srcset="https://pr-comments-assets.blacksmith.sh/codesmith/view-with-codesmith-light-v3.svg"><img alt="View with [code]smith" src="https://pr-comments-assets.blacksmith.sh/codesmith/view-with-codesmith-dark-v3.svg"></picture></a> <a href="https://backend.blacksmith.sh/track/enable-autofix?expires=1795043731&installation_model_id=437969&pr_number=197&ref=codesmith_pr_footer&repository=TrogonStack%2Fatlas&return_to=https%3A%2F%2Fgithub.com%2FTrogonStack%2Fatlas%2Fpull%2F197&signature=0617b89cf152ae7cba30e2060b2ce41ac9ab8d0bf6dfe545746ba80778f6f6ad"><picture><source media="(prefers-color-scheme: dark)" srcset="https://pr-comments-assets.blacksmith.sh/codesmith/autofix-with-codesmith-dark.svg"><source media="(prefers-color-scheme: light)" srcset="https://pr-comments-assets.blacksmith.sh/codesmith/autofix-with-codesmith-light.svg"><img alt="Autofix with [code]smith" src="https://pr-comments-assets.blacksmith.sh/codesmith/autofix-with-codesmith-dark.svg"></picture></a>
    <sup>Need help on this PR? Tag <code>@codesmith-bot</code> with what you need.</sup>

    <!-- codesmith:autofix:disabled -->
    <!-- /codesmith:footer -->

    Diff: 572 lines (+429 / -143) across 7 files Reviewer: yordis Review duration: 250m
    All Vouch review confidence checks passed
    Residual risk 0.22 = Change Risk (0.50) × (1 − Review Confidence (0.57)). Review depth and reviewer attention state are adequate.
    Model 1 · Change Risk (XGBoost)
    Score: 0.50 · 572 lines diff across 7 files
    0.50
    Model 2 · Review Depth (DistilBERT)
    Depth Score: 0.17 · 1 substantive comment(s)
    0.17
    Model 3 · Review Timing & Attention
    Session adequacy: 100% · Reviewer familiarity: 35%
    56%
    Bedrock Claude 3 · Risk Narration
    (disconnected)
    Groq
    Groq Risk Narration
    AWS Bedrock is currently disconnected. Generate high-confidence PR triage narration on-demand using Groq.
    Model 1 · Change Risk Attribution
    SHAP Weights
    Diff Size diff_size
    0.380
    Shallow Review Depth shallow_review_depth
    0.289
    Real PR Conversation Timeline
    1 comments
    "Review active on #197"
    general weight: 0.35
    Reviewers
    Assignees
    Unassigned
    Labels
    risk: low confidence: 56.8% reviewed
    Vouch Risk Breakdown
    AI-powered review risk analysis
    Change Risk
    Change Risk · Model 1 (XGBoost)
    Predicted defect probability (0.00–1.00) based on diff churn, modified sensitive files, and author risk history.
    Score: 49.8% (MEDIUM) · Higher = larger blast radius
    49.8%
    Review Confidence
    Review Confidence · Models 2 & 3
    Scrutiny score (0.00–1.00) combining DistilBERT semantic review depth with reviewer familiarity and session dwell time.
    Score: 56.8% · Lower = rushed or shallow review
    56.8%
    Residual Risk
    Residual Risk · Core Equation
    Residual = Change × (1 − Confidence)
    Unmitigated risk surviving review. ≥ 0.65 triggers an automated re-queue to protect production.
    Score: 21.5% · Safe to merge
    21.5%