Skip to content

fix(shell): show repository-effective profile in shell status - #1423

Merged
decode2 merged 6 commits into
Gentleman-Programming:mainfrom
AutanaSoft:fix/1176-shell-effective-profile
Sep 26, 2026
Merged

decode2 merged 6 commits into
Gentleman-Programming:mainfrom
AutanaSoft:fix/1176-shell-effective-profile

Conversation

@AutanaSoft

@AutanaSoft AutanaSoft commented Sep 25, 2026 •

Copy link
Copy Markdown
Contributor

Closes #1176
Supersedes #1252

Summary

The shell now shows the Profile effective for the current repository, using valid Local → Repo → global precedence. It displays name (local) for a clone-local pin, name (repo) for a repository declaration, and name for the global profile. The display refreshes outside rendering while the UI session is active.

Changes

File Change
extensions/gentle-shell.ts Resolve and cache the effective Profile for the session repository.
tests/gentle-shell.test.ts Cover precedence, refresh, rendering, and session cleanup.
docs/readme-reference.md Document Profile labels and refresh behavior.
odd/tasks/1176-shell-effective-profile.md Record implementation and verification evidence.

Verification

  • Focused tests: 222 passed.
  • Full suite: 3,436 passed, 41 skipped; provider-contract and runtime-harness checks passed.
  • Typecheck passed with 188 pre-existing baseline diagnostics and no regressions.
  • Installed Pi 0.87.1 bundle and native Windows paths remain unverified.

Summary by CodeRabbit

  • New Features
    • The fullscreen header and Status → Project → Profile show the effective profile. Clone-local pins are labeled “(local),” repository declarations “(repo),” and the global active profile has no suffix.
    • Profile changes appear within about two seconds while the UI session is active. Invalid or stale pins fall back to the next valid profile; the indicator is omitted when no valid profile remains.
  • Documentation
    • Added guidance on profile labels, fallback behavior, and updates.

@coderabbitai

coderabbitai Bot commented Sep 25, 2026 •

Copy link
Copy Markdown

Review in Change Stack →

Navigate logical layers of code changes, visualize relationships, and explore their blast radius.

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: Repository UI

Review profile: ASSERTIVE

Plan: Advanced

Run ID: 201d989d-2807-464a-b331-686c6f9aa488

📥 Commits

Reviewing files that changed from the base of the PR and between 78c7535 and 9f05dff.

📒 Files selected for processing (3)
  • extensions/gentle-shell.ts
  • odd/tasks/1176-shell-effective-profile.md
  • tests/gentle-shell.test.ts

Included review availability: This review used your included allowance. Your plan provides up to 4 included reviews per hour; 3 remain after this review.


📝 Walkthrough

Walkthrough

The shell now resolves the effective profile for each UI session, polls for changes every two seconds, and refreshes fullscreen surfaces when the profile changes. Documentation describes source labels and fallback behavior.

Changes

Session effective profile

Layer / File(s) Summary
Resolve the effective profile
extensions/gentle-shell.ts, tests/gentle-shell.test.ts, docs/readme-reference.md, odd/tasks/1176-shell-effective-profile.md
The callable profile reader resolves local and repository pins and falls back to the global profile. Tests cover precedence, fallback, and cached worktree identity. Documentation and the task record describe the profile display behavior.
Poll and refresh fullscreen surfaces
extensions/gentle-shell.ts, tests/gentle-shell.test.ts
UI sessions without an activeProfile override poll the reader every two seconds. The shell requests a render when the effective profile changes and stops polling on session replacement or shutdown. Tests cover rendering and timer behavior.

Priority: ⬇️ Low

Estimated code review effort: 3 (Moderate) | ~20 minutes

Change: Bug fix · Severity of issue fixed: Low

Sequence Diagram(s)

sequenceDiagram
  participant ShellSession
  participant ActiveProfileReader
  participant resolveProfilePin
  participant FullscreenSurfaces
  ShellSession->>ActiveProfileReader: bind session cwd and worktree resolver
  loop Every two seconds
    ShellSession->>ActiveProfileReader: refresh
    ActiveProfileReader->>resolveProfilePin: resolve session profile pin
    resolveProfilePin-->>ActiveProfileReader: resolved pin or no pin
    ActiveProfileReader-->>ShellSession: effective profile changed
    ShellSession->>FullscreenSurfaces: invalidate sidebar and render
  end
  ShellSession->>ActiveProfileReader: reset on shutdown or replacement
Loading

Suggested reviewers: alan-thegentleman

Merge Risk: ⚪ Minimal · up to 9f05d

The effective-profile display and refresh behavior have no identified issue requiring a fix before merge.

Security Architecture Review

Security architecture risk: 🔵 Low · up to 9f05d

Repository and local profile settings can now affect the shell’s displayed label, but the reviewed path does not change profile execution or access controls. A temporary repository lookup failure can leave the label showing the global profile until the session is rebound.

Retained concerns
No architecture-level concerns identified.

Security review details

Security Blast Radius

  • inferred — The newly reachable pin data is scoped to the current UI session’s worktree and the displayed shell surfaces. No sensitive sink is identified along this reader-to-render path.

Trust Boundaries and Controls

  • observed — The reader binds to the session cwd and worktree resolver. The pin resolver requires a winning profile present in the configured profile store before the shell displays its pin source.

Resilience and Maintainability Implications

  • inferred — A transient identity-resolution failure can leave the indicator inaccurate for that session. The reviewed consumer treats the indicator as display state, so this is not established as a security-control failure.
🚥 Pre-merge checks | ✅ 4 | ❌ 1

❌ Failed checks (1 warning)

Check name Status Explanation Resolution
Docstring Coverage ⚠️ Warning Docstring coverage is 33.33% which is insufficient. The required threshold is 80.00%. Docstring coverage is scoped to functions touched by this diff. Analyzed 3 functions across 2 files. (1 skipped: 1… Write docstrings for the functions missing them to satisfy the coverage threshold.
✅ Passed checks (4 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title clearly and concisely describes the main change: displaying the repository-effective profile in shell status.
Linked Issues check ✅ Passed The PR satisfies the coding requirements in #1176. createActiveProfileReader resolves clone-local, repository, then global profiles and preserves (local) and (repo) labels. Tests cover precedenc…
Out of Scope Changes check ✅ Passed The changed shell logic, regression tests, timer lifecycle changes, documentation, and task record support the effective-profile behavior in #1176. No unrelated product behavior is demonstrated.
Full details: Docstring Coverage

Explanation

Docstring coverage is 33.33% which is insufficient. The required threshold is 80.00%. Docstring coverage is scoped to functions touched by this diff. Analyzed 3 functions across 2 files. (1 skipped: 1 unsupported.)

  • Fix all pre-merge checks with AI
✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create a new PR

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands.

@decode2

decode2 commented Sep 25, 2026

Copy link
Copy Markdown
Member

Solid architecture overall. Moving profile resolution off the render loop via snapshot binding and reusing the cached Git worktree identity keeps the 60 FPS render path completely free of filesystem and Git overhead.

One contract detail to align before merging: issue #1176 specifies lowercase source suffixes:

  • (local) instead of (Local)
  • (repo) instead of (Repo)

Using lowercase matches the issue specification and keeps it consistent with other UI status markers like (pinned). This just needs a quick update in extensions/gentle-shell.ts, the corresponding assertions in tests/gentle-shell.test.ts, and docs/readme-reference.md.

@AutanaSoft

Copy link
Copy Markdown
Contributor Author

Thanks for catching the mismatch with #1176. I updated the visible suffixes to (local) and (repo) in 78c75359, along with the relevant tests and reference documentation. The focused tests (222 passed), typecheck (no regressions), and full suite (3,436 passed, 41 skipped) all passed.

# Conflicts:
#	extensions/gentle-shell.ts
@decode2
decode2 merged commit 678016f into Gentleman-Programming:main Sep 26, 2026
1 check passed
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.

bug(shell): Status shows the global profile instead of the repository-effective profile

2 participants