Skip to content

fix(search): confine the file index to the project root and key relative paths to the walk - #644

Merged
kshivang merged 19 commits into
risa-labs-inc:devfrom
Vidhaankhare16:fix/file-index-project-confinement
Sep 15, 2026
Merged

kshivang merged 19 commits into
risa-labs-inc:devfrom
Vidhaankhare16:fix/file-index-project-confinement

Conversation

@Vidhaankhare16

@Vidhaankhare16 Vidhaankhare16 commented Sep 14, 2026 •

Copy link
Copy Markdown
Contributor

Problem

FileIndexer is the walk behind BOSS Spotlight's file results. Its containment check carries the comment "Security: Validates that all indexed files remain within the project root to prevent path traversal via symlinks", and it does not do that. Two independent holes in one line, FileIndexer.kt:207 on dev:

if (!childCanonicalPath.startsWith(rootCanonicalPath))

1. java.io.File.canonicalPath does not follow a symlink or a directory junction on Windows. NIO's toRealPath does, on every platform, but canonicalPath does not, so on Windows a junction inside the project resolves to <root>\link, which is trivially under the root, and the entire subtree behind it is walked and indexed. mklink /J requires no elevation, unlike mklink /D, so planting one takes only write access inside the project. Measured on Windows 11 with JDK 17: a junction at <project>\link pointing at a sibling directory reports canonicalPath = <project>\link while toRealPath() = <sibling>, and the file behind it is indexed.

2. The comparison is a String prefix with no separator, so a sibling escapes on every platform. "C:\w\proj-secrets\credentials.env".startsWith("C:\w\proj") is true. With File.separator appended it is false. On macOS and Linux, where canonicalPath does resolve links, this is the live half: a symlink to a sibling whose name merely begins with the project's name passes.

There is a second, unrelated defect in the same function. relativePath is produced by slicing the child's absolute path at the length of the root's canonical path plus one:

if (absolutePath.length > rootPathLength) absolutePath.substring(rootPathLength) else name

Those are two different spellings of the same directory, so whenever they differ in length every entry in the index is cut at the wrong offset and the leading characters of the relative path are eaten. This needs no link and no unusual setup: it fires on an ordinary project tree whenever the root's absolute and canonical spellings differ at all. On Windows an 8.3 short component does it, which is how the system hands out %TEMP%: C:\Users\VICTUS~1\... canonicalises to C:\Users\VICTUS 15\..., one character longer, so one character is lost from every entry: src\Main.kt is displayed as rc\Main.kt, and Root.kt as oot.kt. On macOS a project under /tmp, really /private/tmp, makes the offset longer than the whole path, so every file falls through to the else branch and loses its folder entirely. relativePath is what Spotlight shows the user, so the corruption is visible and silent.

Both defects are already solved correctly 100 lines away in the same package. ContentSearchService.resolveFile appends File.separatorChar, re-verifies on toRealPath(), and its KDoc states the Windows canonicalPath behaviour in as many words. It also explains why the non-resolved spelling is the one to hand back. FileIndexer is the copy that drifted, and it has no test file today.

What this changes

Containment now resolves with java.nio.file.Path.toRealPath() and compares with Path.startsWith(Path), which matches whole name components rather than characters, closing both holes with the same comparison. Path.startsWith is already the idiom used correctly for the zip-slip guard in ChromiumAutoDownloader.extractWithJava.

The resolve is paid only for entries that are links. Only a link can take an entry out of the directory it was listed in, and the walk only descends through directories already confined, so a non-link entry is inside the root by construction. That is the trade TabPaths.pathsMatch documents for canonicalisation: the expensive check earns its place only where the cheap one cannot answer. It matters here because resolving unconditionally measured slightly MORE expensive than the canonicalPath call being replaced, while the gated form measures about a tenth of it, so the net effect is a cheaper walk rather than a more expensive one. A Windows junction is not reported by Files.isSymbolicLink but does set isOther, so both are checked, and an attribute read that fails answers true so an unclassifiable entry goes to the resolve rather than being waved through.

relativePath is now produced by relativizing two paths that are both in the walk's own spelling, so there is no offset to get wrong. The absolute spelling stays the one used for both IndexedFile.path and IndexedFile.relativePath, deliberately: a tab is keyed by the path it was opened with, and handing back the resolved path would make the index disagree with the editor about which file is which. That is the same reasoning ContentSearchService.resolveFile records for returning the non-canonical candidate.

The root is resolved once into a small IndexRoot holding both spellings, so the pair cannot be mixed up at a call site, and resolution failure on the root now fails closed with a warn rather than walking an unconfined tree.

scanDirectory's per-entry work moved into isSkipped, isConfined and passesExtensionFilter, with the two pure path helpers isLink and resolvesInsideRoot at file scope beside IndexRoot, where logger already lives. Those suppressed findings then stop firing rather than needing to be re-keyed to the new signature, so CyclomaticComplexMethod, NestedBlockDepth and LoopWithTooManyJumpStatements for FileIndexer come out of detekt-baseline.xml instead of moving. The cheap name tests are ordered before isConfined so an excluded directory never touches the filesystem.

Precedence and scope

No function-level overlap with any open PR. PR #593 (fix/spotlight-project-session-isolation) is the only open PR that touches FileIndexer.kt; it rewrites indexProject, adds a scan injection seam and adds SpotlightFileIndexOwner, and does not touch scanProjectFiles or scanDirectory, which is where both defects are. Whichever lands second rebases; the regions do not overlap. PRs #628 and #625 touch ContentSearchService, not FileIndexer. PRs #582, #581 and #575 touch GlobalSearchService, not FileIndexer. Checked with gh api repos/risa-labs-inc/BossConsole/pulls/<n>/files --paginate across all open PRs, because the non-paginated file list stops at 100 entries and several open PRs are over 200 files.

This is scoped to the index walk. It does not touch ContentSearchService, GlobalSearchService or the FileIndexer locking that #593 is changing.

On converging the confinement checks: after this there are two of them in this package, not three. TabPaths.pathsMatch tests whether two paths name the same file, which is identity rather than containment, so it is a different operation. The other is ContentSearchService.resolveFile, and it is correct today - it appends File.separatorChar before comparing and re-verifies on toRealPath, so it has neither hole this fixes. They still do not share a helper, and that is deliberate rather than overlooked: resolveFile accepts a relative rawPath, resolves it against the project, and must hand back the NON-resolved candidate because the editor keys open buffers by the path a tab was opened with, while the index walk needs the gate-on-link optimisation and returns nothing. A shared helper is worthwhile and I am happy to do it, but it means editing ContentSearchService.kt, which #628 and #625 both touch right now, so it belongs in its own PR once those land rather than widening this one into a collision.

Known limits

Tightening containment can only remove entries from the index, never add them, so nothing downstream can receive a path it would not have received before. FileIndexer has one caller, GlobalSearchService.fileIndexer.

A file that is itself a link to a location outside the project is now excluded, where before it was indexed. That is the intended behaviour and matches the comment that was already on the function, but it is a behaviour change for anyone who was relying on a linked file appearing in Spotlight.

A link that resolves to a location still inside the project is legitimately followed, so a project containing a link to its own ancestor walks the same subtree more than once. That is unchanged from before, and is bounded by the existing maxDepth of 15, so it is noted rather than fixed here.

Confinement and descent are a check-then-act pair: isConfined(child) runs, then child.isDirectory and listFiles(). An entry swapped for a link in that window would be walked on the strength of a check that no longer describes it. This is unchanged from the previous code and cannot be closed with java.io.File, which offers no open-then-verify handle; closing it properly means holding a directory stream over the walk. Naming it rather than leaving it for review to find.

toRealPath() requires the target to exist, so a broken link is skipped. The previous code also skipped it, via the same continue, so this is unchanged and is the fail-closed direction.

Validation

Base: origin/dev @ 9a2e5034, 0 behind and 1 ahead. The full suite below was run on c18e24a5; dev has since been rewritten (the 9.5.15 batch), and the rebase onto 9a2e5034 changed no file this PR touches, so the counts still describe this diff.

Full :composeApp:desktopTest plus ktlintCheck and detekt, on JDK 17 (17.0.20.1), Windows 11:

  • 4665 tests, 486 classes, 15 skipped, 2 failures, 0 errors.
  • ktlint clean and detekt clean, both executed against the rebased tree, with a detekt baseline that is now 3 entries smaller (1857 to 1854).
  • Both failures are this machine's known environmental pair, and both fail with java.nio.file.FileSystemException: A required privilege is not held by the client on Files.createSymbolicLink: DesktopFileScannerTest and DiscardDownloadContainmentTest. Neither touches anything in this change. Creating a symlink on Windows needs SeCreateSymbolicLinkPrivilege, which this account does not hold.
  • The 3 new tests in FileIndexerConfinementTest pass with 0 skipped, because they fall back to mklink /J, which needs no privilege. That is deliberate: the two tests above are the reason a symlink-only test cannot run on an ordinary Windows account, and the new ones are written not to have that problem.

All three tests were run against the unmodified dev copy of FileIndexer in this same harness, with only the test file added, and all three fail there:

a directory link out of the project does not put outside files in the index
  -> a file outside the project root must not be indexed: [...\proj\link\credentials.env, ...]
a root reached through a link still reports relative paths under that root
  -> expected: <src\Main.kt> but was: <rc\Main.kt>
an ordinary tree indexes with relative paths rooted at the project
  -> expected: <Root.kt> but was: <oot.kt>

The third is worth calling out: it contains no link at all. It fails on dev purely because this machine's temp directory carries an 8.3 short name, which is the everyday shape the relative-path defect needs. On a host where the root's absolute and canonical spellings already match, that test passes either way and the first two carry the proof.

Measured per-entry cost of the confinement check, mean of 5 passes over 1661 real source entries, against the getCanonicalPath the previous code called: resolving every entry with toRealPath is about 1.1x to 1.2x the old cost, while gating the resolve on the link test is 0.048x. So this is a reduction in the indexing walk's cost, not an increase.

On the gate itself: Files.isSymbolicLink measured false for a real mklink /J junction while isOther measured true, so both flags are needed. They are read once rather than twice, because Files.isSymbolicLink performs the same readAttributes(..., NOFOLLOW_LINKS) internally and returns one flag from it. Calling it first and then reading the attributes again cost 0.092x against 0.048x for the single read, almost exactly double, for identical answers on a junction, an ordinary directory and an ordinary file.

Manual checks remaining

The end-to-end Spotlight UI was not exercised: a fork build stops at the sign-in screen without SUPABASE_URL, SUPABASE_ANON_KEY, SUPABASE_FUNCTION_URL and JXBROWSER_LICENSE_KEY, so it never reaches the workspace. The assertions are against the contents of FileIndexer.indexedFiles, which is what the UI renders, not against a screenshot. Worth a maintainer eye on an installed build to confirm the Spotlight rows read as expected.

Attribution

Authored by Vidhaankhare16 vidhankhare16@gmail.com.

Maintainer review update (2026-09-14)

Original implementation and three regression tests remain credited to @Vidhaankhare16. Review-agent commit c87b61e adds accepted internal-directory-link and rejected external-file-link tests, pins linked-root absolute spelling, narrows symlink setup exceptions, bounds junction creation with diagnostics, and orders excluded-name checking before filesystem stat. It also documents the broader reparse-point performance case. Dev integration preserves the original author commit.

On current head c87b61e, all 5 focused tests passed, 0 failures/errors/skips, and composeApp ktlintCheck/detekt passed on macOS. The original three tests all failed against current dev's unchanged FileIndexer, demonstrating the regressions locally. Hosted CI: https://github.com/risa-labs-inc/BossConsole/actions/runs/34821641913 (still pending at this update).

Claude's review found production logic correct; requested test gaps and setup safeguards are addressed. Evidence and responses: #644 (comment). Helpers stay private because real-filesystem public-output tests cover the integration. Existing TOCTOU and depth-bounded repeated walks remain explicitly outside this patch.

No duplicate consolidation: #593 changes session ownership, #625/#628 replacement behavior. The pre-existing Windows highlight separator issue remains separate follow-up context. End-to-end Spotlight UI remains unexercised; no app instance was launched or stopped for this review.

@Vidhaankhare16
Vidhaankhare16 force-pushed the fix/file-index-project-confinement branch 2 times, most recently from 838ac0f to 3e8b8a0 Compare September 14, 2026 07:48
@kshivang

Copy link
Copy Markdown
Contributor

@claude Please review the current head 3e8b8a0 for project-index confinement, path spelling correctness, Windows junction handling, and regression coverage.

@claude

claude Bot commented Sep 14, 2026 •

Copy link
Copy Markdown

Claude finished @kshivang's task in 5m 16s —— View job


Review of 3e8b8a0

  • Read the diff at 3e8b8a0
  • Confinement logic (isConfined / resolvesInsideRoot / IndexRoot)
  • Path spelling correctness (relativeToRoot, absolute vs resolved)
  • Windows junction handling (isLink, isOther, attribute-read failure)
  • Regression coverage (FileIndexerConfinementTest)

Both defects are real and the fixes are correct. My findings are all test-side or notes; nothing blocks on the production change. I could not run Gradle in this environment (no cached distribution), so I verified by reading - the ktlint/detekt/suite numbers in the description are taken at face value.


Confinement: the argument holds

The core claim - "only a link can take an entry out of the directory it was listed in, and the walk only descends through directories isConfined has already approved" - checks out as an induction on real paths, not on spellings, which is the version that is actually sound:

  • Base: the walk starts at root.absolutePath, whose toRealPath() is root.realPath by construction (FileIndexer.kt:176-180).
  • Step: for an approved link directory L, realpath(L) is inside the root because resolvesInsideRoot said so; for a non-link child, realpath(child) = realpath(parent) + name, inside by hypothesis.

So the gate is not just a performance trade that happens to be safe - it is safe for the stated reason. Two corners I checked that also hold: Path.startsWith on Windows compares whole components case-insensitively (WindowsPath.startsWith → regionMatches(true, …)), and a junction to another volume fails on the root component (D:\ vs C:\) rather than sneaking through a string compare. Equality (child == root) is also true under Path.startsWith, matching resolveFile's explicit resolvedCanon.path == root.path arm.

Windows junctions: the isOther claim is right for the reason that matters, not just empirically. WindowsFileAttributes.isOther() returns true whenever FILE_ATTRIBUTE_REPARSE_POINT is set and isSymbolicLink() is false, and isSymbolicLink() is reparseTag == IO_REPARSE_TAG_SYMLINK - so a junction is isOther && isDirectory && !isSymbolicLink. Both flags from one readAttributes is the right call, and failing true on an unreadable attribute is the right direction.

Path spelling: relativize over two paths in one spelling is correct, and holds even for an un-normalized projectPath (/a/b/../proj), because relativize is lexical and both sides carry the same literal prefix. Keeping IndexedFile.path on the absolute spelling is the right call and for the reason resolveFile:299-304 records - the editor keys open buffers by the path a tab was opened with.

One behaviour change worth confirming is intended (it looks intended): a root-resolution failure now clears the index and stamps _indexedPath, where before the canonicalPath throw propagated to indexProject's catch and left the previous index in place. Since indexProject only short-circuits when _indexedFiles is non-empty, a retry still re-attempts, and the pre-existing "Invalid project path" branch already behaved this way - so this is consistent rather than sticky.


1. isSkipped pays a stat before the name test, and the KDoc says otherwise

FileIndexer.kt:232-238

child.name.startsWith(".") ||
    (child.isDirectory && child.name in excludedDirectories) ||
    !isConfined(child, root)

The KDoc above it says "the two cheap name tests run first". child.isDirectory is a filesystem stat, not a name test, and it is paid for every entry in the tree - including every regular file, which can never be in excludedDirectories. Reversing that one conjunct is result-identical and pays the stat only for entries actually named build, node_modules etc.:

(child.name in excludedDirectories && child.isDirectory)

The ordering was the same before this PR, so this is not a regression - but the new KDoc now asserts a property the code does not have, and the PR is making a performance argument about exactly this loop. Fix this →

2. On a OneDrive-synced project, the gate matches every entry

Because isOther() is "any reparse point", a Files-On-Demand cloud placeholder file carries FILE_ATTRIBUTE_REPARSE_POINT and reads as a link. On a project folder under OneDrive - a very common Windows setup - the link gate therefore matches essentially every entry and the walk degrades to the "resolve unconditionally" case the PR measured at 1.1-1.2x the old cost, not the 0.048x headline.

Correctness is unaffected (a placeholder's toRealPath is identity, so it stays confined), so this is not a defect. But the isLink KDoc is the place a future reader will look before re-measuring, and it currently implies the resolve is rare. One sentence there would save that work.

3. linkDirectory uses the bare-catch pattern the sibling test explicitly warns against

FileIndexerConfinementTest.kt:32-37

runCatching { Files.createSymbolicLink(link, target) }.isSuccess || junctionDirectory(link, target)

ResolveFileConfinementTest.kt:63-79, in this same package, narrows its catch to UnsupportedOperationException and FileSystemException with a comment saying why: "A bare catch (e: Exception) swallowed every error, including a link that failed to be created for a different reason - in which case the assertNull below would have 'passed' without testing anything."

Here the failure mode is a green skip rather than a false pass, which is better - but it is the same loss. On Linux and macOS (where these two tests are the ones that actually run in CI, since the junction fallback is Windows-only) any unexpected IOException silently becomes assumeTrue(false) and the confinement assertions never execute. Narrowing the catch the way the neighbour does, and adding an assertTrue(link.exists()) post-condition after a reported success, closes it.

4. A failed mklink skips with no diagnostic, and waitFor() is unbounded

FileIndexerConfinementTest.kt:44-51: redirectErrorStream(true) merges stderr into stdout and redirectOutput(Redirect.DISCARD) then throws the merged stream away - so on the one platform this fallback exists for, a junction that fails to create yields a bare "host supports neither a symlink nor a junction" with the actual reason discarded. Capturing the output into the assumption message costs a line. waitFor() also has no timeout; waitFor(timeout, unit) would keep a wedged cmd from hanging the run.

5. Nothing pins the false-negative direction

All three tests assert exclusion or path shape. None asserts that a link whose target is inside the project is still indexed - so mutating isConfined to !isLink(child) (reject every link outright) passes the entire new suite, while quietly dropping in-project links from Spotlight for every user. Given the PR's own "Known limits" section turns on precisely which links survive, that case is worth pinning.

Related: test 1 covers a directory link only. A file symlink pointing outside the project reaches the index through a different branch (passesExtensionFilter + relativeToRoot at FileIndexer.kt:213-220) than directories do, and that branch is currently unexercised for a link. ResolveFileConfinementTest uses a file symlink (link.txt) for its equivalent case.

A cheaper route to both, and to the sibling-prefix and cross-drive cases: isLink, resolvesInsideRoot and IndexRoot are file-private, so today the only way to reach any of them is a real link on a real filesystem - which is what forces the assumeTrue skips in the first place. Making them internal would let those predicates be pinned directly, unconditionally, on every platform. Fix this →

6. Two smaller notes

  • resolveRoot's fail-closed path is new and untested. Hard to provoke portably, so I am noting it rather than asking for it.
  • relativeToRoot's IllegalArgumentException catch is unreachable by construction, and does not cover what it might look like it covers: relativize does not throw for a non-prefix path, it returns a ..-prefixed result. Fine as belt-and-braces - just don't read it as a guard against a child outside the root.

7. Adjacent, pre-existing: GlobalSearchService splits relativePath on '/'

GlobalSearchService.kt:334 - file.relativePath.lastIndexOf('/') + 1. relativeToRoot emits File.separator, so on Windows this is -1, fileNameStart is 0, and the path-match highlight ranges are computed against the whole relative path instead of the file name. Not a regression - the old substring produced \ too - and correctly out of scope for this PR. But this PR is the producer, and the new assertion at FileIndexerConfinementTest.kt:111 ("src${File.separatorChar}Main.kt") is what makes the mismatch explicit. Worth a follow-up issue rather than widening this diff.


Things done right that I'd have flagged if missing

  • Failing closed on an unreadable attribute (isLink → true) and on an unresolvable root, in a file whose whole point is a containment check that used to pass everything.
  • Keeping the absolute spelling for path and relativePath, with the tab-keying reason recorded - the resolveFile:299-304 trap (a canonical path making readBuffer miss a buffer under a symlinked checkout, then clobbering it on save) is exactly the mistake available here.
  • Removing the three detekt-baseline.xml entries instead of re-keying them to the new signature.
  • Naming the TOCTOU window, the broken-link skip and the self-referential-link re-walk in the description up front rather than leaving them for review.
  • Not folding this into a shared helper with ContentSearchService.resolveFile while fix(search): prevent lost updates in concurrent replacements #628/Fix/concurrent project replacements silently undo a completed replacement #625 are in flight, with the reason stated. Agreed - and when it happens, resolveFile's two-stage canonical-then-real check is the weaker half (its broken-symlink fallback is documented at ContentSearchService.kt:285-291), so the shared helper should be shaped on this PR's version, not on that one's.

Verdict: the production change reads correct to me. Findings 3, 4 and 5 are the ones I would want addressed before merge, since 5 leaves the fix's own intended behaviour unpinned; 1, 2, 6 and 7 are comments and follow-ups.
• fix/file-index-project-confinement

@kshivang

Copy link
Copy Markdown
Contributor

Resolved the review findings in c87b61e:

  • 1: excluded-directory names are checked before the directory stat.
  • 2: documented that other reparse points/cloud placeholders also require resolution, so the fast-path benefit depends on the tree.
  • 3: symlink setup now catches only UnsupportedOperationException and FileSystemException, matching the sibling test; successful directory/file links have an existence assertion.
  • 4: mklink output is retained for failure diagnostics, and process waiting is bounded to ten seconds with cleanup.
  • 5: added end-to-end tests for an internal directory link remaining indexed and an external file symlink being excluded. The linked-root test also pins the original absolute path spelling.

The private helpers remain private: testing them directly would still need real filesystem links and would not eliminate platform setup. The public index output provides stronger integration coverage. Root resolution clearing stale results is intentional and still permits retry; relativeToRoot is display derivation, not the containment boundary. The adjacent Windows highlight separator issue predates this PR and is recorded as cross-group follow-up context, without widening this change.

The contributor's original three tests passed locally, and all three failed against current dev's unchanged FileIndexer on macOS. The new test/ordering/documentation changes are review-agent repairs; Vidhaankhare16 retains credit for both original fixes, the path model, and original regressions. Current-head validation is running; no second Claude request is needed for these bounded responses.

@kshivang

Copy link
Copy Markdown
Contributor

@Vidhaankhare16 Your change usefully fixes two real Spotlight defects: project-boundary escapes through links and incorrectly sliced display paths. I reproduced all three original regression failures against current dev on macOS, and the original implementation fixes them. Your original commit and attribution are preserved.

I integrated current dev and addressed Claude's requested test/setup improvements in c87b61e. All five focused tests now pass locally with zero skips, and composeApp ktlintCheck/detekt pass. Claude's substantive findings are resolved with evidence in the review response above. No unresolved production correctness/security/regression defect was found in this change.

I am moving this to draft solely because current-head hosted validation has not completed within this review's bounded window: https://github.com/risa-labs-inc/BossConsole/actions/runs/34821641913 . Code quality, pgTAP, shell tests, version and BOSS AI contracts passed; Linux/Windows builds and compatibility remain running, and macOS is queued. This is an infrastructure/validation handoff, not an author defect. The current run is left running; only the superseded-head run was cancelled.

Next steps: wait for that exact-head run to finish; investigate any actual failures with their logs, separating shared-base/infrastructure failures from this diff. Confirm the five FileIndexerConfinementTest cases pass on supported runners (file-symlink setup may legitimately skip without Windows privilege), plus the full hosted required checks. Then mark ready and merge only to dev after refreshing dev/mergeability under the merge lock with the reviewed head match. No additional feature implementation or repeated Claude request is needed for the resolved findings. Optional installed-app visual check: Spotlight should omit outside linked files, retain inside linked files, and show src/Main.kt intact when the project root is reached through a link. That UI check has not been claimed here.

@Vidhaankhare16

Copy link
Copy Markdown
Contributor Author

Thanks for the review and for pushing the repairs in c87b61e. The findings are fair. Finding 1 in particular is mine to own: child.isDirectory is a stat, not a name test, and I wrote a KDoc asserting "the two cheap name tests run first" in the exact loop this PR makes a performance argument about. Your reordering is right, and so is the cloud-placeholder note, which is the case my 0.048x measurement does not represent. The two tests you added for the preserved-link direction close the real gap: my suite only pinned exclusion, so a mutation of isConfined to reject every link would have passed it while silently dropping in-project links from Spotlight.

On the current CONFLICTING state, in case the diagnosis saves you a step. The branch is not conflicting on content. It carries the merge commit a15c25b plus a4b91fb and 8e05bf6, and dev has since been rewritten to a3f4b7f, so those commits are no longer on it. I checked that the work in them is not lost: 3c57809 (#649) carries TerminalCommandApprovalQueue.kt, and dev's BossAppEventBusEffects.kt:149 already has the enqueue-before-log ordering from 8e05bf6. So replaying only 3e8b8a0 and c87b61e onto a3f4b7f drops nothing of yours.

I have that replay prepared and verified locally: both commits cherry-pick cleanly onto a3f4b7f with no conflicts, the result is the same three files, and your authorship and empty trailers are preserved on c87b61e.

I have not pushed it, for a reason worth stating rather than guessing at. Every push of mine on this branch (7e2cfac, 838ac0f, 3e8b8a0) landed at action_required and ran no jobs; the green six-job run exists because you pushed c87b61e. Force-pushing now would discard that green run and replace it with one blocked on your approval, while you had validation in flight on the head I would be overwriting. Say the word and I will push the rebase, or take it yourself if that is simpler.

Two smaller replies to the review, neither asking for anything. The relativeToRoot IllegalArgumentException catch is belt-and-braces exactly as you read it, and you are right that relativize returns a ..-prefixed path rather than throwing for a non-prefix input, so it should not be read as a containment guard. And on the shared helper with resolveFile, I agree it should be shaped on this PR's version rather than that one's, for the reason you give.

The GlobalSearchService.kt:334 separator issue is pre-existing and I agree it stays out of this diff. I am happy to open it as a separate issue with the measurement, if you would rather have it tracked than left in this thread.

No merge or auto-merge is authorized.

@Vidhaankhare16

Copy link
Copy Markdown
Contributor Author

The exact-head run you were waiting on has finished green: https://github.com/risa-labs-inc/BossConsole/actions/runs/34821641913 is completed / success on c87b61e, all ten jobs, including build-test on windows-latest, macos-latest and ubuntu-latest, plus code-quality, compatibility-test, version-check, pgTAP, shell tests and BOSS AI contracts. That was the sole stated reason for the draft, so I am marking this ready for review.

One thing I could not confirm from here, so I am not claiming it: whether any of the five FileIndexerConfinementTest cases skipped on the hosted runners. The job logs surface Gradle task lines rather than per-test results, and the file-symlink case can legitimately skip without the Windows symlink privilege, which is the reason the junction fallback exists. You already reported zero skips locally; the hosted per-test view needs the test artifacts, which you can reach and I cannot.

I have deliberately not rebased. The branch is still at the head you reviewed and validated, which is what "the reviewed head match" needs, and the dev/mergeability refresh under the merge lock stays yours as you described. The CONFLICTING flag is the stale history described in my previous comment, not a content conflict: replaying only 3e8b8a0 and c87b61e onto current dev applies cleanly, and I have that verified locally if you want it pushed instead.

Worth noting that a push from me cannot help here anyway: every push of mine on this branch landed at action_required and ran no jobs, so rebasing now would trade this green run for one blocked on your approval.

No merge or auto-merge is authorized.

@Vidhaankhare16
Vidhaankhare16 marked this pull request as ready for review September 14, 2026 12:31
@kshivang

Copy link
Copy Markdown
Contributor

@Vidhaankhare16 Thank you for the component-aware real-path confinement and walk-relative display paths. I rechecked your revisions and the prior repair: the five regression cases and the accepted-link direction are useful, and all ten checks on c87b61e are now green. The earlier pending-CI finding is closed.

The remaining blocker is integration after dev history changed, not a newly found flaw in your confinement algorithm. The published head currently conflicts in .gitignore, BossBottomBar.kt and McpPolicyEngine.kt. I verified your suggested replay: only 3e8b8a0 and c87b61e apply cleanly onto dev 6004233, producing just the intended three-file search change (local replay 952801d9b). I did not overwrite your branch.

Since that check, #593 has merged into dev as 5dc8211. Comparing the replay with that dev now produces the expected conflicts in FileIndexer.kt and composeApp/detekt-baseline.xml. Concrete next steps: replay the two search commits onto fresh dev, retain #593's suspend scanner signatures and ensureActive() checks at scan entry and each child, retain its mutex/cancellation handling and injectable scan seam, and combine those with your IndexRoot/isConfined/relativeToRoot helpers. The old complexity baseline entries should disappear where your decomposition removes them; do not restore obsolete non-suspend signatures.

Validate the combined result with FileIndexerConfinementTest, FileIndexerTest, SpotlightFileIndexOwnerTest and the full search-package suite, plus ktlint/detekt and required hosted CI on the new head. Previous green CI cannot validate that new integration. This sweep's shared-build-lock attempt did not acquire the lock; no new Gradle result is claimed. Prior local five-test/no-skip evidence remains valid for the old head.

I am returning this to draft for that precise integration/validation handoff under the bounded-review policy. No source changes or force push were made to your branch. #593 session ownership and #670 provider forwarding are complementary, not duplicates. Manual Spotlight checks through a linked root, internal links and external sibling links remain unperformed. Once integrated and green, mark ready for an exact-head, lock-serialized squash merge to dev.

shivanshu-risa and others added 9 commits September 14, 2026 19:43
…on bridge (risa-labs-inc#634)

* fix(overlays): honor RTL and fractional placement (#477)

* Stop anon reaching schema public by inheritance, and scope identity to real orgs

The BOSS Supabase anon key is compiled into this repo, which is public. Anything
`anon` can execute is therefore executable by anyone. Verified on 2026-09-08:

  * get_encryption_key() returned the Vault master encryption key, unauthenticated.
    decrypt_text() was anon-callable beside it, making a decryption oracle over
    everything encrypt_text protects - user secrets and the QBO/Google broker
    credentials.
  * find_user_by_email() confirmed any address and returned its uuid.
  * list_shareable_recipients() returned 152 users WITH full email addresses to
    any self-registered account, and 82 @risalabs.ai addresses on a search.
  * arcade_leaderboard() and arcade_bs_standings() published the roster of
    everyone who had opened the Arcade, unauthenticated.

None of it was granted on purpose. PostgreSQL hardwires EXECUTE to PUBLIC on
every new function, PUBLIC includes anon, and this project's default privileges
add anon on top - so a SECURITY DEFINER function is internet-callable from the
moment it is created. Both revokes are traps in mirror image: `from public`
leaves the explicit anon grant, `from anon` leaves the hardwired PUBLIC one, and
ALTER DEFAULT PRIVILEGES cannot remove the latter at all (pg_default_acl loses
the entry and new functions still get `=X`).

  20260908000000  event trigger: revoke PUBLIC+anon on every function created in
                  schema public. An explicit `grant ... to anon` after the create
                  still wins - anon access must be stated, never inherited.
  20260908010000  org_visible_users / org_is_vetted / user_display_name: ONE
                  definition of "may this account learn who that account is",
                  shared by the Arcade and poker rather than copied. Vetted means
                  a human approved the join, which excludes the catch-all `boss`
                  org every account joins on signup (153 members, 20 domains).
  20260908020000  route list_shareable_recipients through both. It was already
                  org-scoped, which is why it looked right; it accepted ANY
                  shared org.
  20260908030000  one-time sweep of the ~30 functions that already had the
                  inherited grant. The RBAC mutators fail closed
                  (is_user_admin(NULL) is false), so this is defence in depth,
                  not a patched escalation.

The rule is a SET, not a per-target predicate: as a per-row qual it is pushed
below a DISTINCT ON and evaluated once per underlying row - 2.7s over 29k score
rows for 45 players, against 37ms.

supabase/audit/identity_disclosure_audit.sql is the standing check, because "we
fixed the leak" is not a durable claim. All four checks report HEALTHY.

Left deliberately anon-callable, each documented where it is kept: the plugin
store browse API, the three helpers called from RLS policies on anon-readable
tables, and custom_access_token_hook. Verified after the sweep that anonymous
plugin-store browse and signed-in RBAC reads both still work.

Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>

* Add the master-key rotation procedure, and rotate

get_encryption_key() was anon-callable, so the Vault master_encryption_key was
retrievable by anyone holding the project anon key - which ships compiled into
this public repo. Revoking access does not un-disclose a key, so it was rotated
on 2026-09-09 and the 184 rows encrypted under it re-encrypted.

Scope of the original exposure, stated precisely because the capability was
worse than the reach: decrypt_text() was anon-callable beside it, so an attacker
holding ciphertext from ANY channel - a backup, an export, a screenshot - could
decrypt it through the API without even needing the key. But no bulk read path
to that ciphertext existed: qbo_token_state and google_token_state have no
client grants at all, and all 178 secrets rows have org_id NULL, so the secrets
policy reduces to owner-only. This was a serious latent vulnerability - one
org-shared secret, one RLS slip, or anyone with backup access would have had
plaintext - rather than a confirmed bulk disclosure.

The script is kept because rotation is not a one-off. It is atomic (one DO
block), self-verifying (md5 of every row's plaintext captured before, re-derived
after through decrypt_text so the check covers both the swap and the data), and
a mismatch or row-count drift raises and rolls back, so a broken rotation cannot
commit. Verified after the run: the live key differs from the disclosed one,
184/184 rows decrypt under it, and the disclosed key opens 0 rows.

The old key is retained in the Vault under an explicit name. Do NOT delete it
while pre-rotation backups exist - they are encrypted under it.

Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>

* fix(db): close signed-in crypto access and verify visibility boundaries

* test(db): exercise repeated key rotation and exact anonymous ACLs

* test(db): grant fixture role membership on Supabase Postgres

* test(db): inline rotation source for isolated pgTAP mounts

* test(db): keep generated rotation SQL out of source control

* fix(db): reserve identity-taking store mutators for the edge service

* fix(db): serialize rotations without requiring direct Vault writes

* fix(db): address review gaps in system-org and rotation coverage

* test(db): verify core secrets across hex and broker-free rotations

* test(db): execute standing audit and missing-signature regression

* fix(db): enforce revoke postconditions and harden rotation verification

* test(db): enable recovery metadata in the authenticated fixture

* test(db): use the schema-supported authenticator type

* Address remaining database review quality findings

* Fix invoker view audit boolean parsing and test timestamp bounds

* Rotate the TOTP envelope, exempt extension routines, and close the repo/prod drift

Addresses the handoff's database-integration item and the substantiated findings
from the current-head review. Everything below was executed against the PR's own
Supabase preview branch, not asserted from reading.

**The blocker: rotation refused to run once #417 landed.** The guard was a
blanket "TOTP is installed, refuse everything". It is now an adapter. The stored
form is 'v1:' || encrypt_text(...) - same cipher, same key, only the framing
differs - so the column map gained an envelope prefix and rotates like the rest
once the prefix is stripped and re-applied. Three things this needed that reading
the diff would not have shown:

  * #417's trigger RAISES on a v1: value ('TOTP input must be plaintext, not a
    storage envelope'), so the re-encryption update is rejected outright. The
    reviewed trigger is now disabled for the update and restored after, inside
    the same transaction.
  * safe_decrypt_recovery_codes returns jsonb, not text, so verification through
    the real read path needed a cast. Both fingerprints now go through each
    column's OWN application read path rather than decrypt_text, which also
    removes the step-1/step-5 asymmetry raised as U5.
  * a step 0 pre-check reports rows that are already unreadable, instead of
    letting a safe_decrypt_* NULL surface at the end as "a row was missed".

The rejection contract is preserved, not removed: an unknown envelope version,
an unmapped safe_decrypt_* wrapper, or an unreviewed BEFORE trigger on a mapped
table each still refuse. All three are now regression-tested, along with the
recovery-code column that was previously never exercised (its fixture was
vacuous - create_secret writes no secret_metadata row without p_twofa_enabled).
Verified: three consecutive rotations, TOTP/recovery/password all intact, v1
envelope preserved, trigger re-enabled and still enforcing its own contract.

**CREATE EXTENSION was impossible.** The fail-closed guard aborted the first
routine of any extension installed into public: `create extension pgtap` failed
with "Anonymous EXECUTE remains on public.pg_version()". A guard that forces
operators to disable it in order to install an extension is a guard that ends up
disabled. Extension-owned routines are now exempted with a warning, and the
exposure stays visible as advisory CHECK 1x rather than vanishing - it reports
pgtap (1079) on the preview. The sweep skips them too: pgcrypto-style helpers
are called from column DEFAULTs and CHECK constraints, which are evaluated with
the DML role's privileges. No extension owns a function in public on a clean
database, so no deployed behaviour changes.

**The repo was weaker than production.** find_user_by_email, get_session_status
and update_api_key_last_used were locked down on the live project on 2026-09-08
but never captured as a migration, so a fresh deploy re-opened them.
find_user_by_email is a user-enumeration oracle over auth.users and signup is
open. The standing audit caught this itself on the preview - CHECK 2 named it -
which is the drift that check exists for. Both remaining callers use
SUPABASE_SERVICE_ROLE_KEY, verified on this branch, so service_role keeps
EXECUTE and neither path changes.

Also: the guard no longer hard-fails on a database without the Supabase roles (a
plain restore), and the vault fixtures no longer assume the key is absent (U3) -
both suites failed outright on any database that already had one. Retained-key
assertions measure this run's delta instead of an absolute count.

Suites on the preview: rotation 16/16, db access audit, and visibility 54/54 all
clean; the standing audit reports no failing gated check.

Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>

* Exercise the anonymous read path, not just the grant

The keep-list assertions only checked has_function_privilege for the seven
allowlisted signatures. That proves the grant, not the path: an RLS policy
expression is evaluated as the QUERYING role, so revoking a policy helper turns
an anonymous SELECT into 'permission denied for function ...' rather than an
empty result, and no privilege assertion can see it.

The seeding is the part that matters. A policy expression runs PER ROW, so on
an empty table it is never evaluated - and plugins and user_roles are both empty
on a fresh database, which made the first version of this probe pass no matter
what had been revoked. Caught by trying to make it fail.

Sensitivity is stated from measurement, not assumption: with a row present,
revoking can_view_plugin_row from anon does fail the probe and revoking
authorize does not, because permissive policies are ORed and short-circuit. A
helper in a policy that never has to be evaluated cannot be detected this way by
any test, so the comment says so rather than implying broader coverage.

Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>

* Make the gated audit checks and the test generator provable

Both halves of this are the same failure: a suite that is green while proving
nothing. I hit that twice writing the previous commits - a recovery-code fixture
over a secret_metadata row create_secret never wrote, and an anonymous-read
probe over an empty table whose RLS policy therefore never evaluated - so these
are not hypothetical.

Finding 6. The four CI-GATED checks (1, 1b, 4, 5) only ever asserted HEALTHY,
while every advisory check already had a fixture-based detection test. An
inverted `not exists`, a wrong role literal or a typo in the evtenabled test
would have left the gate permanently green. Each is now broken deliberately and
asserted to report it: a routine granted to anon AFTER creation (which is how
one gets past the event trigger), a revoked deliberate anonymous grant, a
disabled event trigger, and a crypto routine exposed to authenticated. They have
teeth by construction - the assertion is that the finding appears, so a broken
audit query fails them.

Finding 8. The generator gained --check, which regenerates in memory and
compares without writing, and orphan removal for a generated suite whose .sql.in
has been renamed or deleted - that file otherwise keeps being executed forever
with stale content. Orphans are identified by a provenance banner rather than a
hard-coded list, so a hand-written suite is never touched; verified that
explicit_anon_and_org_visibility_test.sql is untouched. Each guard was proven by
making it fire: a hand edit and a planted orphan are both reported by --check,
and generate removes the orphan.

CI now runs generate and --check as their own step, so a preparation failure is
visible in the log instead of being attributed to the test run.

Preview: rotation 16/16, db access audit 15/15, visibility 56/56.

Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>

* Announce every project change, not only the plugin-initiated ones

Panels could come up empty and stay empty, and the reason was that the
startup restore told no one.

ProjectChangeEvent was published from ProjectDataProviderImpl.selectProject,
which is the path a PLUGIN takes. The two callers that matter most bypass
it: WorkspaceApplier.applyWorkspace calls windowProjectState.selectProject
directly when it restores the workspace, and BossTopBar's picker goes
through selectProjectInWindow. Neither published anything.

The ordering that produced the empty panel: DefaultPlugin is constructed in
a DisposableEffect keyed on registries and window state, not on
selectedProject, and it kicks off the plugin scan asynchronously while
BossAppScaffold composes and the sidebar builds panels immediately. The
restore meanwhile waits on WorkspaceManager's sequential Dispatchers.IO JSON
reads. When those reads are slow the panel is built first, reads the ""
that WindowProjectState seeds itself with, and renders its no-project state.
The restore then lands, silently, and nothing remounts the cached component.

Publishing from the state itself rather than from one caller catches all
three. The bus is MutableSharedFlow(replay = 0), so a publish that never
happens cannot be recovered by a later subscriber - which is why this could
not stay per-caller.

The publish is removed from selectProject rather than added alongside the
collector; keeping both would double-fire on the plugin path.

previousPath is seeded from the current value so the StateFlow's replay of
it is not announced as a change. That seed is "" at startup, and telling
every plugin the project just became "" moments before the real restore
arrives is precisely the clear-yourself signal worth avoiding.

One collector per window: projectDataProvider is `by lazy` on DefaultPlugin,
which is per-window, so this cannot stack.

Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>

* Publish from the state's own callback, not from a lazily-built provider

The review's finding 1: observing `selectedProject` from `ProjectDataProviderImpl`
put the fix behind two `by lazy` initializers. `projectDataProvider` and
`applicationEventBus` are both lazy on `DefaultPlugin`, and the second is the only
host path that creates the bus at all. So the collector started only if some plugin
touched both before the workspace JSON reads finished - and "the reads are slow" is
the premise of the bug. Touched after the restore, the collector seeds to the
restored path and announces nothing; never touched, no caller is announced at all.

The announcement now hangs off the `ProjectSelectionCallback` that
`WindowProjectStateRegistry` installs when it builds the window's state, which
`BossAppState` does eagerly in composition. `WindowProjectState.selectProject` is
the sole mutator of the selection and invokes that callback synchronously, so every
caller is covered with no coroutine, no scope and nothing lazy in the path. Being
synchronous also makes `previousProjectPath` a faithful history rather than
best-effort: there is no StateFlow conflation to collapse A -> B -> C into A -> C.

The two registry entry points carried a copy of the wiring each; they now share one
`newState`, so the announcement cannot be installed on some windows and not others.

Finding 1's third mitigation, which is a hole of its own: `publishSystemEvent` was a
no-op whenever the bus had not been created, so on a build where no installed plugin
had touched `applicationEventBus` yet, no host event existed - not `ProjectChangeEvent`,
not `AuthEvent`, not `TabEvent` - and with `replay = 0` none could be recovered.
It now creates the bus instead of dropping. `getInstance` also re-checks the registry
on every call rather than only at creation, so an instance that exists while the
registry is empty can no longer strand the host's publisher.

Findings 2 and 3: `ProjectDataProviderImpl` implements `DisposableProvider` and
`DefaultPlugin.dispose()` releases it through a named delegate, alongside
`logDataProviderDelegate` and `gitDataProviderDelegate`; its scope gets a
`SupervisorJob`, matching `pluginScope`.

Tests: `ProjectChangeAnnouncementTest` (6) pins a direct `selectProject` being
announced, the previous-path chain, the seeding rule, the same-path suppression,
both registry entry points, and the bus being created rather than dropping the event.
Full `:composeApp:desktopTest` green: 3695 tests, 0 failures. `detekt ktlintCheck` clean.

Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>

* Round 2: honest bus wording, atomic previousPath, three more tests

Review (1/2) and (2/2).

1. `publishSystemEvent` does not save the event it creates the bus for. Correct - no
   registered publisher means nobody holds the bus, so it has no subscribers and that
   first event still reaches no one. The comment, the test name and the PR body all
   claimed otherwise. Reworded to what it actually buys: the host stops being
   permanently silent while it waits for a plugin to touch `applicationEventBus`.

3. `previousPath` was check-then-act on a plain field, and
   `ProjectDataServiceBridge.selectProject` is a suspend gRPC handler with no hop to
   Main (verified: `KernelBootstrap` registers it, the bridge calls
   `provider.selectProject` directly). Now an `AtomicReference.getAndSet`, so the read
   and the write are one operation.

5. The registry read-modify-write moved back inside `synchronized(this)`. Both fields
   are in fact `@Volatile` in boss-plugin-api 1.0.87 (checked the pinned jar), but the
   lock is uncontended after the first call and removes the question. The
   bus-before-publisher ordering is now written down, including why a publish landing
   in that window loses nothing.

6. `initialPath` KDoc no longer describes a production scenario it cannot reach; it is
   documented as defensive and test-reachable, and defaulted to "".

7. Three tests added:
   - a plugin-initiated selection is announced exactly once (catches both a silent
     regression to zero and an accidentally re-added publish);
   - the registry test now asserts the recent-projects half of the callback ran -
     deleting it from `newState` previously left every test green;
   - `dispose()` stops the recent-projects collector, which is the whole reason
     `projectDataProviderDelegate` became a named lazy.

   `Dispatchers.setMain(UnconfinedTestDispatcher())` for the class: the provider
   collects on `Dispatchers.Main`, which has no implementation in a plain test JVM, so
   its collector silently never ran. Unconfined also makes the dispose test
   deterministic rather than a sleep.

Smaller: `SupervisorJob` comment describes it as future-proofing (there is one
collector); `systemEventBusScope` is `by lazy`; the KERNEL-mode consequence of
disposing the provider is documented on `dispose()`.

Not taken: `replay = 1` for `ProjectChangeEvent`. It would close the mirror race, but
it changes `events()` semantics for every subscriber and every event type on a bus
whose consumers are out of tree. The body now says the race is narrowed rather than
closed, and names the api-side `selectedProject` StateFlow as what closes it.

`:composeApp:desktopTest` 3697 tests, 0 failures. `detekt ktlintCheck` clean.

Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>

* Round 3: unconditional announcement, ordered publish, drop dead register

Review 3.

2. AGENTS.md: a bullet in the canonical "what a third-party plugin can observe"
   paragraph, since this widens *when* a filesystem path reaches every installed
   plugin.

3. The `expect` KDoc still said "a no-op if the bus has not been created yet". Only
   the `actual` had been corrected. Fixed, and it now states the part that IS still
   best-effort: replay = 0 means an unsubscribed event is gone either way.

4. The announcement sat downstream of `ProjectState.updateRecentProjects`, so a throw
   there skipped it AND left `previousPath` stale - every later selection reporting a
   previous path one step behind, silently, for the session. Now `try { recents }
   finally { announce }`: order preserved for anyone reading recents off the event,
   the announcement unconditional, the throw still propagating.

5. `getAndSet` closed the read-modify-write but not the publish order, so two
   concurrent selections could emit out of order. `previousPath` and the publish are
   now in one `synchronized` block (the AtomicReference is gone - the lock subsumes
   it). The KDoc says plainly what this still does not settle: `WindowProjectState`
   writes `_selectedProject.value` then calls the callback with no atomicity, so state
   and last event can still disagree. Closing that means locking upstream.

6. `ProjectState`'s async `loadRecentProjects()` assigns `_recentProjects.value`
   wholesale and could land mid-test, dropping a just-added path - only where
   `~/.boss/recent-projects.json` exists, so a developer-machine-only flake. A
   once-per-JVM settle in `@BeforeTest` puts that single file read before any test.
   The test paths stay deliberately non-existent, now with a comment saying why: the
   fire-and-forget saves are unordered, and `loadRecentProjects` reclaims entries whose
   directory is gone, so a real temp directory would leak where these self-heal.

7. `register` deleted. No production caller (`BossAppState:299` uses `getOrCreate`),
   and it overwrote an existing entry - handing back a state with a fresh announcer
   seeded to "" for a window that already had a project. `newState` stays; it is what
   keeps the wiring from drifting.

8. `@Volatile` dropped from `ApplicationEventBusImpl.instance` - every access is inside
   the lock now, and leaving it reads as if a fast path survives.

Also: a test for the actual regression path, `applyWorkspace` announcing the project it
restores, rather than a comment claiming to imitate it.

Answering the grep you could not run: the only `projectChanges()` consumers in
boss_plugins are the two fluck-agent panels (`FluckAgentViewModel`), and both assign
`_bossProject.value` and re-sweep - idempotent on a repeat. Nothing used the repeat
publish as a reload nudge. Recorded in the announcer comment.

Item 1 was already in the PR body from round 2 ("The startup race is narrowed, not
closed"), naming the mirror case and the api-side StateFlow that closes it.

`:composeApp:desktopTest` 3698 tests / 368 classes, 0 failures. `detekt ktlintCheck` clean.

Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>

* Round 4: split the dispose out, stop tests writing the real ~/.boss

Review 4. Items 1 and 3 were the before-merge ones.

1. Verified: ProjectDataServiceBridge.watchRecentProjects collects
   provider.recentProjects, a StateFlow, so cancelling the provider's scope on
   window close leaves that gRPC stream open and silently frozen for every
   out-of-process plugin. Taking the first option and SPLITTING the dispose out.

   Note this reverses what round 1 asked for, and the justification changed rather
   than the opinion: once the announcement moved to the registry callback,
   ProjectDataProviderImpl went back to being exactly what it was before this PR, so
   the leak is pre-existing and unrelated to the subject. Closing it properly means
   the bridge reading ProjectState directly instead of a per-window provider, which
   is its own change. The reasoning is on the class so it is not re-fixed by accident.

3. Verified and worse than described: MAX_RECENT_PROJECTS = 10, so test entries evict
   real ones from the developer's picker and no cleanup restores them.
   systemProperty("user.home", <build>/test-home) on the Test task. One run with it in
   place shows the existing suite was writing far more than recents to the real home -
   window-appearance-settings.json, keymap-settings.json, scrollbar-settings.json,
   recent-browser-pages.json, dashboard-stats.json and a ~/BossProjects/ directory all
   land in test-home now. The settle is gone with it: no recent-projects.json in
   test-home means the wholesale reload never happens.

2. publishSystemEvent now refuses the bus != null && systemPublisher == null state
   instead of falling through into a bus that may not be the registry's, with one
   warning rather than one per event. The comment at the fallback is true as written.

4. Both stale comments fixed (one construction path, not two).

5. hostProjectCallback(updateRecents, announcer) extracted so the try/finally claim is
   testable - ProjectState is an object, so a hard-coded call cannot be made to fail.

6. The publish-inside-the-lock trade is spelled out in the KDoc: what it buys
   (ordering), what it costs (an inline subscriber runs holding the lock inside
   selectProject), and that the contended path is untested.

7. The serial-execution dependency is recorded in the test class KDoc.

Plus: multi-window isolation, and a test that makes the recents update throw.

One thing this round caused and fixed: removing dispose() left two
ProjectDataProviderImpl collectors alive on the test dispatcher. On a
TestCoroutineScheduler a live coroutine is something every later runTest waits on, and
the git classes timed out at 60s in full-suite runs while passing in isolation.
Dispatchers.setMain(Dispatchers.Unconfined) rather than UnconfinedTestDispatcher():
same inline behaviour, not enrolled in a scheduler anyone else observes. It is also a
real argument for the follow-up - without dispose() the provider cannot be constructed
in a test without leaking.

:composeApp:desktopTest 3699 tests / 368 classes, 0 failures. detekt ktlintCheck clean.

Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>

* Round 5: reset test-home per run, stop getInstance stealing a publisher

Review 5.

1. Confirmed reproducibly - build/test-home/.boss/recent-projects.json was sitting
   there from the previous run. doFirst now deleteRecursively() before mkdirs(), so
   the home is fresh per run rather than merely private. Without it the redirect only
   helped the first run and ProjectState.init's load reintroduced the same race from
   the second. Verified by running the full suite twice back to back.

2. Right, and sharper than it looks: the guard tested `bus` but wrote both fields, and
   `systemPublisher != null && bus == null` is exactly what ProjectChangeAnnouncementTest,
   BrowserAnalyticsEmissionTest and BossTabsComponentMoveTest install. Guard now tests
   both, so getInstance cannot take a publisher away from whoever set it.

3. Test added for the warn-and-drop branch, asserting the DROP rather than the warning -
   partialRegistryWarned is a one-shot process global, so "it warns" is unassertable
   after the first test to trip it. Uses a stub bus so the half-registry state is real.

4. The re-entrancy hazard is now documented as SAFE and why (synchronized is reentrant,
   previousPath advances before the publish), so it is not "fixed" later. The
   lock-widens-a-UI-hang-to-a-cross-thread-one point is in the same block.

5. Taken, including the optional ones:
   - hostProjectCallback keeps both failures (addSuppressed) instead of letting finally
     discard the first. Needs @Suppress("TooGenericExceptionCaught") - catching
     Throwable is the contract, and both are rethrown.
   - ProjectDataProviderImpl takes an injectable dispatcher (default Dispatchers.Main).
     This removes the global setMain AND the round-4 collector leak at the source
     rather than working around them, without reopening the DisposableProvider split.
   - Three more pins: a null window state announces nothing, applyWorkspace
     (restoreProject = false) announces nothing, unregister + getOrCreate restarts the
     chain at "".

Not taken, with reasons: jvmArgumentProviders (the current form works, is
config-cache-serialisable and passed CI on three OSes); widening the user.home redirect
to plugin-path-utils (its test only mkdirs a directory every BOSS user already has).

There is no CHANGELOG in this repo, so the release-notes line for the same-path change
is an action item at release time, not a file change. Flagged in the body.

Two consecutive full runs: 3703 tests / 368 classes, 0 failures both times.
detekt ktlintCheck clean - it caught two TooGenericExceptionCaught and a long line in
this round's own code first.

Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>

* Address project announcement review feedback

* fix(plugin-store): restrict plugin_downloads RLS to the server-side pipeline (#488)

* Batch validation: promote latest reviewed dev changes to main (#463)

* Fix #30: Resolve duplicate context menu label collisions

* Cleanup: Remove dead code for #91 and #93

* chore: Sanitize SubmitResult.Error at construction rather than at one render site

* Fix panel component lifecycle disposal

* fixes

* Guard panel lifecycle destruction failures

* fix(logging): sanitize secret RPC failures and crash-report errors

Three related gaps in what gets logged and shown when something fails:

- SecretService.kt had no BossLogger in any of its ten catch blocks (#145).
  When the organisation migration broke all four secret RPCs (#144), the
  only WARN in the log came from the calling plugin - the code that
  actually failed said nothing. Every catch now logs via
  logger.warn(LogCategory.NETWORK, ...), reusing the already-sanitized
  failure for both the log and the returned Result rather than sanitizing
  twice. RoleService and RoleCreationService were checked and already log
  correctly - SecretService was the only silent one.

- LogSanitizer.sanitizeExceptionMessage redacted a hostname only when it
  appeared inside a URL - a bare hostname (exactly what
  UnknownHostException.getMessage() produces, i.e. every DNS failure, and
  what a proxy-connect failure looks like) passed through untouched (#109).
  Added a narrow hostname pattern: lowercase-only labels ending in a short
  explicit TLD/`.internal`/`.local` list, with a negative lookahead so a
  package path that happens to end in a real TLD word mid-FQN
  (kotlinx.coroutines.internal.ScopeCoroutine, kotlinx.io.EOFException)
  is not mistaken for one - caught by the existing realistic-stack-trace
  test after the first version of the pattern redacted a live Kotlin
  package name out of it.

- CrashReportService.SubmitResult.Error held a raw exception string,
  sanitized at exactly one render call site in CrashReportDialog (#110).
  The constructor is now private; SubmitResult.Error.of(...) is the only
  way to build one, and it sanitizes before the raw string can reach
  .message - a property of the type now, not something every future
  consumer (a copy button, a toast, a log line) has to remember on its own.
  Both construction sites (the service's two catch blocks, and the one in
  CrashReportDialog the issue names directly) now route through it.

Tests: new coverage for the ten now-logging SecretService paths (via
SupabaseWiringTest's existing sanitization-wiring guard, updated to
recognize the "sanitize once into a local, reuse for log and return" shape
SupabaseDataProviderImpl already used), six new LogSanitizerTest cases for
the hostname fix (including the FQN/version-number false-positive guards),
and a new CrashReportServiceTest for the sanitize-at-construction guarantee.

* test(crash): extract construction tests from #404

Selected unchanged test file from Antriksh1984 original commit 99d2a5228023c541e825fe2714619c8228140369 (PR #404). Maintainer extraction only; subsequent API/scope adaptations are recorded separately.

* chore(ipc): clarify advisory menu ID scope and fix formatting

* chore(ui): finish obsolete toolbar comment cleanup

* test(crash): adapt consolidated coverage and guard factory visibility

Maintainer consolidation: use #311 companion invoke and a URL fixture instead of depending on #404 hostname redaction. Add private constructor/copy bytecode assertions. Preserve original contributor tests and implementation credit separately.

* refactor(crash): consolidate construction sanitization in #311

Maintainer scope change: remove only the duplicate #110 implementation, retaining Antriksh1984 original #109/#145 work and commit history. Standalone construction tests are retained with attribution in #311; its Aditya8369 implementation supersedes Error.of. Keep render-time sanitization here until #311 merges and describe the remaining hostname coverage conservatively.

* test(panels): retain sibling lifecycle isolation coverage from #313

Adapt the original #313 test to the #317 constructor and supply the missing panelInfo overrides. Original test scenario and assertions are by @rehannayeem0786; these compile adaptations are maintainer integration work.

* fix(panels): complete lifecycle cleanup across failure and window teardown

Destroy partially constructed panels and replacements that fail to resume. Continue downward lifecycle transitions after a failing pause or stop callback. Dispose panels before plugin teardown in the same callback rather than relying on sibling Compose effect order. Add regression coverage and adapt the retained #313 test bodies for detekt. These changes are maintainer follow-up to the original #313/#317 contributions.

* docs(ui): remove stale disabled top-bar feature list

* test(ipc): protect advisory menu item ID uniqueness

* fix(panels): keep store registration scoped to its window effect

Remove the redundant unregister from plugin teardown. Document independent context services and synchronous Essenty onCreate replay, with tests for registration ownership and exactly-once create callbacks. Keep tab teardown hardening separate. Maintainer follow-up to the review of #317; original #313/#317 contributor credit is unchanged.

* fix(crash): address consolidated sanitization review notes

Maintainer follow-up to Claude N1-N4: document factory/copy invariant, correct stale comments, move Aditya original construction assertions into the service suite while retaining Antriksh blank/diagnostic cases, and log unexpected dialog submission failures. Original contribution credit remains separate.

* fix(logging): keep server failure payloads out of secret RPC logs

Maintainer follow-up to Claude review: log operation and exception type only, preserve sanitized return semantics, and check each catch for safe return/log wiring. Document measured hostname limits without broadening the matcher; add module-local redaction and diagnostic-preservation coverage. Antriksh original implementation remains credited separately.

* ci: build PR batches on dev

* Allow Claude diff reviews after approved fork builds (#413)

* fix(browser): preserve newer clipboard copies during plain-text paste (#316)

* fix(browser): paste-without-formatting no longer clobbers a copy made in its restore window (#205)

* fix(browser): make paste-without-formatting's restore identity-based, not text-based

Review of this PR caught that the text-equality guard cannot distinguish 'our write is still current' from 'a previous press already restored the rich original' - whose string projection is by construction the same text - so two presses inside the 200ms window permanently downgraded a rich clipboard to plain text. A PasteWithoutFormattingSession now tracks the exact Transferable each press installed and restores the pre-window original once, while a user copy in the window still wins. Adds five tests to BrowserClipboardCommandsTest, including the double-press regression; wraps the two over-limit lines; e.message -> e::class.simpleName in the touched handlers.

* fix(browser): fold tryRestore's early exits so it stays within detekt's ReturnCount

* fix(browser): blank lines between FakeTransferable overrides per ktlint

* test(browser): retain clipboard restore scenarios from #408

* fix(browser): track clipboard ownership through AWT wrappers

---------

Co-authored-by: rehannayeem0786 <rehannayeem0786@github.com>
Co-authored-by: Shivang <shivang.iitk@gmail.com>
Co-authored-by: Antriksh1984 <antrikshsingh850@gmail.com>

* fix(plugins): serialize concurrent first loads per class name (#324)

* fix(plugins): prevent duplicate class definitions during concurrent loads

* fix(plugins): make class loading parallel-safe

* test(plugins): pin concurrent loading lifecycle boundaries

Maintainer consolidation follow-up: retain #324 synchronization and its tests; add concurrent shared-name, superclass, and unload-marker coverage. Document caller-sensitive registration based on arjun28115 review feedback and clarify that marking unload does not drain an already admitted parent lookup. No global lifecycle lock or resource-policy changes.

---------

Co-authored-by: sgoel2be24-cyber <223222024+sgoel2be24-cyber@users.noreply.github.com>
Co-authored-by: Procs <168113425+ProportanilityConstant@users.noreply.github.com>
Co-authored-by: Shivang <shivang.iitk@gmail.com>

* fix(browser): defer native disposal until admitted calls drain (#312 + #409) (#412)

* fix: make BrowserHandle JavaScript execution cancellable

the previous synchronous JxBrowser call blocked the Main/EDT thread;
coroutine cancellation could not take effect while that call was blocking;
the implementation now uses JxBrowser’s asynchronous JavaScript callback API;
suspendCancellableCoroutine makes the Kotlin waiting side cancellable;
late callbacks after cancellation are safely ignored;
this does NOT terminate JavaScript already executing inside Chromium.

* fix: add robust native call lifecycle tracking for disposal

* test: verify native operation cleanup on synchronous failure

* fix: linearize browser disposal and pending operation tracking

* fix: resolve detekt violations in browser native tracking

* test: satisfy detekt failure simulation rule

* fix: close native operation disposal race

* fix(browser): drain an in-flight call before closing the browser

Issue #300 reports that executeJavaScript is a synchronous, non-
cancellation-aware native call, and a plugin's own withTimeoutOrNull
around it can only abandon the caller's wait - not the call itself -
which stays running on Main indefinitely and can race a concurrent
handle.dispose(), touching the same native object from two threads at
once.

The severe half of this was already fixed by BoundedBrowserCall: this
class confines every blocking round trip to one dedicated daemon thread
instead of Dispatchers.Main, so a wedged renderer no longer freezes the
app. What was not yet closed is the residual window this issue's core
report is actually about: shutdown() stopped new work but did not wait
for whatever was already running, so a caller could proceed straight to
browser.close() while a call from just before shutdown was still
finishing on the dedicated thread.

shutdown() now waits, bounded, for that in-flight call to drain before
returning. Costs nothing in the common case - awaitTermination returns
immediately once the one worker thread and its queue are both idle,
which is where an instance sits between calls - and only the bound in
the rare case something was genuinely still running.

Known, and disclosed in the KDoc rather than claimed away: this narrows
the race for the common case (a call that was always going to finish
quickly) rather than closing it. It cannot help when the in-flight call
is itself the wedge this class's own deadline exists for - waiting
unboundedly for a genuinely stuck call would reintroduce the exact freeze
BoundedBrowserCall exists to prevent, just moved from a plugin's await
into every caller's teardown path. There is no JxBrowser API on this
version able to interrupt a blocking round trip already inside the
native call, which is the whole reason the call is confined to its own
thread instead of cancelled - closing that window completely needs
JxBrowser's own cooperation, which the issue's own analysis already
concluded is unavailable.

Tests: shutdown waits for a fast in-flight call to finish before
returning, and does not wait past its own drain timeout for a wedged one
- the same before/after pair the rest of this test file already uses for
BoundedBrowserCall's deadline.

* fix(browser): defer native close until admitted calls drain

Consolidates the lifecycle work from #312 (johncybersage) and #409 (Antriksh1984), retaining both original histories. Replaces success-only callback accounting and timeout-then-close with executor termination signals and host-owned native/profile cleanup. These corrections and replacement tests are maintainer/agent work, separate from contributor scoring.

* fix(browser): bound profile waits and clarify deferred cleanup ownership

Address consolidation review: schedule both service disposal paths without awaiting native close, diagnose pending drains, centralize executor ownership, and bound profile lease acquisition without permitting unsafe reuse or eviction. Document process-exit abandonment and verify wiring and cleanup ordering. Maintainer/agent follow-up, separate from original #312 and #409 contributor credit.

* fix(browser): schedule disposal after early UI teardown failure

* ci: create launcher directory before Claude native installation

* Revert "ci: create launcher directory before Claude native installation"

This reverts commit 5184908e6c3f133502508513b4c5e17651b13bc0.

* test: keep warmup registry ordering check on one event loop

* test(browser): normalize CRLF in disposal source wiring guards

---------

Co-authored-by: john k <johnk@johns-MacBook-Pro.local>
Co-authored-by: john k <johnk@syn-172-100-137-112.res.spectrum.com>
Co-authored-by: Antriksh1984 <antrikshsingh850@gmail.com>

* feat(tabs): show a speaker glyph on tabs that are playing audio (#314)

* feat(tabs): show a speaker glyph on tabs that are playing audio (#308)

* fix(tabs): review round - compile, registry lifetime, UI-thread marshalling, owner flush

1. graphicsLayer import dropped (does not exist at that package); the fade now uses .alpha(audioAlpha), already imported. 2. TabAudioRegistry no longer outlives its owner: disposeAllTabsBlocking unregisters everything this component registered, and DetachedTab.destroy drops the entry for a tab destroyed without adoption - the handler captures the BossTabsComponent, so stale entries retained it. 3. The registry update is marshalled to the EDT via SwingUtilities.invokeLater, so the tab-model mutation happens on the UI thread as the KDoc claims. 4. setFullscreenHandler flushes the current playback state once ownerTabId becomes known, closing the starts-before-registration race the review could not verify. 5. TabAudioRegistryTest added: delivery, last-writer-wins, ownership-checked unregister.

* fix(tabs): CI round 2 - DetachedTab receiver error, long line, and baseline-preserving signatures

- BossMainWindowPanel.kt:2098: DetachedTab is a non-inner nested class and cannot use the outer component as receiver; the audio-handler drop moves to detachTab instead, which is where adoption-vs-destroy actually diverges. - TabAudioRegistry.kt:9 wrapped under detekt's 120-char limit. - FluckTabInfo.isPlayingAudio and BossTabButton's glyph read no longer change any signature: the flag is a mutable property (copied in copy()'s body) and the button reads it off tabInfo, so the constructor, copy() and BossTabButton keep their exact baseline-frozen detekt IDs and the resurfaced LongMethod/LongParameterList/CyclomaticComplexMethod findings retire.

* fix(tabs): fold handleAudioUpdate within ReturnCount; add missing final newline in the test file

* fix(tabs): publish audio state by browser ownership and keep icon layout stable

---------

Co-authored-by: rehannayeem0786 <rehannayeem0786@github.com>
Co-authored-by: Shivang <shivang.iitk@gmail.com>

* feat: connect chrome density settings and keyboard controls (#305)

* feat: wire the chrome density scale into settings and small-screen defaults

ChromeDensity / ChromeDimens.of() / LocalChromeDimens already existed on
main and every bar (BossTitleBar, BossTopBar, the main tab bar,
BossBottomBar) already read its height from BossChrome.dimens - but
LocalChromeDimens was never provided anywhere, so it silently resolved to
its staticCompositionLocalOf default (Comfortable) always. The scale was
built and unreachable.

This closes that gap:

- WindowAppearanceSettings gets a `density` field (default COMFORTABLE, so
  an existing install's settings file - which has never heard of this key
  - decodes to exactly the chrome it already had; no settings-version bump
  needed).
- BossApp.kt now provides LocalChromeDimens from that field, host-only and
  outside BossAppCompositionLocals (plugins never draw host chrome).
- A "Density" dropdown in Settings > Bars (Compact/Comfortable/Spacious),
  indexed in Settings search.
- A fresh install on a small screen (< 1000dp logical height, clearing the
  13" MacBook Air's ~931-956pt from #239's own measurements) now defaults
  to Compact and starts with the bottom bar off - the one bar this manager
  can still reclaim itself, since the side strips are already off by
  class default. Toolkit.getScreenSize() is read once, wrapped in
  runCatching (HeadlessException off a display must not break a fresh
  install), with a pure defaultDensityFor(screenHeightDp) so the decision
  is unit-testable without a display.

Addresses #239, scoped down from the full issue. Out of scope in this
pass, deliberately:

- The app does not yet report its own chrome budget as a measured
  percentage - the issue's own "state it, don't argue it" ask. Reachable
  later from the same ChromeDimens source, but needs a spot to render it.
- The title bar's 27dp "Boss Console" label row is untouched - collapsing
  or merging it with the tab bar is a separate, riskier layout change than
  a density scale.
- No regression intended to the existing per-bar show/hide switches or
  focus-mode edges: density only changes how much room a bar that is
  already on screen takes, never whether it is shown.

* fix: drop the Compact-density bottom-bar auto-off, wrap an overlong line

Address review feedback on #305:

- Removed showBottomBar = density != ChromeDensity.COMPACT from
  getDefaultSettings(). ChromeMetricsTest already shows the shipped
  macOS defaults reach 93.3% of a 931dp window at Comfortable, so
  #239's >=90% bar is met without touching the status bar - and that
  bar's own KDoc argues it must stay on ("the only always-on readout").
  It was also reachable from the settings-load catch fallback, so a
  transient read error could silently drop the bar and have the next
  save persist the loss. Compact now only changes density, nothing else.

- Wrapped primaryScreenHeightDp() - was 121 chars, one over detekt's
  default MaxLineLength (120), which applies here since .editorconfig's
  140 is a ktlint-only setting and this line wasn't in the baseline.

* feat: add chrome density setting

* feat: add small-screen chrome defaults

* feat: add chrome density controls and small-screen defaults

* fix(ui): preserve lean density defaults and test density controls

* style: format multiline screen-height lookup

* fix(ui): separate density recovery and make editor chords opt-in

* style: wrap density default documentation

---------

Co-authored-by: AdityaK-iiita <adityakolate0070@gmail.com>
Co-authored-by: Shivang <shivang.iitk@gmail.com>

* fix(plugins): stop host resource fallback after unload (#325)

* fix(plugins): stop host resource fallback after unload

* fix(plugins): preserve resource warning for a missing result

---------

Co-authored-by: sgoel2be24-cyber <223222024+sgoel2be24-cyber@users.noreply.github.com>
Co-authored-by: Shivang <shivang.iitk@gmail.com>

* Handle closed browser frames during navigation callbacks (#400)

* Handle closed browser frames during navigation callbacks

* test(browser): retain closed-event guard after navigation integration

* fix(browser): preserve helpers on PID failure and recognize closed transports

* style(browser): wrap review diagnostics for detekt

---------

Co-authored-by: Shivang <shivang.iitk@gmail.com>

* refactor(window): pin the panel content alignment width (#398)

* fix(window): restore strict width constraints for nested panels

Fixes #278. Commit c15660c5 inadvertently dropped the explicit width constraint for nested panels in the right dock by wrapping them inside a PanelColumn with a Box(weight(1f)) that lacked fillMaxWidth(). This loose constraint caused a known issue with SubcomposeLayout caching stale bounds when resized, resulting in Row content disappearing after weighted Spacers. This commit restores the .fillMaxWidth() propagation.

* Cover panel content alignment across width changes

* Keep panel layout regression in the existing app test package

* Document panel alignment contract and pin filling content width

* Wrap the panel width assertion to satisfy detekt

---------

Co-authored-by: Shivang <shivang.iitk@gmail.com>

* #320 - Fix quick actions vanishing in short tab rail (#328)

* #320 - Fix quick actions vanishing in short tab rail

* Fix: detekt & ktlint checks

* Fix rail action budgets and reversible fallback wiring

* Fix resize test assertion import and update rail coverage note

---------

Co-authored-by: Shivang <shivang.iitk@gmail.com>

* fix(crash): refine scroll boundary and bound error sanitization (#350)

* fix(crash): refine scroll boundary and bound error sanitization

* Avoid exposing a partial token at the crash message limit

* Document sanitizer input bound and verify expansion ordering

---------

Co-authored-by: Aishwary Anand <aishwary.cd22@bmsce.ac.in>
Co-authored-by: Shivang <shivang.iitk@gmail.com>

* fix(logging): redact private hostnames (#346)

* fix(logging): redact private hostnames

* Handle private hostname punctuation and preserve diagnostic ports

* Format hostname punctuation regression assertion

---------

Co-authored-by: ayush <workside@gamil.com>
Co-authored-by: Shivang <shivang.iitk@gmail.com>

* feat: Opening an .html file should ask open as a file or webpage (#333)

* feat: Opening an .html file should ask open as a file or webpage

* Fix HTML prompt delivery and persisted preference ordering

* Cover HTML routing and correct review test fixtures

* Honor HTML navigation intent and release pending prompts on failure

* Isolate HTML prompt handling from the general dialog host

---------

Co-authored-by: Shivang <shivang.iitk@gmail.com>

* fix(plugin-store): parse timestamps consistently in list and detail metadata (#379)

* Fix: Implement proper ISO timestamp parsing in PluginStoreClient

* fix(repository): implement robust ISO timestamp parsing for Supabase payloads

* style(repository): resolve detekt MaxLineLength and TooGenericExceptionCaught

* fix(plugin-store): implement plugin metadata timestamp parsing

PluginStoreClient.parseTimestamp was a stub that always returned 0L, so
every plugin fetched from the store showed "Last Updated"/"Published" as
the Unix epoch in the Toolbox UI regardless of what the server actually
sent (#337).

Parses the ISO-8601 timestamp (the shape the store sends, e.g.
2024-05-12T14:30:00Z, or with a numeric offset) via java.time.Instant,
falling back to 0L for a blank, missing, or malformed string rather than
throwing - matching the field's own empty-string default for a response
that omits it. java.time rather than adding kotlinx-datetime as a new
dependency: this module already uses java.util.* directly in the same
commonMain source set (it has one real target, jvm("desktop")), so nothing
is gained by introducing a second time library for one function.

Tests exercise the real PluginDetailResponse.toPluginInfo(), matching the
convention already established next to it in
PluginStoreResponseDecodingTest: a Z-suffixed timestamp, a numeric-offset
timestamp, a blank string, and a malformed string.

* Fix timestamp normalization edge cases and verify both response mappings

* Use release publication dates and pin timezone-independent fallback

---------

Co-authored-by: Sanjay <sanjaysaini4423@gmail.com>
Co-authored-by: Antriksh1984 <antrikshsingh850@gmail.com>
Co-authored-by: Shivang <shivang.iitk@gmail.com>

* feat(remote-ui): authenticate and expose remote UI surfaces (#348)

* feat(remote-ui): authenticate remote UI process identity

* feat(remote-ui): place authenticated remote UI surfaces

* fix(remote-ui): close ownership and placement lifecycle races

* test(remote-ui): expose placement recovery cases to JUnit

---------

Co-authored-by: Shivang <shivang.iitk@gmail.com>

* feat(dashboard): add shared read-only What's New release feed (#381)

* Add What's New release feed to dashboard

* Serialize update settings persistence

* Remove unused update settings import

* fix(updater): retain realtime refreshes during shared release fetches

* style(updater): format shared release fetch regression tests

* fix(updater): coalesce release refresh bursts and preserve visible history

---------

Co-authored-by: Shivang <shivang.iitk@gmail.com>

* fix(language): consolidate host and out-of-process language-id tables (#358)

* fix(language): consolidate host and out-of-process language-id tables

EditorLanguages (composeApp) and EditorServiceImpl (modules/boss-app-editor)
each hand-maintained their own extension-to-language-id table because
boss-app-editor - a plain JVM module compiled to a GraalVM native image -
could not depend on anything in composeApp. They disagreed: EditorServiceImpl
named .sh/.bash/.zsh "shell", EditorLanguages named them "bash", and
EditorServiceImpl was missing more than forty ids the other table had
(fortran, delphi, latex, lisp, tcl, clojure, batch, diff, ...) (#75).

Moves the table into a new plugin-platform/plugin-language-types module -
dependency-free by design, so it carries nothing extra into boss-app-editor's
native-image build - and has both EditorLanguages and EditorServiceImpl read
from it. This is the first time anything under modules/ depends on
plugin-platform/; verified compiling and passing tests before committing to
the approach.

EditorLanguages keeps its existing public API unchanged (same values for
every extension), so FileTypeCategoriesTest and EditorLanguageDetectionTest
needed no changes. EditorServiceImpl keeps its own "proto"->"protobuf" entry
and "plaintext" fallback as local additions on top of the shared table,
rather than folding them into it: proto isn't part of the boss-file-types.json
default-app-association surface the shared table backs, and "plaintext" is
this service's own gRPC default, not a value composeApp reads.

Adds LanguageIdsTest (the new module) and EditorServiceImplTest (previously
no tests existed for this class at all) - the latter pins the actual bug fix,
that detectLanguage("sh") now returns "bash" instead of "shell".

Out of scope, and disclosed rather than silently dropped: two of the five
duplicate tables the issue names - the editor-tab plugin's own
LanguageDetection and BossEditor's lexer registry - live in separate
repositories this build cannot reach. FileIcons.forSpecialFileName/forFile in
plugin-icons is also not consolidated: it keys icon selection off the raw
filename to preserve distinctions a language id can't carry (package.json,
yarn.lock and pnpm-lock.yaml are all valid JSON/YAML but get three different
brand icons) and never computes a language id in the first place, so
routing it through this table would need a separate icon-selection redesign.

* fix(language): keep file-association drift checks on the shared table

* fix(language): apply shared filename rules to editor file opens

---------

Co-authored-by: Shivang <shivang.iitk@gmail.com>

* fix(editor): contain write-local stack overflow and preserve fatal errors (#396)

* Make writeFileContentSafe actually safe: catch the Errors it was named for

`writeFileContentSafe` exists to return false rather than throw. It did not hold
that contract:

    } catch (e: Exception) {
        fileIoLogger.warn(LogCategory.EDITOR, "Error writing file", error = e)
        false
    }

StackOverflowError is an Error, not an Exception, so it went straight through -
out of writeFileContent, out of the editor_write_file MCP handler, and to the
caller as a bare StackOverflowError instead of the handler's own
"Write failed for <path>". The warn that would have named the file never ran
either.

That is not hypothetical. risa-labs-inc/boss-plugin-editor-tab#18 and #27 are two
independent reports of it, on unrelated content, and #27's complaint is precisely
the missing diagnosis: the error "gives no indication of which input caused it".

StackOverflowError and OutOfMemoryError are caught explicitly rather than
widening to Throwable. A stack overflow unwinds and leaves the JVM usable, and
readFileContentSafe in this same file already treats OutOfMemoryError as a
reportable outcome. Throwable would also absorb LinkageError and ThreadDeath,
which are not this function's to swallow - there is a test asserting a
NoClassDefFoundError still propagates.

The failure log now names the path and the character count. Not the content:
these writes carry whatever the user is editing.

**This does not fix the write.** Whatever recurses is upstream of this function,
which is mkdirs plus writeText - I ruled out the plugin's handler, this write,
and the host's MCP argument parsing, and said so on the issue. What changes is
that the failure is reported honestly instead of escaping, which is where a
diagnosis can start.

The body moves to `guardedWrite` with an injectable write, because a test JVM
cannot be made to overflow the stack inside writeText on demand.

Verified: 3729 tests, 0 failures, plus ktlintCheck and detekt.

Refs risa-labs-inc/boss-plugin-editor-tab#18, #27.

Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>

* docs(editor): clarify write guard scope and prior recursion fix

* fix(editor): preserve fatal heap errors in write guard

---------

Co-authored-by: Claude Opus 5 <noreply@anthropic.com>
Co-authored-by: Shivang <shivang.iitk@gmail.com>

* fix(state): apply version-checked JSON merge patches (#361)

* Fix: Implement proper ISO timestamp parsing in PluginStoreClient

* Feature: Implement JSON Merge Patch for plugin delta state synchronization

* fix(state): validate delta bases and exclude duplicate timestamp scope

* fix(state): reject malformed and deeply nested patches

---------

Co-authored-by: Shivang <shivang.iitk@gmail.com>

* :arrow_up: deps:(deps): Bump grpc from 1.83.1 to 1.84.0 (#363)

Bumps `grpc` from 1.83.1 to 1.84.0.

Updates `io.grpc:grpc-netty` from 1.83.1 to 1.84.0
- [Release notes](https://github.com/grpc/grpc-java/releases)
- [Commits](https://github.com/grpc/grpc-java/compare/v1.83.1...v1.84.0)

Updates `io.grpc:grpc-protobuf` from 1.83.1 to 1.84.0
- [Release notes](https://github.com/grpc/grpc-java/releases)
- [Commits](https://github.com/grpc/grpc-java/compare/v1.83.1...v1.84.0)

Updates `io.grpc:grpc-stub` from 1.83.1 to 1.84.0
- [Release notes](https://github.com/grpc/grpc-java/releases)
- [Commits](https://github.com/grpc/grpc-java/compare/v1.83.1...v1.84.0)

Updates `io.grpc:grpc-services` from 1.83.1 to 1.84.0
- [Release notes](https://github.com/grpc/grpc-java/releases)
- [Commits](https://github.com/grpc/grpc-java/compare/v1.83.1...v1.84.0)

Updates `io.grpc:grpc-util` from 1.83.1 to 1.84.0
- [Release notes](https://github.com/grpc/grpc-java/releases)
- [Commits](https://github.com/grpc/grpc-java/compare/v1.83.1...v1.84.0)

---
updated-dependencies:
- dependency-name: io.grpc:grpc-netty
  dependency-version: 1.84.0
  dependency-type: direct:production
  update-type: version-update:semver-minor
- dependency-name: io.grpc:grpc-protobuf
  dependency-version: 1.84.0
  dependency-type: direct:production
  update-type: version-update:semver-minor
- dependency-name: io.grpc:grpc-stub
  dependency-version: 1.84.0
  dependency-type: direct:production
  update-type: version-update:semver-minor
- dependency-name: io.grpc:grpc-services
  dependency-version: 1.84.0
  dependency-type: direct:production
  update-type: version-update:semver-minor
- dependency-name: io.grpc:grpc-util
  dependency-version: 1.84.0
  dependency-type: direct:production
  update-type: version-update:semver-minor
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
Co-authored-by: Shivang <shivang.iitk@gmail.com>

* :arrow_up: deps:(deps): Bump protobuf from 4.36.0 to 4.36.1 (#364)

Bumps `protobuf` from 4.36.0 to 4.36.1.

Updates `com.google.protobuf:protobuf-kotlin` from 4.36.0 to 4.36.1

Updates `com.google.protobuf:protobuf-java` from 4.36.0 to 4.36.1
- [Release notes](https://github.com/protocolbuffers/protobuf/releases)
- [Commits](https://github.com/protocolbuffers/protobuf/commits)

---
updated-dependencies:
- dependency-name: com.google.protobuf:protobuf-kotlin
  dependency-version: 4.36.1
  dependency-type: direct:production
  update-type: version-update:semver-patch
- dependency-name: com.google.protobuf:protobuf-java
  dependency-version: 4.36.1
  dependency-type: direct:production
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
Co-authored-by: Shivang <shivang.iitk@gmail.com>

* fix(plugins): defer stale jar cleanup until restart (#340)

* fix(plugins): defer stale jar cleanup until restart

* fix(plugins): satisfy quality checks

* Preserve staged plugin artifacts when another plugin updates

* Require cleanup intent and retain artifacts with unordered manifest versions

---------

Co-authored-by: ayush <workside@gamil.com>
Co-authored-by: Shivang <shivang.iitk@gmail.com>

* fix(plugins): defer fluck-browser hot-reload to a restart (#352)

* fix(plugins): defer stale jar cleanup until restart

* fix(plugins): defer fluck-browser hot-reload to a restart

Hot-reloading fluck-browser force-unloads the classloader that created its
JxBrowser native views. Every open tab - and every tab opened afterward,
since the factory that would recreate the view is gone too - draws an empty
box, and a second hot-reload does not recover it; only a full restart does.

HotReloadPolicy names plugins that must never be swapped in place, matching
the existing NOT_USER_INSTALLABLE/RetiredPlugins pattern. It's checked at
every path that can force-unload a live plugin to apply an update: the
resetPluginInstances/doReloadPlugin path that actually reproduced this bug,
the menu-driven Reload action, the Toolbox update flow, and the store
installer. For a not-hot-reloadable plugin, the new jar is staged into
installed.json without touching the running instance or its open tabs, and
a status message tells the user to restart to apply it - the next cold
start loads the update with a fresh classloader.

Also fixes two call sites that asked "restart dependent plugins?" before
checking whether an unload was even going to happen, which produced a
confusing prompt for an unload that a deferred update was never going to
do.

* fix(plugins): satisfy quality checks

* Preserve staged plugin artifacts when another plugin updates

* Validate deferred browser artifacts and reject ineffective downgrades

* Require cleanup intent and retain artifacts with unordered manifest versions

* Preserve unloaded-browser recovery and unify safe deferred selection

* Format scoped update cleanup integration

---------

Co-authored-by: ayush <workside@gamil.com>
Co-authored-by: Shivang <shivang.iitk@gmail.com>

* Harden OOP plugin reaping: hook-race flag, registry cleanup, spawn guard (#135) (#365)

* Harden OOP plugin reaping: hook-race flag, registry cleanup, spawn guard (#135)

reapDepth (AtomicInteger) replaces the boolean reaping flag, so the two JVM shutdown hooks (main.kt and KernelBootstrap) cannot clear the in-progress signal while the other is still reaping (item 2). reapChildren now unregisters reaped handles from the process-wide ProcessRegistry, so stale dead entries do not persist across an in-process mode switch (item 4). OutOfProcessPluginSpawnerImpl.spawn() stands down when isReaping(), so a plugin load racing host exit cannot register a child after the reap snapshot (item 3). Covered by ReapChildrenTest.

* Serialize plugin spawn registration with reaping and preserve replacement handles

* Fence late process creation without blocking shutdown and cover recovery

---------

Co-authored-by: Shivang <shivang.iitk@gmail.com>

* fix(plugins): complete loader cleanup after disposal linkage errors (#302)

* fix: API hot sw…
…isa-labs-inc#668)

* fix(secrets): make the secret listing RPCs fail soft on one bad row

BossConsole#620: get_user_secrets, search_user_secrets and
get_user_secrets_with_shared each decrypt password_encrypted and
recovery_codes_encrypted with a bare call to decrypt_text inside a
set-returning query. decrypt_text raises on an undecryptable value - a
wrong key after a partial key rotation, storage corruption, or an
HMAC/padding mismatch - and one raised row aborts the whole query, so
the caller sees every one of their secrets fail to load rather than
just the bad one.

twofa_secret already reads through safe_decrypt_twofa_secret (NULL on
failure). recovery_codes_encrypted already had a safe wrapper too -
safe_decrypt_recovery_codes, whose own doc comment says "used
internally by get_user_secrets functions" - but whichever later
migration touched these RPCs stopped calling it and fell back to raw
decrypt_text, so it sat unused. password_encrypted never had a safe
wrapper at all.

Adds try_decrypt_text(text), mirroring safe_decrypt_recovery_codes's
BEGIN/EXCEPTION WHEN OTHERS THEN RETURN NULL shape for a scalar
result, locked down the same way safe_decrypt_twofa_secret is (no
client role gets EXECUTE). Routes the password read in all three RPCs
through it and the recovery-codes read back through the existing safe
wrapper. One corrupt row now surfaces as a blanked field - password
NULL, recovery_codes [] - while every other secret in the page still
loads.

Deliberately not named safe_decrypt_*: ops/rotate_master_encryption_key.sql's
re-encrypt loop treats every function matching that name pattern as a
mapped bespoke-format adapter and refuses to run if one is unmapped.
try_decrypt_text wraps the same plain envelope that script already
re-encrypts directly, so it must stay outside that sweep.

Scoped to the three user-facing listing RPCs only; the operator-run
backfill/rotation paths keep using raw decrypt_text and should still
fail closed.

* Fix installed-client compatibility and preserve systemic decryption failures

Includes desktop regression coverage from risa-labs-inc#621 by Rushikeshiitb and review repairs by kshivang; related independent risa-labs-inc#652 work by akashjadon04 informed the review.

---------

Co-authored-by: Shivang <shivang.iitk@gmail.com>
…idge (risa-labs-inc#666)

* fix(kernel): require verified caller identity for the project-data bridge

BossConsole#53: ProjectDataServiceBridge had no identity check at all.
Any process able to open a connection to the kernel IPC server - not
only the plugins the host itself loaded - could watch every recently
opened project's path (which routinely contains a username) with no
credential, and could force an arbitrary window to switch its open
project via selectProject. That is not only a UI surprise: a project
switch publishes a ProjectChangeEvent on the application-wide event
bus every installed plugin can subscribe to, so an unauthenticated
caller could trigger that broadcast on demand.

Applies the same fail-closed pattern already used for ActiveTabs,
Download, Git, Log, PluginUI, RoleManagement, RunConfig and Supabase:
every unary RPC requires AUTHENTICATED_PROCESS_ID, the watch stream
captures CURRENT_IDENTITY before collecting and re-checks it on every
emission so a revoked token stops a live stream, and every mutation
gets an attributed audit log line. SplitView remains the one
unguarded service on this server.

Rewrote ProjectDataServiceBridgeTest against a real gRPC server (the
existing tests called the bridge directly, which the new gating would
have refused outright) - refusal-with-no-credential, authenticated
mutation, revoked unary and revoked stream cases, plus the two
existing routing guarantees now exercised over an authenticated
channel: selectProject's UI-dispatcher confinement and
watchRecentProjects reading the process-wide ProjectState singleton
rather than a per-window mirror.

Also folded the stale, repeatedly-drifting enumeration of which
bridges fail closed out of BossIpcServer's own KDoc - it named only
two of what are now nine - in favor of pointing at each bridge's own
KDoc instead.

* fix(review): clarify project identity guarantees and harden test lifecycle

* style(test): keep filtered flow chain continuation together

---------

Co-authored-by: Shivang <shivang.iitk@gmail.com>
Fixes risa-labs-inc#641. Consolidates the independently implemented clone-timeout work from risa-labs-inc#659 and risa-labs-inc#660.

Abhiram Nair authored the original onExit lifecycle, deterministic process tests, real process-tree coverage and public clone cleanup/retry repairs. Antriksh independently authored the interruptible-wait alternative and real-Git acceptance tests; target preservation, ordinary failure and final-completion coverage are incorporated with explicit credit. Maintainer repairs serialize interruptible progress delivery, make callback failures advisory and preserve successful exit during delayed notification.

Co-authored-by: passionate-coder26 <abhipersonal656@gmail.com>
Co-authored-by: Antriksh <antrikshsingh850@gmail.com>
…ge (risa-labs-inc#672)

* fix(kernel): require verified caller identity for the split-view bridge

BossConsole#53: SplitViewServiceBridge had no identity check at all.
Any process able to open a connection to the kernel IPC server - not
only the plugins the host itself loaded - could force an arbitrary
window's active panel to navigate to an attacker-chosen URL via
openUrlInActivePanel (with no confirmation for an ordinary http(s)
URL, and no confirmation gate at all for most boss:// hosts), open an
arbitrary file path with no confinement via openFileInActivePanel/
openFileInEditor/openFileInBrowser/openFileAtPosition, manipulate
panel/tab selection, or overwrite a workspace snapshot under an
attacker-chosen name via preserveCurrentState.

Applies the same fail-closed pattern already used for ActiveTabs,
Download, Git, Log, PluginUI, RoleManagement, RunConfig and Supabase:
every unary RPC requires a verified AUTHENTICATED_PROCESS_ID, and
every mutation gets an attributed audit log line. This is the last
bridge in this PR's own scope; ProjectData's identical fix is in
flight separately (risa-labs-inc#666).

New SplitViewServiceBridgeTest against a real gRPC server: every RPC
refused with no credential and never reaching the provider, an
authenticated caller can drive every operation, and a revoked caller
cannot invoke a unary RPC.

* test(kernel): verify split-view identity coverage and clarify scope

---------

Co-authored-by: Shivang <shivang.iitk@gmail.com>
* feat(search): index open tabs by their URL and file path (#606) (#648)

Global Search matched an open tab only against its title, and TabResult
hardcoded url = null / filePath = null on every hit. A browser tab whose
title never mentions its domain, or an editor tab someone wants to find
by path rather than filename, could not be found at all.

searchTabs now also scores a browser tab's FluckTabInfo.currentUrl and
an editor tab's EditorTabInfo.filePath, through the same substring-
containment gate (proseScore) searchRecentPages already uses for a
page's URL, since a fuzzy subsequence match over a whole URL or path is
close to meaningless. TabResult carries the real url/filePath instead
of null, and the tab row's subtitle now leads with the workspace name
(disambiguating identical URLs open in different workspaces, or across
windows) followed by the url/filePath/tabType, in place of the old
"tabType • workspaceName" line.

11 tests cover: URL-only and file-path-only matches, both fields
populated for the right tab type and left null for the other/a blank
path, a short query not matching a URL by fuzzy accident, title+URL
both matching taking the higher (title) score with title highlight
ranges preserved, live navigation changing which URL matches (and the
old URL no longer matching), directory-path matching without a
subsequence false-positive, and no-open-tabs contributing nothing
rather than failing.

* fix(browser): replace superseded capture requests (#509)

* Stop anon reaching schema public by inheritance, and scope identity to real orgs

The BOSS Supabase anon key is compiled into this repo, which is public. Anything
`anon` can execute is therefore executable by anyone. Verified on 2026-09-08:

  * get_encryption_key() returned the Vault master encryption key, unauthenticated.
    decrypt_text() was anon-callable beside it, making a decryption oracle over
    everything encrypt_text protects - user secrets and the QBO/Google broker
    credentials.
  * find_user_by_email() confirmed any address and returned its uuid.
  * list_shareable_recipients() returned 152 users WITH full email addresses to
    any self-registered account, and 82 @risalabs.ai addresses on a search.
  * arcade_leaderboard() and arcade_bs_standings() published the roster of
    everyone who had opened the Arcade, unauthenticated.

None of it was granted on purpose. PostgreSQL hardwires EXECUTE to PUBLIC on
every new function, PUBLIC includes anon, and this project's default privileges
add anon on top - so a SECURITY DEFINER function is internet-callable from the
moment it is created. Both revokes are traps in mirror image: `from public`
leaves the explicit anon grant, `from anon` leaves the hardwired PUBLIC one, and
ALTER DEFAULT PRIVILEGES cannot remove the latter at all (pg_default_acl loses
the entry and new functions still get `=X`).

  20260908000000  event trigger: revoke PUBLIC+anon on every function created in
                  schema public. An explicit `grant ... to anon` after the create
                  still wins - anon access must be stated, never inherited.
  20260908010000  org_visible_users / org_is_vetted / user_display_name: ONE
                  definition of "may this account learn who that account is",
                  shared by the Arcade and poker rather than copied. Vetted means
                  a human approved the join, which excludes the catch-all `boss`
                  org every account joins on signup (153 members, 20 domains).
  20260908020000  route list_shareable_recipients through both. It was already
                  org-scoped, which is why it looked right; it accepted ANY
                  shared org.
  20260908030000  one-time sweep of the ~30 functions that already had the
                  inherited grant. The RBAC mutators fail closed
                  (is_user_admin(NULL) is false), so this is defence in depth,
                  not a patched escalation.

The rule is a SET, not a per-target predicate: as a per-row qual it is pushed
below a DISTINCT ON and evaluated once per underlying row - 2.7s over 29k score
rows for 45 players, against 37ms.

supabase/audit/identity_disclosure_audit.sql is the standing check, because "we
fixed the leak" is not a durable claim. All four checks report HEALTHY.

Left deliberately anon-callable, each documented where it is kept: the plugin
store browse API, the three helpers called from RLS policies on anon-readable
tables, and custom_access_token_hook. Verified after the sweep that anonymous
plugin-store browse and signed-in RBAC reads both still work.

Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>

* Add the master-key rotation procedure, and rotate

get_encryption_key() was anon-callable, so the Vault master_encryption_key was
retrievable by anyone holding the project anon key - which ships compiled into
this public repo. Revoking access does not un-disclose a key, so it was rotated
on 2026-09-09 and the 184 rows encrypted under it re-encrypted.

Scope of the original exposure, stated precisely because the capability was
worse than the reach: decrypt_text() was anon-callable beside it, so an attacker
holding ciphertext from ANY channel - a backup, an export, a screenshot - could
decrypt it through the API without even needing the key. But no bulk read path
to that ciphertext existed: qbo_token_state and google_token_state have no
client grants at all, and all 178 secrets rows have org_id NULL, so the secrets
policy reduces to owner-only. This was a serious latent vulnerability - one
org-shared secret, one RLS slip, or anyone with backup access would have had
plaintext - rather than a confirmed bulk disclosure.

The script is kept because rotation is not a one-off. It is atomic (one DO
block), self-verifying (md5 of every row's plaintext captured before, re-derived
after through decrypt_text so the check covers both the swap and the data), and
a mismatch or row-count drift raises and rolls back, so a broken rotation cannot
commit. Verified after the run: the live key differs from the disclosed one,
184/184 rows decrypt under it, and the disclosed key opens 0 rows.

The old key is retained in the Vault under an explicit name. Do NOT delete it
while pre-rotation backups exist - they are encrypted under it.

Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>

* fix(db): close signed-in crypto access and verify visibility boundaries

* test(db): exercise repeated key rotation and exact anonymous ACLs

* test(db): grant fixture role membership on Supabase Postgres

* test(db): inline rotation source for isolated pgTAP mounts

* test(db): keep generated rotation SQL out of source control

* fix(db): reserve identity-taking store mutators for the edge service

* fix(db): serialize rotations without requiring direct Vault writes

* fix(db): address review gaps in system-org and rotation coverage

* test(db): verify core secrets across hex and broker-free rotations

* test(db): execute standing audit and missing-signature regression

* fix(db): enforce revoke postconditions and harden rotation verification

* test(db): enable recovery metadata in the authenticated fixture

* test(db): use the schema-supported authenticator type

* Address remaining database review quality findings

* Fix invoker view audit boolean parsing and test timestamp bounds

* Rotate the TOTP envelope, exempt extension routines, and close the repo/prod drift

Addresses the handoff's database-integration item and the substantiated findings
from the current-head review. Everything below was executed against the PR's own
Supabase preview branch, not asserted from reading.

**The blocker: rotation refused to run once #417 landed.** The guard was a
blanket "TOTP is installed, refuse everything". It is now an adapter. The stored
form is 'v1:' || encrypt_text(...) - same cipher, same key, only the framing
differs - so the column map gained an envelope prefix and rotates like the rest
once the prefix is stripped and re-applied. Three things this needed that reading
the diff would not have shown:

  * #417's trigger RAISES on a v1: value ('TOTP input must be plaintext, not a
    storage envelope'), so the re-encryption update is rejected outright. The
    reviewed trigger is now disabled for the update and restored after, inside
    the same transaction.
  * safe_decrypt_recovery_codes returns jsonb, not text, so verification through
    the real read path needed a cast. Both fingerprints now go through each
    column's OWN application read path rather than decrypt_text, which also
    removes the step-1/step-5 asymmetry raised as U5.
  * a step 0 pre-check reports rows that are already unreadable, instead of
    letting a safe_decrypt_* NULL surface at the end as "a row was missed".

The rejection contract is preserved, not removed: an unknown envelope version,
an unmapped safe_decrypt_* wrapper, or an unreviewed BEFORE trigger on a mapped
table each still refuse. All three are now regression-tested, along with the
recovery-code column that was previously never exercised (its fixture was
vacuous - create_secret writes no secret_metadata row without p_twofa_enabled).
Verified: three consecutive rotations, TOTP/recovery/password all intact, v1
envelope preserved, trigger re-enabled and still enforcing its own contract.

**CREATE EXTENSION was impossible.** The fail-closed guard aborted the first
routine of any extension installed into public: `create extension pgtap` failed
with "Anonymous EXECUTE remains on public.pg_version()". A guard that forces
operators to disable it in order to install an extension is a guard that ends up
disabled. Extension-owned routines are now exempted with a warning, and the
exposure stays visible as advisory CHECK 1x rather than vanishing - it reports
pgtap (1079) on the preview. The sweep skips them too: pgcrypto-style helpers
are called from column DEFAULTs and CHECK constraints, which are evaluated with
the DML role's privileges. No extension owns a function in public on a clean
database, so no deployed behaviour changes.

**The repo was weaker than production.** find_user_by_email, get_session_status
and update_api_key_last_used were locked down on the live project on 2026-09-08
but never captured as a migration, so a fresh deploy re-opened them.
find_user_by_email is a user-enumeration oracle over auth.users and signup is
open. The standing audit caught this itself on the preview - CHECK 2 named it -
which is the drift that check exists for. Both remaining callers use
SUPABASE_SERVICE_ROLE_KEY, verified on this branch, so service_role keeps
EXECUTE and neither path changes.

Also: the guard no longer hard-fails on a database without the Supabase roles (a
plain restore), and the vault fixtures no longer assume the key is absent (U3) -
both suites failed outright on any database that already had one. Retained-key
assertions measure this run's delta instead of an absolute count.

Suites on the preview: rotation 16/16, db access audit, and visibility 54/54 all
clean; the standing audit reports no failing gated check.

Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>

* Exercise the anonymous read path, not just the grant

The keep-list assertions only checked has_function_privilege for the seven
allowlisted signatures. That proves the grant, not the path: an RLS policy
expression is evaluated as the QUERYING role, so revoking a policy helper turns
an anonymous SELECT into 'permission denied for function ...' rather than an
empty result, and no privilege assertion can see it.

The seeding is the part that matters. A policy expression runs PER ROW, so on
an empty table it is never evaluated - and plugins and user_roles are both empty
on a fresh database, which made the first version of this probe pass no matter
what had been revoked. Caught by trying to make it fail.

Sensitivity is stated from measurement, not assumption: with a row present,
revoking can_view_plugin_row from anon does fail the probe and revoking
authorize does not, because permissive policies are ORed and short-circuit. A
helper in a policy that never has to be evaluated cannot be detected this way by
any test, so the comment says so rather than implying broader coverage.

Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>

* Make the gated audit checks and the test generator provable

Both halves of this are the same failure: a suite that is green while proving
nothing. I hit that twice writing the previous commits - a recovery-code fixture
over a secret_metadata row create_secret never wrote, and an anonymous-read
probe over an empty table whose RLS policy therefore never evaluated - so these
are not hypothetical.

Finding 6. The four CI-GATED checks (1, 1b, 4, 5) only ever asserted HEALTHY,
while every advisory check already had a fixture-based detection test. An
inverted `not exists`, a wrong role literal or a typo in the evtenabled test
would have left the gate permanently green. Each is now broken deliberately and
asserted to report it: a routine granted to anon AFTER creation (which is how
one gets past the event trigger), a revoked deliberate anonymous grant, a
disabled event trigger, and a crypto routine exposed to authenticated. They have
teeth by construction - the assertion is that the finding appears, so a broken
audit query fails them.

Finding 8. The generator gained --check, which regenerates in memory and
compares without writing, and orphan removal for a generated suite whose .sql.in
has been renamed or deleted - that file otherwise keeps being executed forever
with stale content. Orphans are identified by a provenance banner rather than a
hard-coded list, so a hand-written suite is never touched; verified that
explicit_anon_and_org_visibility_test.sql is untouched. Each guard was proven by
making it fire: a hand edit and a planted orphan are both reported by --check,
and generate removes the orphan.

CI now runs generate and --check as their own step, so a preparation failure is
visible in the log instead of being attributed to the test run.

Preview: rotation 16/16, db access audit 15/15, visibility 56/56.

Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>

* Announce every project change, not only the plugin-initiated ones

Panels could come up empty and stay empty, and the reason was that the
startup restore told no one.

ProjectChangeEvent was published from ProjectDataProviderImpl.selectProject,
which is the path a PLUGIN takes. The two callers that matter most bypass
it: WorkspaceApplier.applyWorkspace calls windowProjectState.selectProject
directly when it restores the workspace, and BossTopBar's picker goes
through selectProjectInWindow. Neither published anything.

The ordering that produced the empty panel: DefaultPlugin is constructed in
a DisposableEffect keyed on registries and window state, not on
selectedProject, and it kicks off the plugin scan asynchronously while
BossAppScaffold composes and the sidebar builds panels immediately. The
restore meanwhile waits on WorkspaceManager's sequential Dispatchers.IO JSON
reads. When those reads are slow the panel is built first, reads the ""
that WindowProjectState seeds itself with, and renders its no-project state.
The restore then lands, silently, and nothing remounts the cached component.

Publishing from the state itself rather than from one caller catches all
three. The bus is MutableSharedFlow(replay = 0), so a publish that never
happens cannot be recovered by a later subscriber - which is why this could
not stay per-caller.

The publish is removed from selectProject rather than added alongside the
collector; keeping both would double-fire on the plugin path.

previousPath is seeded from the current value so the StateFlow's replay of
it is not announced as a change. That seed is "" at startup, and telling
every plugin the project just became "" moments before the real restore
arrives is precisely the clear-yourself signal worth avoiding.

One collector per window: projectDataProvider is `by lazy` on DefaultPlugin,
which is per-window, so this cannot stack.

Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>

* Publish from the state's own callback, not from a lazily-built provider

The review's finding 1: observing `selectedProject` from `ProjectDataProviderImpl`
put the fix behind two `by lazy` initializers. `projectDataProvider` and
`applicationEventBus` are both lazy on `DefaultPlugin`, and the second is the only
host path that creates the bus at all. So the collector started only if some plugin
touched both before the workspace JSON reads finished - and "the reads are slow" is
the premise of the bug. Touched after the restore, the collector seeds to the
restored path and announces nothing; never touched, no caller is announced at all.

The announcement now hangs off the `ProjectSelectionCallback` that
`WindowProjectStateRegistry` installs when it builds the window's state, which
`BossAppState` does eagerly in composition. `WindowProjectState.selectProject` is
the sole mutator of the selection and invokes that callback synchronously, so every
caller is covered with no coroutine, no scope and nothing lazy in the path. Being
synchronous also makes `previousProjectPath` a faithful history rather than
best-effort: there is no StateFlow conflation to collapse A -> B -> C into A -> C.

The two registry entry points carried a copy of the wiring each; they now share one
`newState`, so the announcement cannot be installed on some windows and not others.

Finding 1's third mitigation, which is a hole of its own: `publishSystemEvent` was a
no-op whenever the bus had not been created, so on a build where no installed plugin
had touched `applicationEventBus` yet, no host event existed - not `ProjectChangeEvent`,
not `AuthEvent`, not `TabEvent` - and with `replay = 0` none could be recovered.
It now creates the bus instead of dropping. `getInstance` also re-checks the registry
on every call rather than only at creation, so an instance that exists while the
registry is empty can no longer strand the host's publisher.

Findings 2 and 3: `ProjectDataProviderImpl` implements `DisposableProvider` and
`DefaultPlugin.dispose()` releases it through a named delegate, alongside
`logDataProviderDelegate` and `gitDataProviderDelegate`; its scope gets a
`SupervisorJob`, matching `pluginScope`.

Tests: `ProjectChangeAnnouncementTest` (6) pins a direct `selectProject` being
announced, the previous-path chain, the seeding rule, the same-path suppression,
both registry entry points, and the bus being created rather than dropping the event.
Full `:composeApp:desktopTest` green: 3695 tests, 0 failures. `detekt ktlintCheck` clean.

Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>

* Round 2: honest bus wording, atomic previousPath, three more tests

Review (1/2) and (2/2).

1. `publishSystemEvent` does not save the event it creates the bus for. Correct - no
   registered publisher means nobody holds the bus, so it has no subscribers and that
   first event still reaches no one. The comment, the test name and the PR body all
   claimed otherwise. Reworded to what it actually buys: the host stops being
   permanently silent while it waits for a plugin to touch `applicationEventBus`.

3. `previousPath` was check-then-act on a plain field, and
   `ProjectDataServiceBridge.selectProject` is a suspend gRPC handler with no hop to
   Main (verified: `KernelBootstrap` registers it, the bridge calls
   `provider.selectProject` directly). Now an `AtomicReference.getAndSet`, so the read
   and the write are one operation.

5. The registry read-modify-write moved back inside `synchronized(this)`. Both fields
   are in fact `@Volatile` in boss-plugin-api 1.0.87 (checked the pinned jar), but the
   lock is uncontended after the first call and removes the question. The
   bus-before-publisher ordering is now written down, including why a publish landing
   in that window loses nothing.

6. `initialPath` KDoc no longer describes a production scenario it cannot reach; it is
   documented as defensive and test-reachable, and defaulted to "".

7. Three tests added:
   - a plugin-initiated selection is announced exactly once (catches both a silent
     regression to zero and an accidentally re-added publish);
   - the registry test now asserts the recent-projects half of the callback ran -
     deleting it from `newState` previously left every test green;
   - `dispose()` stops the recent-projects collector, which is the whole reason
     `projectDataProviderDelegate` became a named lazy.

   `Dispatchers.setMain(UnconfinedTestDispatcher())` for the class: the provider
   collects on `Dispatchers.Main`, which has no implementation in a plain test JVM, so
   its collector silently never ran. Unconfined also makes the dispose test
   deterministic rather than a sleep.

Smaller: `SupervisorJob` comment describes it as future-proofing (there is one
collector); `systemEventBusScope` is `by lazy`; the KERNEL-mode consequence of
disposing the provider is documented on `dispose()`.

Not taken: `replay = 1` for `ProjectChangeEvent`. It would close the mirror race, but
it changes `events()` semantics for every subscriber and every event type on a bus
whose consumers are out of tree. The body now says the race is narrowed rather than
closed, and names the api-side `selectedProject` StateFlow as what closes it.

`:composeApp:desktopTest` 3697 tests, 0 failures. `detekt ktlintCheck` clean.

Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>

* Round 3: unconditional announcement, ordered publish, drop dead register

Review 3.

2. AGENTS.md: a bullet in the canonical "what a third-party plugin can observe"
   paragraph, since this widens *when* a filesystem path reaches every installed
   plugin.

3. The `expect` KDoc still said "a no-op if the bus has not been created yet". Only
   the `actual` had been corrected. Fixed, and it now states the part that IS still
   best-effort: replay = 0 means an unsubscribed event is gone either way.

4. The announcement sat downstream of `ProjectState.updateRecentProjects`, so a throw
   there skipped it AND left `previousPath` stale - every later selection reporting a
   previous path one step behind, silently, for the session. Now `try { recents }
   finally { announce }`: order preserved for anyone reading recents off the event,
   the announcement unconditional, the throw still propagating.

5. `getAndSet` closed the read-modify-write but not the publish order, so two
   concurrent selections could emit out of order. `previousPath` and the publish are
   now in one `synchronized` block (the AtomicReference is gone - the lock subsumes
   it). The KDoc says plainly what this still does not settle: `WindowProjectState`
   writes `_selectedProject.value` then calls the callback with no atomicity, so state
   and last event can still disagree. Closing that means locking upstream.

6. `ProjectState`'s async `loadRecentProjects()` assigns `_recentProjects.value`
   wholesale and could land mid-test, dropping a just-added path - only where
   `~/.boss/recent-projects.json` exists, so a developer-machine-only flake. A
   once-per-JVM settle in `@BeforeTest` puts that single file read before any test.
   The test paths stay deliberately non-existent, now with a comment saying why: the
   fire-and-forget saves are unordered, and `loadRecentProjects` reclaims entries whose
   directory is gone, so a real temp directory would leak where these self-heal.

7. `register` deleted. No production caller (`BossAppState:299` uses `getOrCreate`),
   and it overwrote an existing entry - handing back a state with a fresh announcer
   seeded to "" for a window that already had a project. `newState` stays; it is what
   keeps the wiring from drifting.

8. `@Volatile` dropped from `ApplicationEventBusImpl.instance` - every access is inside
   the lock now, and leaving it reads as if a fast path survives.

Also: a test for the actual regression path, `applyWorkspace` announcing the project it
restores, rather than a comment claiming to imitate it.

Answering the grep you could not run: the only `projectChanges()` consumers in
boss_plugins are the two fluck-agent panels (`FluckAgentViewModel`), and both assign
`_bossProject.value` and re-sweep - idempotent on a repeat. Nothing used the repeat
publish as a reload nudge. Recorded in the announcer comment.

Item 1 was already in the PR body from round 2 ("The startup race is narrowed, not
closed"), naming the mirror case and the api-side StateFlow that closes it.

`:composeApp:desktopTest` 3698 tests / 368 classes, 0 failures. `detekt ktlintCheck` clean.

Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>

* Round 4: split the dispose out, stop tests writing the real ~/.boss

Review 4. Items 1 and 3 were the before-merge ones.

1. Verified: ProjectDataServiceBridge.watchRecentProjects collects
   provider.recentProjects, a StateFlow, so cancelling the provider's scope on
   window close leaves that gRPC stream open and silently frozen for every
   out-of-process plugin. Taking the first option and SPLITTING the dispose out.

   Note this reverses what round 1 asked for, and the justification changed rather
   than the opinion: once the announcement moved to the registry callback,
   ProjectDataProviderImpl went back to being exactly what it was before this PR, so
   the leak is pre-existing and unrelated to the subject. Closing it properly means
   the bridge reading ProjectState directly instead of a per-window provider, which
   is its own change. The reasoning is on the class so it is not re-fixed by accident.

3. Verified and worse than described: MAX_RECENT_PROJECTS = 10, so test entries evict
   real ones from the developer's picker and no cleanup restores them.
   systemProperty("user.home", <build>/test-home) on the Test task. One run with it in
   place shows the existing suite was writing far more than recents to the real home -
   window-appearance-settings.json, keymap-settings.json, scrollbar-settings.json,
   recent-browser-pages.json, dashboard-stats.json and a ~/BossProjects/ directory all
   land in test-home now. The settle is gone with it: no recent-projects.json in
   test-home means the wholesale reload never happens.

2. publishSystemEvent now refuses the bus != null && systemPublisher == null state
   instead of falling through into a bus that may not be the registry's, with one
   warning rather than one per event. The comment at the fallback is true as written.

4. Both stale comments fixed (one construction path, not two).

5. hostProjectCallback(updateRecents, announcer) extracted so the try/finally claim is
   testable - ProjectState is an object, so a hard-coded call cannot be made to fail.

6. The publish-inside-the-lock trade is spelled out in the KDoc: what it buys
   (ordering), what it costs (an inline subscriber runs holding the lock inside
   selectProject), and that the contended path is untested.

7. The serial-execution dependency is recorded in the test class KDoc.

Plus: multi-window isolation, and a test that makes the recents update throw.

One thing this round caused and fixed: removing dispose() left two
ProjectDataProviderImpl collectors alive on the test dispatcher. On a
TestCoroutineScheduler a live coroutine is something every later runTest waits on, and
the git classes timed out at 60s in full-suite runs while passing in isolation.
Dispatchers.setMain(Dispatchers.Unconfined) rather than UnconfinedTestDispatcher():
same inline behaviour, not enrolled in a scheduler anyone else observes. It is also a
real argument for the follow-up - without dispose() the provider cannot be constructed
in a test without leaking.

:composeApp:desktopTest 3699 tests / 368 classes, 0 failures. detekt ktlintCheck clean.

Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>

* Round 5: reset test-home per run, stop getInstance stealing a publisher

Review 5.

1. Confirmed reproducibly - build/test-home/.boss/recent-projects.json was sitting
   there from the previous run. doFirst now deleteRecursively() before mkdirs(), so
   the home is fresh per run rather than merely private. Without it the redirect only
   helped the first run and ProjectState.init's load reintroduced the same race from
   the second. Verified by running the full suite twice back to back.

2. Right, and sharper than it looks: the guard tested `bus` but wrote both fields, and
   `systemPublisher != null && bus == null` is exactly what ProjectChangeAnnouncementTest,
   BrowserAnalyticsEmissionTest and BossTabsComponentMoveTest install. Guard now tests
   both, so getInstance cannot take a publisher away from whoever set it.

3. Test added for the warn-and-drop branch, asserting the DROP rather than the warning -
   partialRegistryWarned is a one-shot process global, so "it warns" is unassertable
   after the first test to trip it. Uses a stub bus so the half-registry state is real.

4. The re-entrancy hazard is now documented as SAFE and why (synchronized is reentrant,
   previousPath advances before the publish), so it is not "fixed" later. The
   lock-widens-a-UI-hang-to-a-cross-thread-one point is in the same block.

5. Taken, including the optional ones:
   - hostProjectCallback keeps both failures (addSuppressed) instead of letting finally
     discard the first. Needs @Suppress("TooGenericExceptionCaught") - catching
     Throwable is the contract, and both are rethrown.
   - ProjectDataProviderImpl takes an injectable dispatcher (default Dispatchers.Main).
     This removes the global setMain AND the round-4 collector leak at the source
     rather than working around them, without reopening the DisposableProvider split.
   - Three more pins: a null window state announces nothing, applyWorkspace
     (restoreProject = false) announces nothing, unregister + getOrCreate restarts the
     chain at "".

Not taken, with reasons: jvmArgumentProviders (the current form works, is
config-cache-serialisable and passed CI on three OSes); widening the user.home redirect
to plugin-path-utils (its test only mkdirs a directory every BOSS user already has).

There is no CHANGELOG in this repo, so the release-notes line for the same-path change
is an action item at release time, not a file change. Flagged in the body.

Two consecutive full runs: 3703 tests / 368 classes, 0 failures both times.
detekt ktlintCheck clean - it caught two TooGenericExceptionCaught and a long line in
this round's own code first.

Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>

* Address project announcement review feedback

* fix(plugin-store): restrict plugin_downloads RLS to the server-side pipeline (#488)

* Batch validation: promote latest reviewed dev changes to main (#463)

* Fix #30: Resolve duplicate context menu label collisions

* Cleanup: Remove dead code for #91 and #93

* chore: Sanitize SubmitResult.Error at construction rather than at one render site

* Fix panel component lifecycle disposal

* fixes

* Guard panel lifecycle destruction failures

* fix(logging): sanitize secret RPC failures and crash-report errors

Three related gaps in what gets logged and shown when something fails:

- SecretService.kt had no BossLogger in any of its ten catch blocks (#145).
  When the organisation migration broke all four secret RPCs (#144), the
  only WARN in the log came from the calling plugin - the code that
  actually failed said nothing. Every catch now logs via
  logger.warn(LogCategory.NETWORK, ...), reusing the already-sanitized
  failure for both the log and the returned Result rather than sanitizing
  twice. RoleService and RoleCreationService were checked and already log
  correctly - SecretService was the only silent one.

- LogSanitizer.sanitizeExceptionMessage redacted a hostname only when it
  appeared inside a URL - a bare hostname (exactly what
  UnknownHostException.getMessage() produces, i.e. every DNS failure, and
  what a proxy-connect failure looks like) passed through untouched (#109).
  Added a narrow hostname pattern: lowercase-only labels ending in a short
  explicit TLD/`.internal`/`.local` list, with a negative lookahead so a
  package path that happens to end in a real TLD word mid-FQN
  (kotlinx.coroutines.internal.ScopeCoroutine, kotlinx.io.EOFException)
  is not mistaken for one - caught by the existing realistic-stack-trace
  test after the first version of the pattern redacted a live Kotlin
  package name out of it.

- CrashReportService.SubmitResult.Error held a raw exception string,
  sanitized at exactly one render call site in CrashReportDialog (#110).
  The constructor is now private; SubmitResult.Error.of(...) is the only
  way to build one, and it sanitizes before the raw string can reach
  .message - a property of the type now, not something every future
  consumer (a copy button, a toast, a log line) has to remember on its own.
  Both construction sites (the service's two catch blocks, and the one in
  CrashReportDialog the issue names directly) now route through it.

Tests: new coverage for the ten now-logging SecretService paths (via
SupabaseWiringTest's existing sanitization-wiring guard, updated to
recognize the "sanitize once into a local, reuse for log and return" shape
SupabaseDataProviderImpl already used), six new LogSanitizerTest cases for
the hostname fix (including the FQN/version-number false-positive guards),
and a new CrashReportServiceTest for the sanitize-at-construction guarantee.

* test(crash): extract construction tests from #404

Selected unchanged test file from Antriksh1984 original commit 99d2a5228023c541e825fe2714619c8228140369 (PR #404). Maintainer extraction only; subsequent API/scope adaptations are recorded separately.

* chore(ipc): clarify advisory menu ID scope and fix formatting

* chore(ui): finish obsolete toolbar comment cleanup

* test(crash): adapt consolidated coverage and guard factory visibility

Maintainer consolidation: use #311 companion invoke and a URL fixture instead of depending on #404 hostname redaction. Add private constructor/copy bytecode assertions. Preserve original contributor tests and implementation credit separately.

* refactor(crash): consolidate construction sanitization in #311

Maintainer scope change: remove only the duplicate #110 implementation, retaining Antriksh1984 original #109/#145 work and commit history. Standalone construction tests are retained with attribution in #311; its Aditya8369 implementation supersedes Error.of. Keep render-time sanitization here until #311 merges and describe the remaining hostname coverage conservatively.

* test(panels): retain sibling lifecycle isolation coverage from #313

Adapt the original #313 test to the #317 constructor and supply the missing panelInfo overrides. Original test scenario and assertions are by @rehannayeem0786; these compile adaptations are maintainer integration work.

* fix(panels): complete lifecycle cleanup across failure and window teardown

Destroy partially constructed panels and replacements that fail to resume. Continue downward lifecycle transitions after a failing pause or stop callback. Dispose panels before plugin teardown in the same callback rather than relying on sibling Compose effect order. Add regression coverage and adapt the retained #313 test bodies for detekt. These changes are maintainer follow-up to the original #313/#317 contributions.

* docs(ui): remove stale disabled top-bar feature list

* test(ipc): protect advisory menu item ID uniqueness

* fix(panels): keep store registration scoped to its window effect

Remove the redundant unregister from plugin teardown. Document independent context services and synchronous Essenty onCreate replay, with tests for registration ownership and exactly-once create callbacks. Keep tab teardown hardening separate. Maintainer follow-up to the review of #317; original #313/#317 contributor credit is unchanged.

* fix(crash): address consolidated sanitization review notes

Maintainer follow-up to Claude N1-N4: document factory/copy invariant, correct stale comments, move Aditya original construction assertions into the service suite while retaining Antriksh blank/diagnostic cases, and log unexpected dialog submission failures. Original contribution credit remains separate.

* fix(logging): keep server failure payloads out of secret RPC logs

Maintainer follow-up to Claude review: log operation and exception type only, preserve sanitized return semantics, and check each catch for safe return/log wiring. Document measured hostname limits without broadening the matcher; add module-local redaction and diagnostic-preservation coverage. Antriksh original implementation remains credited separately.

* ci: build PR batches on dev

* Allow Claude diff reviews after approved fork builds (#413)

* fix(browser): preserve newer clipboard copies during plain-text paste (#316)

* fix(browser): paste-without-formatting no longer clobbers a copy made in its restore window (#205)

* fix(browser): make paste-without-formatting's restore identity-based, not text-based

Review of this PR caught that the text-equality guard cannot distinguish 'our write is still current' from 'a previous press already restored the rich original' - whose string projection is by construction the same text - so two presses inside the 200ms window permanently downgraded a rich clipboard to plain text. A PasteWithoutFormattingSession now tracks the exact Transferable each press installed and restores the pre-window original once, while a user copy in the window still wins. Adds five tests to BrowserClipboardCommandsTest, including the double-press regression; wraps the two over-limit lines; e.message -> e::class.simpleName in the touched handlers.

* fix(browser): fold tryRestore's early exits so it stays within detekt's ReturnCount

* fix(browser): blank lines between FakeTransferable overrides per ktlint

* test(browser): retain clipboard restore scenarios from #408

* fix(browser): track clipboard ownership through AWT wrappers

---------

Co-authored-by: rehannayeem0786 <rehannayeem0786@github.com>
Co-authored-by: Shivang <shivang.iitk@gmail.com>
Co-authored-by: Antriksh1984 <antrikshsingh850@gmail.com>

* fix(plugins): serialize concurrent first loads per class name (#324)

* fix(plugins): prevent duplicate class definitions during concurrent loads

* fix(plugins): make class loading parallel-safe

* test(plugins): pin concurrent loading lifecycle boundaries

Maintainer consolidation follow-up: retain #324 synchronization and its tests; add concurrent shared-name, superclass, and unload-marker coverage. Document caller-sensitive registration based on arjun28115 review feedback and clarify that marking unload does not drain an already admitted parent lookup. No global lifecycle lock or resource-policy changes.

---------

Co-authored-by: sgoel2be24-cyber <223222024+sgoel2be24-cyber@users.noreply.github.com>
Co-authored-by: Procs <168113425+ProportanilityConstant@users.noreply.github.com>
Co-authored-by: Shivang <shivang.iitk@gmail.com>

* fix(browser): defer native disposal until admitted calls drain (#312 + #409) (#412)

* fix: make BrowserHandle JavaScript execution cancellable

the previous synchronous JxBrowser call blocked the Main/EDT thread;
coroutine cancellation could not take effect while that call was blocking;
the implementation now uses JxBrowser’s asynchronous JavaScript callback API;
suspendCancellableCoroutine makes the Kotlin waiting side cancellable;
late callbacks after cancellation are safely ignored;
this does NOT terminate JavaScript already executing inside Chromium.

* fix: add robust native call lifecycle tracking for disposal

* test: verify native operation cleanup on synchronous failure

* fix: linearize browser disposal and pending operation tracking

* fix: resolve detekt violations in browser native tracking

* test: satisfy detekt failure simulation rule

* fix: close native operation disposal race

* fix(browser): drain an in-flight call before closing the browser

Issue #300 reports that executeJavaScript is a synchronous, non-
cancellation-aware native call, and a plugin's own withTimeoutOrNull
around it can only abandon the caller's wait - not the call itself -
which stays running on Main indefinitely and can race a concurrent
handle.dispose(), touching the same native object from two threads at
once.

The severe half of this was already fixed by BoundedBrowserCall: this
class confines every blocking round trip to one dedicated daemon thread
instead of Dispatchers.Main, so a wedged renderer no longer freezes the
app. What was not yet closed is the residual window this issue's core
report is actually about: shutdown() stopped new work but did not wait
for whatever was already running, so a caller could proceed straight to
browser.close() while a call from just before shutdown was still
finishing on the dedicated thread.

shutdown() now waits, bounded, for that in-flight call to drain before
returning. Costs nothing in the common case - awaitTermination returns
immediately once the one worker thread and its queue are both idle,
which is where an instance sits between calls - and only the bound in
the rare case something was genuinely still running.

Known, and disclosed in the KDoc rather than claimed away: this narrows
the race for the common case (a call that was always going to finish
quickly) rather than closing it. It cannot help when the in-flight call
is itself the wedge this class's own deadline exists for - waiting
unboundedly for a genuinely stuck call would reintroduce the exact freeze
BoundedBrowserCall exists to prevent, just moved from a plugin's await
into every caller's teardown path. There is no JxBrowser API on this
version able to interrupt a blocking round trip already inside the
native call, which is the whole reason the call is confined to its own
thread instead of cancelled - closing that window completely needs
JxBrowser's own cooperation, which the issue's own analysis already
concluded is unavailable.

Tests: shutdown waits for a fast in-flight call to finish before
returning, and does not wait past its own drain timeout for a wedged one
- the same before/after pair the rest of this test file already uses for
BoundedBrowserCall's deadline.

* fix(browser): defer native close until admitted calls drain

Consolidates the lifecycle work from #312 (johncybersage) and #409 (Antriksh1984), retaining both original histories. Replaces success-only callback accounting and timeout-then-close with executor termination signals and host-owned native/profile cleanup. These corrections and replacement tests are maintainer/agent work, separate from contributor scoring.

* fix(browser): bound profile waits and clarify deferred cleanup ownership

Address consolidation review: schedule both service disposal paths without awaiting native close, diagnose pending drains, centralize executor ownership, and bound profile lease acquisition without permitting unsafe reuse or eviction. Document process-exit abandonment and verify wiring and cleanup ordering. Maintainer/agent follow-up, separate from original #312 and #409 contributor credit.

* fix(browser): schedule disposal after early UI teardown failure

* ci: create launcher directory before Claude native installation

* Revert "ci: create launcher directory before Claude native installation"

This reverts commit 5184908e6c3f133502508513b4c5e17651b13bc0.

* test: keep warmup registry ordering check on one event loop

* test(browser): normalize CRLF in disposal source wiring guards

---------

Co-authored-by: john k <johnk@johns-MacBook-Pro.local>
Co-authored-by: john k <johnk@syn-172-100-137-112.res.spectrum.com>
Co-authored-by: Antriksh1984 <antrikshsingh850@gmail.com>

* feat(tabs): show a speaker glyph on tabs that are playing audio (#314)

* feat(tabs): show a speaker glyph on tabs that are playing audio (#308)

* fix(tabs): review round - compile, registry lifetime, UI-thread marshalling, owner flush

1. graphicsLayer import dropped (does not exist at that package); the fade now uses .alpha(audioAlpha), already imported. 2. TabAudioRegistry no longer outlives its owner: disposeAllTabsBlocking unregisters everything this component registered, and DetachedTab.destroy drops the entry for a tab destroyed without adoption - the handler captures the BossTabsComponent, so stale entries retained it. 3. The registry update is marshalled to the EDT via SwingUtilities.invokeLater, so the tab-model mutation happens on the UI thread as the KDoc claims. 4. setFullscreenHandler flushes the current playback state once ownerTabId becomes known, closing the starts-before-registration race the review could not verify. 5. TabAudioRegistryTest added: delivery, last-writer-wins, ownership-checked unregister.

* fix(tabs): CI round 2 - DetachedTab receiver error, long line, and baseline-preserving signatures

- BossMainWindowPanel.kt:2098: DetachedTab is a non-inner nested class and cannot use the outer component as receiver; the audio-handler drop moves to detachTab instead, which is where adoption-vs-destroy actually diverges. - TabAudioRegistry.kt:9 wrapped under detekt's 120-char limit. - FluckTabInfo.isPlayingAudio and BossTabButton's glyph read no longer change any signature: the flag is a mutable property (copied in copy()'s body) and the button reads it off tabInfo, so the constructor, copy() and BossTabButton keep their exact baseline-frozen detekt IDs and the resurfaced LongMethod/LongParameterList/CyclomaticComplexMethod findings retire.

* fix(tabs): fold handleAudioUpdate within ReturnCount; add missing final newline in the test file

* fix(tabs): publish audio state by browser ownership and keep icon layout stable

---------

Co-authored-by: rehannayeem0786 <rehannayeem0786@github.com>
Co-authored-by: Shivang <shivang.iitk@gmail.com>

* feat: connect chrome density settings and keyboard controls (#305)

* feat: wire the chrome density scale into settings and small-screen defaults

ChromeDensity / ChromeDimens.of() / LocalChromeDimens already existed on
main and every bar (BossTitleBar, BossTopBar, the main tab bar,
BossBottomBar) already read its height from BossChrome.dimens - but
LocalChromeDimens was never provided anywhere, so it silently resolved to
its staticCompositionLocalOf default (Comfortable) always. The scale was
built and unreachable.

This closes that gap:

- WindowAppearanceSettings gets a `density` field (default COMFORTABLE, so
  an existing install's settings file - which has never heard of this key
  - decodes to exactly the chrome it already had; no settings-version bump
  needed).
- BossApp.kt now provides LocalChromeDimens from that field, host-only and
  outside BossAppCompositionLocals (plugins never draw host chrome).
- A "Density" dropdown in Settings > Bars (Compact/Comfortable/Spacious),
  indexed in Settings search.
- A fresh install on a small screen (< 1000dp logical height, clearing the
  13" MacBook Air's ~931-956pt from #239's own measurements) now defaults
  to Compact and starts with the bottom bar off - the one bar this manager
  can still reclaim itself, since the side strips are already off by
  class default. Toolkit.getScreenSize() is read once, wrapped in
  runCatching (HeadlessException off a display must not break a fresh
  install), with a pure defaultDensityFor(screenHeightDp) so the decision
  is unit-testable without a display.

Addresses #239, scoped down from the full issue. Out of scope in this
pass, deliberately:

- The app does not yet report its own chrome budget as a measured
  percentage - the issue's own "state it, don't argue it" ask. Reachable
  later from the same ChromeDimens source, but needs a spot to render it.
- The title bar's 27dp "Boss Console" label row is untouched - collapsing
  or merging it with the tab bar is a separate, riskier layout change than
  a density scale.
- No regression intended to the existing per-bar show/hide switches or
  focus-mode edges: density only changes how much room a bar that is
  already on screen takes, never whether it is shown.

* fix: drop the Compact-density bottom-bar auto-off, wrap an overlong line

Address review feedback on #305:

- Removed showBottomBar = density != ChromeDensity.COMPACT from
  getDefaultSettings(). ChromeMetricsTest already shows the shipped
  macOS defaults reach 93.3% of a 931dp window at Comfortable, so
  #239's >=90% bar is met without touching the status bar - and that
  bar's own KDoc argues it must stay on ("the only always-on readout").
  It was also reachable from the settings-load catch fallback, so a
  transient read error could silently drop the bar and have the next
  save persist the loss. Compact now only changes density, nothing else.

- Wrapped primaryScreenHeightDp() - was 121 chars, one over detekt's
  default MaxLineLength (120), which applies here since .editorconfig's
  140 is a ktlint-only setting and this line wasn't in the baseline.

* feat: add chrome density setting

* feat: add small-screen chrome defaults

* feat: add chrome density controls and small-screen defaults

* fix(ui): preserve lean density defaults and test density controls

* style: format multiline screen-height lookup

* fix(ui): separate density recovery and make editor chords opt-in

* style: wrap density default documentation

---------

Co-authored-by: AdityaK-iiita <adityakolate0070@gmail.com>
Co-authored-by: Shivang <shivang.iitk@gmail.com>

* fix(plugins): stop host resource fallback after unload (#325)

* fix(plugins): stop host resource fallback after unload

* fix(plugins): preserve resource warning for a missing result

---------

Co-authored-by: sgoel2be24-cyber <223222024+sgoel2be24-cyber@users.noreply.github.com>
Co-authored-by: Shivang <shivang.iitk@gmail.com>

* Handle closed browser frames during navigation callbacks (#400)

* Handle closed browser frames during navigation callbacks

* test(browser): retain closed-event guard after navigation integration

* fix(browser): preserve helpers on PID failure and recognize closed transports

* style(browser): wrap review diagnostics for detekt

---------

Co-authored-by: Shivang <shivang.iitk@gmail.com>

* refactor(window): pin the panel content alignment width (#398)

* fix(window): restore strict width constraints for nested panels

Fixes #278. Commit c15660c5 inadvertently dropped the explicit width constraint for nested panels in the right dock by wrapping them inside a PanelColumn with a Box(weight(1f)) that lacked fillMaxWidth(). This loose constraint caused a known issue with SubcomposeLayout caching stale bounds when resized, resulting in Row content disappearing after weighted Spacers. This commit restores the .fillMaxWidth() propagation.

* Cover panel content alignment across width changes

* Keep panel layout regression in the existing app test package

* Document panel alignment contract and pin filling content width

* Wrap the panel width assertion to satisfy detekt

---------

Co-authored-by: Shivang <shivang.iitk@gmail.com>

* #320 - Fix quick actions vanishing in short tab rail (#328)

* #320 - Fix quick actions vanishing in short tab rail

* Fix: detekt & ktlint checks

* Fix rail action budgets and reversible fallback wiring

* Fix resize test assertion import and update rail coverage note

---------

Co-authored-by: Shivang <shivang.iitk@gmail.com>

* fix(crash): refine scroll boundary and bound error sanitization (#350)

* fix(crash): refine scroll boundary and bound error sanitization

* Avoid exposing a partial token at the crash message limit

* Document sanitizer input bound and verify expansion ordering

---------

Co-authored-by: Aishwary Anand <aishwary.cd22@bmsce.ac.in>
Co-authored-by: Shivang <shivang.iitk@gmail.com>

* fix(logging): redact private hostnames (#346)

* fix(logging): redact private hostnames

* Handle private hostname punctuation and preserve diagnostic ports

* Format hostname punctuation regression assertion

---------

Co-authored-by: ayush <workside@gamil.com>
Co-authored-by: Shivang <shivang.iitk@gmail.com>

* feat: Opening an .html file should ask open as a file or webpage (#333)

* feat: Opening an .html file should ask open as a file or webpage

* Fix HTML prompt delivery and persisted preference ordering

* Cover HTML routing and correct review test fixtures

* Honor HTML navigation intent and release pending prompts on failure

* Isolate HTML prompt handling from the general dialog host

---------

Co-authored-by: Shivang <shivang.iitk@gmail.com>

* fix(plugin-store): parse timestamps consistently in list and detail metadata (#379)

* Fix: Implement proper ISO timestamp parsing in PluginStoreClient

* fix(repository): implement robust ISO timestamp parsing for Supabase payloads

* style(repository): resolve detekt MaxLineLength and TooGenericExceptionCaught

* fix(plugin-store): implement plugin metadata timestamp parsing

PluginStoreClient.parseTimestamp was a stub that always returned 0L, so
every plugin fetched from the store showed "Last Updated"/"Published" as
the Unix epoch in the Toolbox UI regardless of what the server actually
sent (#337).

Parses the ISO-8601 timestamp (the shape the store sends, e.g.
2024-05-12T14:30:00Z, or with a numeric offset) via java.time.Instant,
falling back to 0L for a blank, missing, or malformed string rather than
throwing - matching the field's own empty-string default for a response
that omits it. java.time rather than adding kotlinx-datetime as a new
dependency: this module already uses java.util.* directly in the same
commonMain source set (it has one real target, jvm("desktop")), so nothing
is gained by introducing a second time library for one function.

Tests exercise the real PluginDetailResponse.toPluginInfo(), matching the
convention already established next to it in
PluginStoreResponseDecodingTest: a Z-suffixed timestamp, a numeric-offset
timestamp, a blank string, and a malformed string.

* Fix timestamp normalization edge cases and verify both response mappings

* Use release publication dates and pin timezone-independent fallback

---------

Co-authored-by: Sanjay <sanjaysaini4423@gmail.com>
Co-authored-by: Antriksh1984 <antrikshsingh850@gmail.com>
Co-authored-by: Shivang <shivang.iitk@gmail.com>

* feat(remote-ui): authenticate and expose remote UI surfaces (#348)

* feat(remote-ui): authenticate remote UI process identity

* feat(remote-ui): place authenticated remote UI surfaces

* fix(remote-ui): close ownership and placement lifecycle races

* test(remote-ui): expose placement recovery cases to JUnit

---------

Co-authored-by: Shivang <shivang.iitk@gmail.com>

* feat(dashboard): add shared read-only What's New release feed (#381)

* Add What's New release feed to dashboard

* Serialize update settings persistence

* Remove unused update settings import

* fix(updater): retain realtime refreshes during shared release fetches

* style(updater): format shared release fetch regression tests

* fix(updater): coalesce release refresh bursts and preserve visible history

---------

Co-authored-by: Shivang <shivang.iitk@gmail.com>

* fix(language): consolidate host and out-of-process language-id tables (#358)

* fix(language): consolidate host and out-of-process language-id tables

EditorLanguages (composeApp) and EditorServiceImpl (modules/boss-app-editor)
each hand-maintained their own extension-to-language-id table because
boss-app-editor - a plain JVM module compiled to a GraalVM native image -
could not depend on anything in composeApp. They disagreed: EditorServiceImpl
named .sh/.bash/.zsh "shell", EditorLanguages named them "bash", and
EditorServiceImpl was missing more than forty ids the other table had
(fortran, delphi, latex, lisp, tcl, clojure, batch, diff, ...) (#75).

Moves the table into a new plugin-platform/plugin-language-types module -
dependency-free by design, so it carries nothing extra into boss-app-editor's
native-image build - and has both EditorLanguages and EditorServiceImpl read
from it. This is the first time anything under modules/ depends on
plugin-platform/; verified compiling and passing tests before committing to
the approach.

EditorLanguages keeps its existing public API unchanged (same values for
every extension), so FileTypeCategoriesTest and EditorLanguageDetectionTest
needed no changes. EditorServiceImpl keeps its own "proto"->"protobuf" entry
and "plaintext" fallback as local additions on top of the shared table,
rather than folding them into it: proto isn't part of the boss-file-types.json
default-app-association surface the shared table backs, and "plaintext" is
this service's own gRPC default, not a value composeApp reads.

Adds LanguageIdsTest (the new module) and EditorServiceImplTest (previously
no tests existed for this class at all) - the latter pins the actual bug fix,
that detectLanguage("sh") now returns "bash" instead of "shell".

Out of scope, and disclosed rather than silently dropped: two of the five
duplicate tables the issue names - the editor-tab plugin's own
LanguageDetection and BossEditor's lexer registry - live in separate
repositories this build cannot reach. FileIcons.forSpecialFileName/forFile in
plugin-icons is also not consolidated: it keys icon selection off the raw
filename to preserve distinctions a language id can't carry (package.json,
yarn.lock and pnpm-lock.yaml are all valid JSON/YAML but get three different
brand icons) and never computes a language id in the first place, so
routing it through this table would need a separate icon-selection redesign.

* fix(language): keep file-association drift checks on the shared table

* fix(language): apply shared filename rules to editor file opens

---------

Co-authored-by: Shivang <shivang.iitk@gmail.com>

* fix(editor): contain write-local stack overflow and preserve fatal errors (#396)

* Make writeFileContentSafe actually safe: catch the Errors it was named for

`writeFileContentSafe` exists to return false rather than throw. It did not hold
that contract:

    } catch (e: Exception) {
        fileIoLogger.warn(LogCategory.EDITOR, "Error writing file", error = e)
        false
    }

StackOverflowError is an Error, not an Exception, so it went straight through -
out of writeFileContent, out of the editor_write_file MCP handler, and to the
caller as a bare StackOverflowError instead of the handler's own
"Write failed for <path>". The warn that would have named the file never ran
either.

That is not hypothetical. risa-labs-inc/boss-plugin-editor-tab#18 and #27 are two
independent reports of it, on unrelated content, and #27's complaint is precisely
the missing diagnosis: the error "gives no indication of which input caused it".

StackOverflowError and OutOfMemoryError are caught explicitly rather than
widening to Throwable. A stack overflow unwinds and leaves the JVM usable, and
readFileContentSafe in this same file already treats OutOfMemoryError as a
reportable outcome. Throwable would also absorb LinkageError and ThreadDeath,
which are not this function's to swallow - there is a test asserting a
NoClassDefFoundError still propagates.

The failure log now names the path and the character count. Not the content:
these writes carry whatever the user is editing.

**This does not fix the write.** Whatever recurses is upstream of this function,
which is mkdirs plus writeText - I ruled out the plugin's handler, this write,
and the host's MCP argument parsing, and said so on the issue. What changes is
that the failure is reported honestly instead of escaping, which is where a
diagnosis can start.

The body moves to `guardedWrite` with an injectable write, because a test JVM
cannot be made to overflow the stack inside writeText on demand.

Verified: 3729 tests, 0 failures, plus ktlintCheck and detekt.

Refs risa-labs-inc/boss-plugin-editor-tab#18, #27.

Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>

* docs(editor): clarify write guard scope and prior recursion fix

* fix(editor): preserve fatal heap errors in write guard

---------

Co-authored-by: Claude Opus 5 <noreply@anthropic.com>
Co-authored-by: Shivang <shivang.iitk@gmail.com>

* fix(state): apply version-checked JSON merge patches (#361)

* Fix: Implement proper ISO timestamp parsing in PluginStoreClient

* Feature: Implement JSON Merge Patch for plugin delta state synchronization

* fix(state): validate delta bases and exclude duplicate timestamp scope

* fix(state): reject malformed and deeply nested patches

---------

Co-authored-by: Shivang <shivang.iitk@gmail.com>

* :arrow_up: deps:(deps): Bump grpc from 1.83.1 to 1.84.0 (#363)

Bumps `grpc` from 1.83.1 to 1.84.0.

Updates `io.grpc:grpc-netty` from 1.83.1 to 1.84.0
- [Release notes](https://github.com/grpc/grpc-java/releases)
- [Commits](https://github.com/grpc/grpc-java/compare/v1.83.1...v1.84.0)

Updates `io.grpc:grpc-protobuf` from 1.83.1 to 1.84.0
- [Release notes](https://github.com/grpc/grpc-java/releases)
- [Commits](https://github.com/grpc/grpc-java/compare/v1.83.1...v1.84.0)

Updates `io.grpc:grpc-stub` from 1.83.1 to 1.84.0
- [Release notes](https://github.com/grpc/grpc-java/releases)
- [Commits](https://github.com/grpc/grpc-java/compare/v1.83.1...v1.84.0)

Updates `io.grpc:grpc-services` from 1.83.1 to 1.84.0
- [Release notes](https://github.com/grpc/grpc-java/releases)
- [Commits](https://github.com/grpc/grpc-java/compare/v1.83.1...v1.84.0)

Updates `io.grpc:grpc-util` from 1.83.1 to 1.84.0
- [Release notes](https://github.com/grpc/grpc-java/releases)
- [Commits](https://github.com/grpc/grpc-java/compare/v1.83.1...v1.84.0)

---
updated-dependencies:
- dependency-name: io.grpc:grpc-netty
  dependency-version: 1.84.0
  dependency-type: direct:production
  update-type: version-update:semver-minor
- dependency-name: io.grpc:grpc-protobuf
  dependency-version: 1.84.0
  dependency-type: direct:production
  update-type: version-update:semver-minor
- dependency-name: io.grpc:grpc-stub
  dependency-version: 1.84.0
  dependency-type: direct:production
  update-type: version-update:semver-minor
- dependency-name: io.grpc:grpc-services
  dependency-version: 1.84.0
  dependency-type: direct:production
  update-type: version-update:semver-minor
- dependency-name: io.grpc:grpc-util
  dependency-version: 1.84.0
  dependency-type: direct:production
  update-type: version-update:semver-minor
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
Co-authored-by: Shivang <shivang.iitk@gmail.com>

* :arrow_up: deps:(deps): Bump protobuf from 4.36.0 to 4.36.1 (#364)

Bumps `protobuf` from 4.36.0 to 4.36.1.

Updates `com.google.protobuf:protobuf-kotlin` from 4.36.0 to 4.36.1

Updates `com.google.protobuf:protobuf-java` from 4.36.0 to 4.36.1
- [Release notes](https://github.com/protocolbuffers/protobuf/releases)
- [Commits](https://github.com/protocolbuffers/protobuf/commits)

---
updated-dependencies:
- dependency-name: com.google.protobuf:protobuf-kotlin
  dependency-version: 4.36.1
  dependency-type: direct:production
  update-type: version-update:semver-patch
- dependency-name: com.google.protobuf:protobuf-java
  dependency-version: 4.36.1
  dependency-type: direct:production
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
Co-authored-by: Shivang <shivang.iitk@gmail.com>

* fix(plugins): defer stale jar cleanup until restart (#340)

* fix(plugins): defer stale jar cleanup until restart

* fix(plugins): satisfy quality checks

* Preserve staged plugin artifacts when another plugin updates

* Require cleanup intent and retain artifacts with unordered manifest versions

---------

Co-authored-by: ayush <workside@gamil.com>
Co-authored-by: Shivang <shivang.iitk@gmail.com>

* fix(plugins): defer fluck-browser hot-reload to a restart (#352)

* fix(plugins): defer stale jar cleanup until restart

* fix(plugins): defer fluck-browser hot-reload to a restart

Hot-reloading fluck-browser force-unloads the classloader that created its
JxBrowser native views. Every open tab - and every tab opened afterward,
since the factory that would recreate the view is gone too - draws an empty
box, and a second hot-reload does not recover it; only a full restart does.

HotReloadPolicy names plugins that must never be swapped in place, matching
the existing NOT_USER_INSTALLABLE/RetiredPlugins pattern. It's checked at
every path that can force-unload a live plugin to apply an update: the
resetPluginInstances/doReloadPlugin path that actually reproduced this bug,
the menu-driven Reload action, the Toolbox update flow, and the store
installer. For a not-hot-reloadable plugin, the new jar is staged into
installed.json without touching the running instance or its open tabs, and
a status message tells the user to restart to apply it - the next cold
start loads the update with a fresh classloader.

Also fixes two call sites that asked "restart dependent plugins?" before
checking whether an unload was even going to happen, which produced a
confusing prompt for an unload that a deferred update was never going to
do.

* fix(plugins): satisfy quality checks

* Preserve staged plugin artifacts when another plugin updates

* Validate d…
Antriksh1984 and others added 2 commits September 14, 2026 19:43
…abs-inc#662)

* feat(search): index open tabs by their URL and file path (#606) (#648)

Global Search matched an open tab only against its title, and TabResult
hardcoded url = null / filePath = null on every hit. A browser tab whose
title never mentions its domain, or an editor tab someone wants to find
by path rather than filename, could not be found at all.

searchTabs now also scores a browser tab's FluckTabInfo.currentUrl and
an editor tab's EditorTabInfo.filePath, through the same substring-
containment gate (proseScore) searchRecentPages already uses for a
page's URL, since a fuzzy subsequence match over a whole URL or path is
close to meaningless. TabResult carries the real url/filePath instead
of null, and the tab row's subtitle now leads with the workspace name
(disambiguating identical URLs open in different workspaces, or across
windows) followed by the url/filePath/tabType, in place of the old
"tabType • workspaceName" line.

11 tests cover: URL-only and file-path-only matches, both fields
populated for the right tab type and left null for the other/a blank
path, a short query not matching a URL by fuzzy accident, title+URL
both matching taking the higher (title) score with title highlight
ranges preserved, live navigation changing which URL matches (and the
old URL no longer matching), directory-path matching without a
subsequence false-positive, and no-open-tabs contributing nothing
rather than failing.

* fix(browser): replace superseded capture requests (#509)

* Stop anon reaching schema public by inheritance, and scope identity to real orgs

The BOSS Supabase anon key is compiled into this repo, which is public. Anything
`anon` can execute is therefore executable by anyone. Verified on 2026-09-08:

  * get_encryption_key() returned the Vault master encryption key, unauthenticated.
    decrypt_text() was anon-callable beside it, making a decryption oracle over
    everything encrypt_text protects - user secrets and the QBO/Google broker
    credentials.
  * find_user_by_email() confirmed any address and returned its uuid.
  * list_shareable_recipients() returned 152 users WITH full email addresses to
    any self-registered account, and 82 @risalabs.ai addresses on a search.
  * arcade_leaderboard() and arcade_bs_standings() published the roster of
    everyone who had opened the Arcade, unauthenticated.

None of it was granted on purpose. PostgreSQL hardwires EXECUTE to PUBLIC on
every new function, PUBLIC includes anon, and this project's default privileges
add anon on top - so a SECURITY DEFINER function is internet-callable from the
moment it is created. Both revokes are traps in mirror image: `from public`
leaves the explicit anon grant, `from anon` leaves the hardwired PUBLIC one, and
ALTER DEFAULT PRIVILEGES cannot remove the latter at all (pg_default_acl loses
the entry and new functions still get `=X`).

  20260908000000  event trigger: revoke PUBLIC+anon on every function created in
                  schema public. An explicit `grant ... to anon` after the create
                  still wins - anon access must be stated, never inherited.
  20260908010000  org_visible_users / org_is_vetted / user_display_name: ONE
                  definition of "may this account learn who that account is",
                  shared by the Arcade and poker rather than copied. Vetted means
                  a human approved the join, which excludes the catch-all `boss`
                  org every account joins on signup (153 members, 20 domains).
  20260908020000  route list_shareable_recipients through both. It was already
                  org-scoped, which is why it looked right; it accepted ANY
                  shared org.
  20260908030000  one-time sweep of the ~30 functions that already had the
                  inherited grant. The RBAC mutators fail closed
                  (is_user_admin(NULL) is false), so this is defence in depth,
                  not a patched escalation.

The rule is a SET, not a per-target predicate: as a per-row qual it is pushed
below a DISTINCT ON and evaluated once per underlying row - 2.7s over 29k score
rows for 45 players, against 37ms.

supabase/audit/identity_disclosure_audit.sql is the standing check, because "we
fixed the leak" is not a durable claim. All four checks report HEALTHY.

Left deliberately anon-callable, each documented where it is kept: the plugin
store browse API, the three helpers called from RLS policies on anon-readable
tables, and custom_access_token_hook. Verified after the sweep that anonymous
plugin-store browse and signed-in RBAC reads both still work.

Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>

* Add the master-key rotation procedure, and rotate

get_encryption_key() was anon-callable, so the Vault master_encryption_key was
retrievable by anyone holding the project anon key - which ships compiled into
this public repo. Revoking access does not un-disclose a key, so it was rotated
on 2026-09-09 and the 184 rows encrypted under it re-encrypted.

Scope of the original exposure, stated precisely because the capability was
worse than the reach: decrypt_text() was anon-callable beside it, so an attacker
holding ciphertext from ANY channel - a backup, an export, a screenshot - could
decrypt it through the API without even needing the key. But no bulk read path
to that ciphertext existed: qbo_token_state and google_token_state have no
client grants at all, and all 178 secrets rows have org_id NULL, so the secrets
policy reduces to owner-only. This was a serious latent vulnerability - one
org-shared secret, one RLS slip, or anyone with backup access would have had
plaintext - rather than a confirmed bulk disclosure.

The script is kept because rotation is not a one-off. It is atomic (one DO
block), self-verifying (md5 of every row's plaintext captured before, re-derived
after through decrypt_text so the check covers both the swap and the data), and
a mismatch or row-count drift raises and rolls back, so a broken rotation cannot
commit. Verified after the run: the live key differs from the disclosed one,
184/184 rows decrypt under it, and the disclosed key opens 0 rows.

The old key is retained in the Vault under an explicit name. Do NOT delete it
while pre-rotation backups exist - they are encrypted under it.

Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>

* fix(db): close signed-in crypto access and verify visibility boundaries

* test(db): exercise repeated key rotation and exact anonymous ACLs

* test(db): grant fixture role membership on Supabase Postgres

* test(db): inline rotation source for isolated pgTAP mounts

* test(db): keep generated rotation SQL out of source control

* fix(db): reserve identity-taking store mutators for the edge service

* fix(db): serialize rotations without requiring direct Vault writes

* fix(db): address review gaps in system-org and rotation coverage

* test(db): verify core secrets across hex and broker-free rotations

* test(db): execute standing audit and missing-signature regression

* fix(db): enforce revoke postconditions and harden rotation verification

* test(db): enable recovery metadata in the authenticated fixture

* test(db): use the schema-supported authenticator type

* Address remaining database review quality findings

* Fix invoker view audit boolean parsing and test timestamp bounds

* Rotate the TOTP envelope, exempt extension routines, and close the repo/prod drift

Addresses the handoff's database-integration item and the substantiated findings
from the current-head review. Everything below was executed against the PR's own
Supabase preview branch, not asserted from reading.

**The blocker: rotation refused to run once #417 landed.** The guard was a
blanket "TOTP is installed, refuse everything". It is now an adapter. The stored
form is 'v1:' || encrypt_text(...) - same cipher, same key, only the framing
differs - so the column map gained an envelope prefix and rotates like the rest
once the prefix is stripped and re-applied. Three things this needed that reading
the diff would not have shown:

  * #417's trigger RAISES on a v1: value ('TOTP input must be plaintext, not a
    storage envelope'), so the re-encryption update is rejected outright. The
    reviewed trigger is now disabled for the update and restored after, inside
    the same transaction.
  * safe_decrypt_recovery_codes returns jsonb, not text, so verification through
    the real read path needed a cast. Both fingerprints now go through each
    column's OWN application read path rather than decrypt_text, which also
    removes the step-1/step-5 asymmetry raised as U5.
  * a step 0 pre-check reports rows that are already unreadable, instead of
    letting a safe_decrypt_* NULL surface at the end as "a row was missed".

The rejection contract is preserved, not removed: an unknown envelope version,
an unmapped safe_decrypt_* wrapper, or an unreviewed BEFORE trigger on a mapped
table each still refuse. All three are now regression-tested, along with the
recovery-code column that was previously never exercised (its fixture was
vacuous - create_secret writes no secret_metadata row without p_twofa_enabled).
Verified: three consecutive rotations, TOTP/recovery/password all intact, v1
envelope preserved, trigger re-enabled and still enforcing its own contract.

**CREATE EXTENSION was impossible.** The fail-closed guard aborted the first
routine of any extension installed into public: `create extension pgtap` failed
with "Anonymous EXECUTE remains on public.pg_version()". A guard that forces
operators to disable it in order to install an extension is a guard that ends up
disabled. Extension-owned routines are now exempted with a warning, and the
exposure stays visible as advisory CHECK 1x rather than vanishing - it reports
pgtap (1079) on the preview. The sweep skips them too: pgcrypto-style helpers
are called from column DEFAULTs and CHECK constraints, which are evaluated with
the DML role's privileges. No extension owns a function in public on a clean
database, so no deployed behaviour changes.

**The repo was weaker than production.** find_user_by_email, get_session_status
and update_api_key_last_used were locked down on the live project on 2026-09-08
but never captured as a migration, so a fresh deploy re-opened them.
find_user_by_email is a user-enumeration oracle over auth.users and signup is
open. The standing audit caught this itself on the preview - CHECK 2 named it -
which is the drift that check exists for. Both remaining callers use
SUPABASE_SERVICE_ROLE_KEY, verified on this branch, so service_role keeps
EXECUTE and neither path changes.

Also: the guard no longer hard-fails on a database without the Supabase roles (a
plain restore), and the vault fixtures no longer assume the key is absent (U3) -
both suites failed outright on any database that already had one. Retained-key
assertions measure this run's delta instead of an absolute count.

Suites on the preview: rotation 16/16, db access audit, and visibility 54/54 all
clean; the standing audit reports no failing gated check.

Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>

* Exercise the anonymous read path, not just the grant

The keep-list assertions only checked has_function_privilege for the seven
allowlisted signatures. That proves the grant, not the path: an RLS policy
expression is evaluated as the QUERYING role, so revoking a policy helper turns
an anonymous SELECT into 'permission denied for function ...' rather than an
empty result, and no privilege assertion can see it.

The seeding is the part that matters. A policy expression runs PER ROW, so on
an empty table it is never evaluated - and plugins and user_roles are both empty
on a fresh database, which made the first version of this probe pass no matter
what had been revoked. Caught by trying to make it fail.

Sensitivity is stated from measurement, not assumption: with a row present,
revoking can_view_plugin_row from anon does fail the probe and revoking
authorize does not, because permissive policies are ORed and short-circuit. A
helper in a policy that never has to be evaluated cannot be detected this way by
any test, so the comment says so rather than implying broader coverage.

Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>

* Make the gated audit checks and the test generator provable

Both halves of this are the same failure: a suite that is green while proving
nothing. I hit that twice writing the previous commits - a recovery-code fixture
over a secret_metadata row create_secret never wrote, and an anonymous-read
probe over an empty table whose RLS policy therefore never evaluated - so these
are not hypothetical.

Finding 6. The four CI-GATED checks (1, 1b, 4, 5) only ever asserted HEALTHY,
while every advisory check already had a fixture-based detection test. An
inverted `not exists`, a wrong role literal or a typo in the evtenabled test
would have left the gate permanently green. Each is now broken deliberately and
asserted to report it: a routine granted to anon AFTER creation (which is how
one gets past the event trigger), a revoked deliberate anonymous grant, a
disabled event trigger, and a crypto routine exposed to authenticated. They have
teeth by construction - the assertion is that the finding appears, so a broken
audit query fails them.

Finding 8. The generator gained --check, which regenerates in memory and
compares without writing, and orphan removal for a generated suite whose .sql.in
has been renamed or deleted - that file otherwise keeps being executed forever
with stale content. Orphans are identified by a provenance banner rather than a
hard-coded list, so a hand-written suite is never touched; verified that
explicit_anon_and_org_visibility_test.sql is untouched. Each guard was proven by
making it fire: a hand edit and a planted orphan are both reported by --check,
and generate removes the orphan.

CI now runs generate and --check as their own step, so a preparation failure is
visible in the log instead of being attributed to the test run.

Preview: rotation 16/16, db access audit 15/15, visibility 56/56.

Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>

* Announce every project change, not only the plugin-initiated ones

Panels could come up empty and stay empty, and the reason was that the
startup restore told no one.

ProjectChangeEvent was published from ProjectDataProviderImpl.selectProject,
which is the path a PLUGIN takes. The two callers that matter most bypass
it: WorkspaceApplier.applyWorkspace calls windowProjectState.selectProject
directly when it restores the workspace, and BossTopBar's picker goes
through selectProjectInWindow. Neither published anything.

The ordering that produced the empty panel: DefaultPlugin is constructed in
a DisposableEffect keyed on registries and window state, not on
selectedProject, and it kicks off the plugin scan asynchronously while
BossAppScaffold composes and the sidebar builds panels immediately. The
restore meanwhile waits on WorkspaceManager's sequential Dispatchers.IO JSON
reads. When those reads are slow the panel is built first, reads the ""
that WindowProjectState seeds itself with, and renders its no-project state.
The restore then lands, silently, and nothing remounts the cached component.

Publishing from the state itself rather than from one caller catches all
three. The bus is MutableSharedFlow(replay = 0), so a publish that never
happens cannot be recovered by a later subscriber - which is why this could
not stay per-caller.

The publish is removed from selectProject rather than added alongside the
collector; keeping both would double-fire on the plugin path.

previousPath is seeded from the current value so the StateFlow's replay of
it is not announced as a change. That seed is "" at startup, and telling
every plugin the project just became "" moments before the real restore
arrives is precisely the clear-yourself signal worth avoiding.

One collector per window: projectDataProvider is `by lazy` on DefaultPlugin,
which is per-window, so this cannot stack.

Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>

* Publish from the state's own callback, not from a lazily-built provider

The review's finding 1: observing `selectedProject` from `ProjectDataProviderImpl`
put the fix behind two `by lazy` initializers. `projectDataProvider` and
`applicationEventBus` are both lazy on `DefaultPlugin`, and the second is the only
host path that creates the bus at all. So the collector started only if some plugin
touched both before the workspace JSON reads finished - and "the reads are slow" is
the premise of the bug. Touched after the restore, the collector seeds to the
restored path and announces nothing; never touched, no caller is announced at all.

The announcement now hangs off the `ProjectSelectionCallback` that
`WindowProjectStateRegistry` installs when it builds the window's state, which
`BossAppState` does eagerly in composition. `WindowProjectState.selectProject` is
the sole mutator of the selection and invokes that callback synchronously, so every
caller is covered with no coroutine, no scope and nothing lazy in the path. Being
synchronous also makes `previousProjectPath` a faithful history rather than
best-effort: there is no StateFlow conflation to collapse A -> B -> C into A -> C.

The two registry entry points carried a copy of the wiring each; they now share one
`newState`, so the announcement cannot be installed on some windows and not others.

Finding 1's third mitigation, which is a hole of its own: `publishSystemEvent` was a
no-op whenever the bus had not been created, so on a build where no installed plugin
had touched `applicationEventBus` yet, no host event existed - not `ProjectChangeEvent`,
not `AuthEvent`, not `TabEvent` - and with `replay = 0` none could be recovered.
It now creates the bus instead of dropping. `getInstance` also re-checks the registry
on every call rather than only at creation, so an instance that exists while the
registry is empty can no longer strand the host's publisher.

Findings 2 and 3: `ProjectDataProviderImpl` implements `DisposableProvider` and
`DefaultPlugin.dispose()` releases it through a named delegate, alongside
`logDataProviderDelegate` and `gitDataProviderDelegate`; its scope gets a
`SupervisorJob`, matching `pluginScope`.

Tests: `ProjectChangeAnnouncementTest` (6) pins a direct `selectProject` being
announced, the previous-path chain, the seeding rule, the same-path suppression,
both registry entry points, and the bus being created rather than dropping the event.
Full `:composeApp:desktopTest` green: 3695 tests, 0 failures. `detekt ktlintCheck` clean.

Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>

* Round 2: honest bus wording, atomic previousPath, three more tests

Review (1/2) and (2/2).

1. `publishSystemEvent` does not save the event it creates the bus for. Correct - no
   registered publisher means nobody holds the bus, so it has no subscribers and that
   first event still reaches no one. The comment, the test name and the PR body all
   claimed otherwise. Reworded to what it actually buys: the host stops being
   permanently silent while it waits for a plugin to touch `applicationEventBus`.

3. `previousPath` was check-then-act on a plain field, and
   `ProjectDataServiceBridge.selectProject` is a suspend gRPC handler with no hop to
   Main (verified: `KernelBootstrap` registers it, the bridge calls
   `provider.selectProject` directly). Now an `AtomicReference.getAndSet`, so the read
   and the write are one operation.

5. The registry read-modify-write moved back inside `synchronized(this)`. Both fields
   are in fact `@Volatile` in boss-plugin-api 1.0.87 (checked the pinned jar), but the
   lock is uncontended after the first call and removes the question. The
   bus-before-publisher ordering is now written down, including why a publish landing
   in that window loses nothing.

6. `initialPath` KDoc no longer describes a production scenario it cannot reach; it is
   documented as defensive and test-reachable, and defaulted to "".

7. Three tests added:
   - a plugin-initiated selection is announced exactly once (catches both a silent
     regression to zero and an accidentally re-added publish);
   - the registry test now asserts the recent-projects half of the callback ran -
     deleting it from `newState` previously left every test green;
   - `dispose()` stops the recent-projects collector, which is the whole reason
     `projectDataProviderDelegate` became a named lazy.

   `Dispatchers.setMain(UnconfinedTestDispatcher())` for the class: the provider
   collects on `Dispatchers.Main`, which has no implementation in a plain test JVM, so
   its collector silently never ran. Unconfined also makes the dispose test
   deterministic rather than a sleep.

Smaller: `SupervisorJob` comment describes it as future-proofing (there is one
collector); `systemEventBusScope` is `by lazy`; the KERNEL-mode consequence of
disposing the provider is documented on `dispose()`.

Not taken: `replay = 1` for `ProjectChangeEvent`. It would close the mirror race, but
it changes `events()` semantics for every subscriber and every event type on a bus
whose consumers are out of tree. The body now says the race is narrowed rather than
closed, and names the api-side `selectedProject` StateFlow as what closes it.

`:composeApp:desktopTest` 3697 tests, 0 failures. `detekt ktlintCheck` clean.

Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>

* Round 3: unconditional announcement, ordered publish, drop dead register

Review 3.

2. AGENTS.md: a bullet in the canonical "what a third-party plugin can observe"
   paragraph, since this widens *when* a filesystem path reaches every installed
   plugin.

3. The `expect` KDoc still said "a no-op if the bus has not been created yet". Only
   the `actual` had been corrected. Fixed, and it now states the part that IS still
   best-effort: replay = 0 means an unsubscribed event is gone either way.

4. The announcement sat downstream of `ProjectState.updateRecentProjects`, so a throw
   there skipped it AND left `previousPath` stale - every later selection reporting a
   previous path one step behind, silently, for the session. Now `try { recents }
   finally { announce }`: order preserved for anyone reading recents off the event,
   the announcement unconditional, the throw still propagating.

5. `getAndSet` closed the read-modify-write but not the publish order, so two
   concurrent selections could emit out of order. `previousPath` and the publish are
   now in one `synchronized` block (the AtomicReference is gone - the lock subsumes
   it). The KDoc says plainly what this still does not settle: `WindowProjectState`
   writes `_selectedProject.value` then calls the callback with no atomicity, so state
   and last event can still disagree. Closing that means locking upstream.

6. `ProjectState`'s async `loadRecentProjects()` assigns `_recentProjects.value`
   wholesale and could land mid-test, dropping a just-added path - only where
   `~/.boss/recent-projects.json` exists, so a developer-machine-only flake. A
   once-per-JVM settle in `@BeforeTest` puts that single file read before any test.
   The test paths stay deliberately non-existent, now with a comment saying why: the
   fire-and-forget saves are unordered, and `loadRecentProjects` reclaims entries whose
   directory is gone, so a real temp directory would leak where these self-heal.

7. `register` deleted. No production caller (`BossAppState:299` uses `getOrCreate`),
   and it overwrote an existing entry - handing back a state with a fresh announcer
   seeded to "" for a window that already had a project. `newState` stays; it is what
   keeps the wiring from drifting.

8. `@Volatile` dropped from `ApplicationEventBusImpl.instance` - every access is inside
   the lock now, and leaving it reads as if a fast path survives.

Also: a test for the actual regression path, `applyWorkspace` announcing the project it
restores, rather than a comment claiming to imitate it.

Answering the grep you could not run: the only `projectChanges()` consumers in
boss_plugins are the two fluck-agent panels (`FluckAgentViewModel`), and both assign
`_bossProject.value` and re-sweep - idempotent on a repeat. Nothing used the repeat
publish as a reload nudge. Recorded in the announcer comment.

Item 1 was already in the PR body from round 2 ("The startup race is narrowed, not
closed"), naming the mirror case and the api-side StateFlow that closes it.

`:composeApp:desktopTest` 3698 tests / 368 classes, 0 failures. `detekt ktlintCheck` clean.

Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>

* Round 4: split the dispose out, stop tests writing the real ~/.boss

Review 4. Items 1 and 3 were the before-merge ones.

1. Verified: ProjectDataServiceBridge.watchRecentProjects collects
   provider.recentProjects, a StateFlow, so cancelling the provider's scope on
   window close leaves that gRPC stream open and silently frozen for every
   out-of-process plugin. Taking the first option and SPLITTING the dispose out.

   Note this reverses what round 1 asked for, and the justification changed rather
   than the opinion: once the announcement moved to the registry callback,
   ProjectDataProviderImpl went back to being exactly what it was before this PR, so
   the leak is pre-existing and unrelated to the subject. Closing it properly means
   the bridge reading ProjectState directly instead of a per-window provider, which
   is its own change. The reasoning is on the class so it is not re-fixed by accident.

3. Verified and worse than described: MAX_RECENT_PROJECTS = 10, so test entries evict
   real ones from the developer's picker and no cleanup restores them.
   systemProperty("user.home", <build>/test-home) on the Test task. One run with it in
   place shows the existing suite was writing far more than recents to the real home -
   window-appearance-settings.json, keymap-settings.json, scrollbar-settings.json,
   recent-browser-pages.json, dashboard-stats.json and a ~/BossProjects/ directory all
   land in test-home now. The settle is gone with it: no recent-projects.json in
   test-home means the wholesale reload never happens.

2. publishSystemEvent now refuses the bus != null && systemPublisher == null state
   instead of falling through into a bus that may not be the registry's, with one
   warning rather than one per event. The comment at the fallback is true as written.

4. Both stale comments fixed (one construction path, not two).

5. hostProjectCallback(updateRecents, announcer) extracted so the try/finally claim is
   testable - ProjectState is an object, so a hard-coded call cannot be made to fail.

6. The publish-inside-the-lock trade is spelled out in the KDoc: what it buys
   (ordering), what it costs (an inline subscriber runs holding the lock inside
   selectProject), and that the contended path is untested.

7. The serial-execution dependency is recorded in the test class KDoc.

Plus: multi-window isolation, and a test that makes the recents update throw.

One thing this round caused and fixed: removing dispose() left two
ProjectDataProviderImpl collectors alive on the test dispatcher. On a
TestCoroutineScheduler a live coroutine is something every later runTest waits on, and
the git classes timed out at 60s in full-suite runs while passing in isolation.
Dispatchers.setMain(Dispatchers.Unconfined) rather than UnconfinedTestDispatcher():
same inline behaviour, not enrolled in a scheduler anyone else observes. It is also a
real argument for the follow-up - without dispose() the provider cannot be constructed
in a test without leaking.

:composeApp:desktopTest 3699 tests / 368 classes, 0 failures. detekt ktlintCheck clean.

Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>

* Round 5: reset test-home per run, stop getInstance stealing a publisher

Review 5.

1. Confirmed reproducibly - build/test-home/.boss/recent-projects.json was sitting
   there from the previous run. doFirst now deleteRecursively() before mkdirs(), so
   the home is fresh per run rather than merely private. Without it the redirect only
   helped the first run and ProjectState.init's load reintroduced the same race from
   the second. Verified by running the full suite twice back to back.

2. Right, and sharper than it looks: the guard tested `bus` but wrote both fields, and
   `systemPublisher != null && bus == null` is exactly what ProjectChangeAnnouncementTest,
   BrowserAnalyticsEmissionTest and BossTabsComponentMoveTest install. Guard now tests
   both, so getInstance cannot take a publisher away from whoever set it.

3. Test added for the warn-and-drop branch, asserting the DROP rather than the warning -
   partialRegistryWarned is a one-shot process global, so "it warns" is unassertable
   after the first test to trip it. Uses a stub bus so the half-registry state is real.

4. The re-entrancy hazard is now documented as SAFE and why (synchronized is reentrant,
   previousPath advances before the publish), so it is not "fixed" later. The
   lock-widens-a-UI-hang-to-a-cross-thread-one point is in the same block.

5. Taken, including the optional ones:
   - hostProjectCallback keeps both failures (addSuppressed) instead of letting finally
     discard the first. Needs @Suppress("TooGenericExceptionCaught") - catching
     Throwable is the contract, and both are rethrown.
   - ProjectDataProviderImpl takes an injectable dispatcher (default Dispatchers.Main).
     This removes the global setMain AND the round-4 collector leak at the source
     rather than working around them, without reopening the DisposableProvider split.
   - Three more pins: a null window state announces nothing, applyWorkspace
     (restoreProject = false) announces nothing, unregister + getOrCreate restarts the
     chain at "".

Not taken, with reasons: jvmArgumentProviders (the current form works, is
config-cache-serialisable and passed CI on three OSes); widening the user.home redirect
to plugin-path-utils (its test only mkdirs a directory every BOSS user already has).

There is no CHANGELOG in this repo, so the release-notes line for the same-path change
is an action item at release time, not a file change. Flagged in the body.

Two consecutive full runs: 3703 tests / 368 classes, 0 failures both times.
detekt ktlintCheck clean - it caught two TooGenericExceptionCaught and a long line in
this round's own code first.

Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>

* Address project announcement review feedback

* fix(plugin-store): restrict plugin_downloads RLS to the server-side pipeline (#488)

* Batch validation: promote latest reviewed dev changes to main (#463)

* Fix #30: Resolve duplicate context menu label collisions

* Cleanup: Remove dead code for #91 and #93

* chore: Sanitize SubmitResult.Error at construction rather than at one render site

* Fix panel component lifecycle disposal

* fixes

* Guard panel lifecycle destruction failures

* fix(logging): sanitize secret RPC failures and crash-report errors

Three related gaps in what gets logged and shown when something fails:

- SecretService.kt had no BossLogger in any of its ten catch blocks (#145).
  When the organisation migration broke all four secret RPCs (#144), the
  only WARN in the log came from the calling plugin - the code that
  actually failed said nothing. Every catch now logs via
  logger.warn(LogCategory.NETWORK, ...), reusing the already-sanitized
  failure for both the log and the returned Result rather than sanitizing
  twice. RoleService and RoleCreationService were checked and already log
  correctly - SecretService was the only silent one.

- LogSanitizer.sanitizeExceptionMessage redacted a hostname only when it
  appeared inside a URL - a bare hostname (exactly what
  UnknownHostException.getMessage() produces, i.e. every DNS failure, and
  what a proxy-connect failure looks like) passed through untouched (#109).
  Added a narrow hostname pattern: lowercase-only labels ending in a short
  explicit TLD/`.internal`/`.local` list, with a negative lookahead so a
  package path that happens to end in a real TLD word mid-FQN
  (kotlinx.coroutines.internal.ScopeCoroutine, kotlinx.io.EOFException)
  is not mistaken for one - caught by the existing realistic-stack-trace
  test after the first version of the pattern redacted a live Kotlin
  package name out of it.

- CrashReportService.SubmitResult.Error held a raw exception string,
  sanitized at exactly one render call site in CrashReportDialog (#110).
  The constructor is now private; SubmitResult.Error.of(...) is the only
  way to build one, and it sanitizes before the raw string can reach
  .message - a property of the type now, not something every future
  consumer (a copy button, a toast, a log line) has to remember on its own.
  Both construction sites (the service's two catch blocks, and the one in
  CrashReportDialog the issue names directly) now route through it.

Tests: new coverage for the ten now-logging SecretService paths (via
SupabaseWiringTest's existing sanitization-wiring guard, updated to
recognize the "sanitize once into a local, reuse for log and return" shape
SupabaseDataProviderImpl already used), six new LogSanitizerTest cases for
the hostname fix (including the FQN/version-number false-positive guards),
and a new CrashReportServiceTest for the sanitize-at-construction guarantee.

* test(crash): extract construction tests from #404

Selected unchanged test file from Antriksh1984 original commit 99d2a5228023c541e825fe2714619c8228140369 (PR #404). Maintainer extraction only; subsequent API/scope adaptations are recorded separately.

* chore(ipc): clarify advisory menu ID scope and fix formatting

* chore(ui): finish obsolete toolbar comment cleanup

* test(crash): adapt consolidated coverage and guard factory visibility

Maintainer consolidation: use #311 companion invoke and a URL fixture instead of depending on #404 hostname redaction. Add private constructor/copy bytecode assertions. Preserve original contributor tests and implementation credit separately.

* refactor(crash): consolidate construction sanitization in #311

Maintainer scope change: remove only the duplicate #110 implementation, retaining Antriksh1984 original #109/#145 work and commit history. Standalone construction tests are retained with attribution in #311; its Aditya8369 implementation supersedes Error.of. Keep render-time sanitization here until #311 merges and describe the remaining hostname coverage conservatively.

* test(panels): retain sibling lifecycle isolation coverage from #313

Adapt the original #313 test to the #317 constructor and supply the missing panelInfo overrides. Original test scenario and assertions are by @rehannayeem0786; these compile adaptations are maintainer integration work.

* fix(panels): complete lifecycle cleanup across failure and window teardown

Destroy partially constructed panels and replacements that fail to resume. Continue downward lifecycle transitions after a failing pause or stop callback. Dispose panels before plugin teardown in the same callback rather than relying on sibling Compose effect order. Add regression coverage and adapt the retained #313 test bodies for detekt. These changes are maintainer follow-up to the original #313/#317 contributions.

* docs(ui): remove stale disabled top-bar feature list

* test(ipc): protect advisory menu item ID uniqueness

* fix(panels): keep store registration scoped to its window effect

Remove the redundant unregister from plugin teardown. Document independent context services and synchronous Essenty onCreate replay, with tests for registration ownership and exactly-once create callbacks. Keep tab teardown hardening separate. Maintainer follow-up to the review of #317; original #313/#317 contributor credit is unchanged.

* fix(crash): address consolidated sanitization review notes

Maintainer follow-up to Claude N1-N4: document factory/copy invariant, correct stale comments, move Aditya original construction assertions into the service suite while retaining Antriksh blank/diagnostic cases, and log unexpected dialog submission failures. Original contribution credit remains separate.

* fix(logging): keep server failure payloads out of secret RPC logs

Maintainer follow-up to Claude review: log operation and exception type only, preserve sanitized return semantics, and check each catch for safe return/log wiring. Document measured hostname limits without broadening the matcher; add module-local redaction and diagnostic-preservation coverage. Antriksh original implementation remains credited separately.

* ci: build PR batches on dev

* Allow Claude diff reviews after approved fork builds (#413)

* fix(browser): preserve newer clipboard copies during plain-text paste (#316)

* fix(browser): paste-without-formatting no longer clobbers a copy made in its restore window (#205)

* fix(browser): make paste-without-formatting's restore identity-based, not text-based

Review of this PR caught that the text-equality guard cannot distinguish 'our write is still current' from 'a previous press already restored the rich original' - whose string projection is by construction the same text - so two presses inside the 200ms window permanently downgraded a rich clipboard to plain text. A PasteWithoutFormattingSession now tracks the exact Transferable each press installed and restores the pre-window original once, while a user copy in the window still wins. Adds five tests to BrowserClipboardCommandsTest, including the double-press regression; wraps the two over-limit lines; e.message -> e::class.simpleName in the touched handlers.

* fix(browser): fold tryRestore's early exits so it stays within detekt's ReturnCount

* fix(browser): blank lines between FakeTransferable overrides per ktlint

* test(browser): retain clipboard restore scenarios from #408

* fix(browser): track clipboard ownership through AWT wrappers

---------

Co-authored-by: rehannayeem0786 <rehannayeem0786@github.com>
Co-authored-by: Shivang <shivang.iitk@gmail.com>
Co-authored-by: Antriksh1984 <antrikshsingh850@gmail.com>

* fix(plugins): serialize concurrent first loads per class name (#324)

* fix(plugins): prevent duplicate class definitions during concurrent loads

* fix(plugins): make class loading parallel-safe

* test(plugins): pin concurrent loading lifecycle boundaries

Maintainer consolidation follow-up: retain #324 synchronization and its tests; add concurrent shared-name, superclass, and unload-marker coverage. Document caller-sensitive registration based on arjun28115 review feedback and clarify that marking unload does not drain an already admitted parent lookup. No global lifecycle lock or resource-policy changes.

---------

Co-authored-by: sgoel2be24-cyber <223222024+sgoel2be24-cyber@users.noreply.github.com>
Co-authored-by: Procs <168113425+ProportanilityConstant@users.noreply.github.com>
Co-authored-by: Shivang <shivang.iitk@gmail.com>

* fix(browser): defer native disposal until admitted calls drain (#312 + #409) (#412)

* fix: make BrowserHandle JavaScript execution cancellable

the previous synchronous JxBrowser call blocked the Main/EDT thread;
coroutine cancellation could not take effect while that call was blocking;
the implementation now uses JxBrowser’s asynchronous JavaScript callback API;
suspendCancellableCoroutine makes the Kotlin waiting side cancellable;
late callbacks after cancellation are safely ignored;
this does NOT terminate JavaScript already executing inside Chromium.

* fix: add robust native call lifecycle tracking for disposal

* test: verify native operation cleanup on synchronous failure

* fix: linearize browser disposal and pending operation tracking

* fix: resolve detekt violations in browser native tracking

* test: satisfy detekt failure simulation rule

* fix: close native operation disposal race

* fix(browser): drain an in-flight call before closing the browser

Issue #300 reports that executeJavaScript is a synchronous, non-
cancellation-aware native call, and a plugin's own withTimeoutOrNull
around it can only abandon the caller's wait - not the call itself -
which stays running on Main indefinitely and can race a concurrent
handle.dispose(), touching the same native object from two threads at
once.

The severe half of this was already fixed by BoundedBrowserCall: this
class confines every blocking round trip to one dedicated daemon thread
instead of Dispatchers.Main, so a wedged renderer no longer freezes the
app. What was not yet closed is the residual window this issue's core
report is actually about: shutdown() stopped new work but did not wait
for whatever was already running, so a caller could proceed straight to
browser.close() while a call from just before shutdown was still
finishing on the dedicated thread.

shutdown() now waits, bounded, for that in-flight call to drain before
returning. Costs nothing in the common case - awaitTermination returns
immediately once the one worker thread and its queue are both idle,
which is where an instance sits between calls - and only the bound in
the rare case something was genuinely still running.

Known, and disclosed in the KDoc rather than claimed away: this narrows
the race for the common case (a call that was always going to finish
quickly) rather than closing it. It cannot help when the in-flight call
is itself the wedge this class's own deadline exists for - waiting
unboundedly for a genuinely stuck call would reintroduce the exact freeze
BoundedBrowserCall exists to prevent, just moved from a plugin's await
into every caller's teardown path. There is no JxBrowser API on this
version able to interrupt a blocking round trip already inside the
native call, which is the whole reason the call is confined to its own
thread instead of cancelled - closing that window completely needs
JxBrowser's own cooperation, which the issue's own analysis already
concluded is unavailable.

Tests: shutdown waits for a fast in-flight call to finish before
returning, and does not wait past its own drain timeout for a wedged one
- the same before/after pair the rest of this test file already uses for
BoundedBrowserCall's deadline.

* fix(browser): defer native close until admitted calls drain

Consolidates the lifecycle work from #312 (johncybersage) and #409 (Antriksh1984), retaining both original histories. Replaces success-only callback accounting and timeout-then-close with executor termination signals and host-owned native/profile cleanup. These corrections and replacement tests are maintainer/agent work, separate from contributor scoring.

* fix(browser): bound profile waits and clarify deferred cleanup ownership

Address consolidation review: schedule both service disposal paths without awaiting native close, diagnose pending drains, centralize executor ownership, and bound profile lease acquisition without permitting unsafe reuse or eviction. Document process-exit abandonment and verify wiring and cleanup ordering. Maintainer/agent follow-up, separate from original #312 and #409 contributor credit.

* fix(browser): schedule disposal after early UI teardown failure

* ci: create launcher directory before Claude native installation

* Revert "ci: create launcher directory before Claude native installation"

This reverts commit 5184908e6c3f133502508513b4c5e17651b13bc0.

* test: keep warmup registry ordering check on one event loop

* test(browser): normalize CRLF in disposal source wiring guards

---------

Co-authored-by: john k <johnk@johns-MacBook-Pro.local>
Co-authored-by: john k <johnk@syn-172-100-137-112.res.spectrum.com>
Co-authored-by: Antriksh1984 <antrikshsingh850@gmail.com>

* feat(tabs): show a speaker glyph on tabs that are playing audio (#314)

* feat(tabs): show a speaker glyph on tabs that are playing audio (#308)

* fix(tabs): review round - compile, registry lifetime, UI-thread marshalling, owner flush

1. graphicsLayer import dropped (does not exist at that package); the fade now uses .alpha(audioAlpha), already imported. 2. TabAudioRegistry no longer outlives its owner: disposeAllTabsBlocking unregisters everything this component registered, and DetachedTab.destroy drops the entry for a tab destroyed without adoption - the handler captures the BossTabsComponent, so stale entries retained it. 3. The registry update is marshalled to the EDT via SwingUtilities.invokeLater, so the tab-model mutation happens on the UI thread as the KDoc claims. 4. setFullscreenHandler flushes the current playback state once ownerTabId becomes known, closing the starts-before-registration race the review could not verify. 5. TabAudioRegistryTest added: delivery, last-writer-wins, ownership-checked unregister.

* fix(tabs): CI round 2 - DetachedTab receiver error, long line, and baseline-preserving signatures

- BossMainWindowPanel.kt:2098: DetachedTab is a non-inner nested class and cannot use the outer component as receiver; the audio-handler drop moves to detachTab instead, which is where adoption-vs-destroy actually diverges. - TabAudioRegistry.kt:9 wrapped under detekt's 120-char limit. - FluckTabInfo.isPlayingAudio and BossTabButton's glyph read no longer change any signature: the flag is a mutable property (copied in copy()'s body) and the button reads it off tabInfo, so the constructor, copy() and BossTabButton keep their exact baseline-frozen detekt IDs and the resurfaced LongMethod/LongParameterList/CyclomaticComplexMethod findings retire.

* fix(tabs): fold handleAudioUpdate within ReturnCount; add missing final newline in the test file

* fix(tabs): publish audio state by browser ownership and keep icon layout stable

---------

Co-authored-by: rehannayeem0786 <rehannayeem0786@github.com>
Co-authored-by: Shivang <shivang.iitk@gmail.com>

* feat: connect chrome density settings and keyboard controls (#305)

* feat: wire the chrome density scale into settings and small-screen defaults

ChromeDensity / ChromeDimens.of() / LocalChromeDimens already existed on
main and every bar (BossTitleBar, BossTopBar, the main tab bar,
BossBottomBar) already read its height from BossChrome.dimens - but
LocalChromeDimens was never provided anywhere, so it silently resolved to
its staticCompositionLocalOf default (Comfortable) always. The scale was
built and unreachable.

This closes that gap:

- WindowAppearanceSettings gets a `density` field (default COMFORTABLE, so
  an existing install's settings file - which has never heard of this key
  - decodes to exactly the chrome it already had; no settings-version bump
  needed).
- BossApp.kt now provides LocalChromeDimens from that field, host-only and
  outside BossAppCompositionLocals (plugins never draw host chrome).
- A "Density" dropdown in Settings > Bars (Compact/Comfortable/Spacious),
  indexed in Settings search.
- A fresh install on a small screen (< 1000dp logical height, clearing the
  13" MacBook Air's ~931-956pt from #239's own measurements) now defaults
  to Compact and starts with the bottom bar off - the one bar this manager
  can still reclaim itself, since the side strips are already off by
  class default. Toolkit.getScreenSize() is read once, wrapped in
  runCatching (HeadlessException off a display must not break a fresh
  install), with a pure defaultDensityFor(screenHeightDp) so the decision
  is unit-testable without a display.

Addresses #239, scoped down from the full issue. Out of scope in this
pass, deliberately:

- The app does not yet report its own chrome budget as a measured
  percentage - the issue's own "state it, don't argue it" ask. Reachable
  later from the same ChromeDimens source, but needs a spot to render it.
- The title bar's 27dp "Boss Console" label row is untouched - collapsing
  or merging it with the tab bar is a separate, riskier layout change than
  a density scale.
- No regression intended to the existing per-bar show/hide switches or
  focus-mode edges: density only changes how much room a bar that is
  already on screen takes, never whether it is shown.

* fix: drop the Compact-density bottom-bar auto-off, wrap an overlong line

Address review feedback on #305:

- Removed showBottomBar = density != ChromeDensity.COMPACT from
  getDefaultSettings(). ChromeMetricsTest already shows the shipped
  macOS defaults reach 93.3% of a 931dp window at Comfortable, so
  #239's >=90% bar is met without touching the status bar - and that
  bar's own KDoc argues it must stay on ("the only always-on readout").
  It was also reachable from the settings-load catch fallback, so a
  transient read error could silently drop the bar and have the next
  save persist the loss. Compact now only changes density, nothing else.

- Wrapped primaryScreenHeightDp() - was 121 chars, one over detekt's
  default MaxLineLength (120), which applies here since .editorconfig's
  140 is a ktlint-only setting and this line wasn't in the baseline.

* feat: add chrome density setting

* feat: add small-screen chrome defaults

* feat: add chrome density controls and small-screen defaults

* fix(ui): preserve lean density defaults and test density controls

* style: format multiline screen-height lookup

* fix(ui): separate density recovery and make editor chords opt-in

* style: wrap density default documentation

---------

Co-authored-by: AdityaK-iiita <adityakolate0070@gmail.com>
Co-authored-by: Shivang <shivang.iitk@gmail.com>

* fix(plugins): stop host resource fallback after unload (#325)

* fix(plugins): stop host resource fallback after unload

* fix(plugins): preserve resource warning for a missing result

---------

Co-authored-by: sgoel2be24-cyber <223222024+sgoel2be24-cyber@users.noreply.github.com>
Co-authored-by: Shivang <shivang.iitk@gmail.com>

* Handle closed browser frames during navigation callbacks (#400)

* Handle closed browser frames during navigation callbacks

* test(browser): retain closed-event guard after navigation integration

* fix(browser): preserve helpers on PID failure and recognize closed transports

* style(browser): wrap review diagnostics for detekt

---------

Co-authored-by: Shivang <shivang.iitk@gmail.com>

* refactor(window): pin the panel content alignment width (#398)

* fix(window): restore strict width constraints for nested panels

Fixes #278. Commit c15660c5 inadvertently dropped the explicit width constraint for nested panels in the right dock by wrapping them inside a PanelColumn with a Box(weight(1f)) that lacked fillMaxWidth(). This loose constraint caused a known issue with SubcomposeLayout caching stale bounds when resized, resulting in Row content disappearing after weighted Spacers. This commit restores the .fillMaxWidth() propagation.

* Cover panel content alignment across width changes

* Keep panel layout regression in the existing app test package

* Document panel alignment contract and pin filling content width

* Wrap the panel width assertion to satisfy detekt

---------

Co-authored-by: Shivang <shivang.iitk@gmail.com>

* #320 - Fix quick actions vanishing in short tab rail (#328)

* #320 - Fix quick actions vanishing in short tab rail

* Fix: detekt & ktlint checks

* Fix rail action budgets and reversible fallback wiring

* Fix resize test assertion import and update rail coverage note

---------

Co-authored-by: Shivang <shivang.iitk@gmail.com>

* fix(crash): refine scroll boundary and bound error sanitization (#350)

* fix(crash): refine scroll boundary and bound error sanitization

* Avoid exposing a partial token at the crash message limit

* Document sanitizer input bound and verify expansion ordering

---------

Co-authored-by: Aishwary Anand <aishwary.cd22@bmsce.ac.in>
Co-authored-by: Shivang <shivang.iitk@gmail.com>

* fix(logging): redact private hostnames (#346)

* fix(logging): redact private hostnames

* Handle private hostname punctuation and preserve diagnostic ports

* Format hostname punctuation regression assertion

---------

Co-authored-by: ayush <workside@gamil.com>
Co-authored-by: Shivang <shivang.iitk@gmail.com>

* feat: Opening an .html file should ask open as a file or webpage (#333)

* feat: Opening an .html file should ask open as a file or webpage

* Fix HTML prompt delivery and persisted preference ordering

* Cover HTML routing and correct review test fixtures

* Honor HTML navigation intent and release pending prompts on failure

* Isolate HTML prompt handling from the general dialog host

---------

Co-authored-by: Shivang <shivang.iitk@gmail.com>

* fix(plugin-store): parse timestamps consistently in list and detail metadata (#379)

* Fix: Implement proper ISO timestamp parsing in PluginStoreClient

* fix(repository): implement robust ISO timestamp parsing for Supabase payloads

* style(repository): resolve detekt MaxLineLength and TooGenericExceptionCaught

* fix(plugin-store): implement plugin metadata timestamp parsing

PluginStoreClient.parseTimestamp was a stub that always returned 0L, so
every plugin fetched from the store showed "Last Updated"/"Published" as
the Unix epoch in the Toolbox UI regardless of what the server actually
sent (#337).

Parses the ISO-8601 timestamp (the shape the store sends, e.g.
2024-05-12T14:30:00Z, or with a numeric offset) via java.time.Instant,
falling back to 0L for a blank, missing, or malformed string rather than
throwing - matching the field's own empty-string default for a response
that omits it. java.time rather than adding kotlinx-datetime as a new
dependency: this module already uses java.util.* directly in the same
commonMain source set (it has one real target, jvm("desktop")), so nothing
is gained by introducing a second time library for one function.

Tests exercise the real PluginDetailResponse.toPluginInfo(), matching the
convention already established next to it in
PluginStoreResponseDecodingTest: a Z-suffixed timestamp, a numeric-offset
timestamp, a blank string, and a malformed string.

* Fix timestamp normalization edge cases and verify both response mappings

* Use release publication dates and pin timezone-independent fallback

---------

Co-authored-by: Sanjay <sanjaysaini4423@gmail.com>
Co-authored-by: Antriksh1984 <antrikshsingh850@gmail.com>
Co-authored-by: Shivang <shivang.iitk@gmail.com>

* feat(remote-ui): authenticate and expose remote UI surfaces (#348)

* feat(remote-ui): authenticate remote UI process identity

* feat(remote-ui): place authenticated remote UI surfaces

* fix(remote-ui): close ownership and placement lifecycle races

* test(remote-ui): expose placement recovery cases to JUnit

---------

Co-authored-by: Shivang <shivang.iitk@gmail.com>

* feat(dashboard): add shared read-only What's New release feed (#381)

* Add What's New release feed to dashboard

* Serialize update settings persistence

* Remove unused update settings import

* fix(updater): retain realtime refreshes during shared release fetches

* style(updater): format shared release fetch regression tests

* fix(updater): coalesce release refresh bursts and preserve visible history

---------

Co-authored-by: Shivang <shivang.iitk@gmail.com>

* fix(language): consolidate host and out-of-process language-id tables (#358)

* fix(language): consolidate host and out-of-process language-id tables

EditorLanguages (composeApp) and EditorServiceImpl (modules/boss-app-editor)
each hand-maintained their own extension-to-language-id table because
boss-app-editor - a plain JVM module compiled to a GraalVM native image -
could not depend on anything in composeApp. They disagreed: EditorServiceImpl
named .sh/.bash/.zsh "shell", EditorLanguages named them "bash", and
EditorServiceImpl was missing more than forty ids the other table had
(fortran, delphi, latex, lisp, tcl, clojure, batch, diff, ...) (#75).

Moves the table into a new plugin-platform/plugin-language-types module -
dependency-free by design, so it carries nothing extra into boss-app-editor's
native-image build - and has both EditorLanguages and EditorServiceImpl read
from it. This is the first time anything under modules/ depends on
plugin-platform/; verified compiling and passing tests before committing to
the approach.

EditorLanguages keeps its existing public API unchanged (same values for
every extension), so FileTypeCategoriesTest and EditorLanguageDetectionTest
needed no changes. EditorServiceImpl keeps its own "proto"->"protobuf" entry
and "plaintext" fallback as local additions on top of the shared table,
rather than folding them into it: proto isn't part of the boss-file-types.json
default-app-association surface the shared table backs, and "plaintext" is
this service's own gRPC default, not a value composeApp reads.

Adds LanguageIdsTest (the new module) and EditorServiceImplTest (previously
no tests existed for this class at all) - the latter pins the actual bug fix,
that detectLanguage("sh") now returns "bash" instead of "shell".

Out of scope, and disclosed rather than silently dropped: two of the five
duplicate tables the issue names - the editor-tab plugin's own
LanguageDetection and BossEditor's lexer registry - live in separate
repositories this build cannot reach. FileIcons.forSpecialFileName/forFile in
plugin-icons is also not consolidated: it keys icon selection off the raw
filename to preserve distinctions a language id can't carry (package.json,
yarn.lock and pnpm-lock.yaml are all valid JSON/YAML but get three different
brand icons) and never computes a language id in the first place, so
routing it through this table would need a separate icon-selection redesign.

* fix(language): keep file-association drift checks on the shared table

* fix(language): apply shared filename rules to editor file opens

---------

Co-authored-by: Shivang <shivang.iitk@gmail.com>

* fix(editor): contain write-local stack overflow and preserve fatal errors (#396)

* Make writeFileContentSafe actually safe: catch the Errors it was named for

`writeFileContentSafe` exists to return false rather than throw. It did not hold
that contract:

    } catch (e: Exception) {
        fileIoLogger.warn(LogCategory.EDITOR, "Error writing file", error = e)
        false
    }

StackOverflowError is an Error, not an Exception, so it went straight through -
out of writeFileContent, out of the editor_write_file MCP handler, and to the
caller as a bare StackOverflowError instead of the handler's own
"Write failed for <path>". The warn that would have named the file never ran
either.

That is not hypothetical. risa-labs-inc/boss-plugin-editor-tab#18 and #27 are two
independent reports of it, on unrelated content, and #27's complaint is precisely
the missing diagnosis: the error "gives no indication of which input caused it".

StackOverflowError and OutOfMemoryError are caught explicitly rather than
widening to Throwable. A stack overflow unwinds and leaves the JVM usable, and
readFileContentSafe in this same file already treats OutOfMemoryError as a
reportable outcome. Throwable would also absorb LinkageError and ThreadDeath,
which are not this function's to swallow - there is a test asserting a
NoClassDefFoundError still propagates.

The failure log now names the path and the character count. Not the content:
these writes carry whatever the user is editing.

**This does not fix the write.** Whatever recurses is upstream of this function,
which is mkdirs plus writeText - I ruled out the plugin's handler, this write,
and the host's MCP argument parsing, and said so on the issue. What changes is
that the failure is reported honestly instead of escaping, which is where a
diagnosis can start.

The body moves to `guardedWrite` with an injectable write, because a test JVM
cannot be made to overflow the stack inside writeText on demand.

Verified: 3729 tests, 0 failures, plus ktlintCheck and detekt.

Refs risa-labs-inc/boss-plugin-editor-tab#18, #27.

Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>

* docs(editor): clarify write guard scope and prior recursion fix

* fix(editor): preserve fatal heap errors in write guard

---------

Co-authored-by: Claude Opus 5 <noreply@anthropic.com>
Co-authored-by: Shivang <shivang.iitk@gmail.com>

* fix(state): apply version-checked JSON merge patches (#361)

* Fix: Implement proper ISO timestamp parsing in PluginStoreClient

* Feature: Implement JSON Merge Patch for plugin delta state synchronization

* fix(state): validate delta bases and exclude duplicate timestamp scope

* fix(state): reject malformed and deeply nested patches

---------

Co-authored-by: Shivang <shivang.iitk@gmail.com>

* :arrow_up: deps:(deps): Bump grpc from 1.83.1 to 1.84.0 (#363)

Bumps `grpc` from 1.83.1 to 1.84.0.

Updates `io.grpc:grpc-netty` from 1.83.1 to 1.84.0
- [Release notes](https://github.com/grpc/grpc-java/releases)
- [Commits](https://github.com/grpc/grpc-java/compare/v1.83.1...v1.84.0)

Updates `io.grpc:grpc-protobuf` from 1.83.1 to 1.84.0
- [Release notes](https://github.com/grpc/grpc-java/releases)
- [Commits](https://github.com/grpc/grpc-java/compare/v1.83.1...v1.84.0)

Updates `io.grpc:grpc-stub` from 1.83.1 to 1.84.0
- [Release notes](https://github.com/grpc/grpc-java/releases)
- [Commits](https://github.com/grpc/grpc-java/compare/v1.83.1...v1.84.0)

Updates `io.grpc:grpc-services` from 1.83.1 to 1.84.0
- [Release notes](https://github.com/grpc/grpc-java/releases)
- [Commits](https://github.com/grpc/grpc-java/compare/v1.83.1...v1.84.0)

Updates `io.grpc:grpc-util` from 1.83.1 to 1.84.0
- [Release notes](https://github.com/grpc/grpc-java/releases)
- [Commits](https://github.com/grpc/grpc-java/compare/v1.83.1...v1.84.0)

---
updated-dependencies:
- dependency-name: io.grpc:grpc-netty
  dependency-version: 1.84.0
  dependency-type: direct:production
  update-type: version-update:semver-minor
- dependency-name: io.grpc:grpc-protobuf
  dependency-version: 1.84.0
  dependency-type: direct:production
  update-type: version-update:semver-minor
- dependency-name: io.grpc:grpc-stub
  dependency-version: 1.84.0
  dependency-type: direct:production
  update-type: version-update:semver-minor
- dependency-name: io.grpc:grpc-services
  dependency-version: 1.84.0
  dependency-type: direct:production
  update-type: version-update:semver-minor
- dependency-name: io.grpc:grpc-util
  dependency-version: 1.84.0
  dependency-type: direct:production
  update-type: version-update:semver-minor
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
Co-authored-by: Shivang <shivang.iitk@gmail.com>

* :arrow_up: deps:(deps): Bump protobuf from 4.36.0 to 4.36.1 (#364)

Bumps `protobuf` from 4.36.0 to 4.36.1.

Updates `com.google.protobuf:protobuf-kotlin` from 4.36.0 to 4.36.1

Updates `com.google.protobuf:protobuf-java` from 4.36.0 to 4.36.1
- [Release notes](https://github.com/protocolbuffers/protobuf/releases)
- [Commits](https://github.com/protocolbuffers/protobuf/commits)

---
updated-dependencies:
- dependency-name: com.google.protobuf:protobuf-kotlin
  dependency-version: 4.36.1
  dependency-type: direct:production
  update-type: version-update:semver-patch
- dependency-name: com.google.protobuf:protobuf-java
  dependency-version: 4.36.1
  dependency-type: direct:production
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
Co-authored-by: Shivang <shivang.iitk@gmail.com>

* fix(plugins): defer stale jar cleanup until restart (#340)

* fix(plugins): defer stale jar cleanup until restart

* fix(plugins): satisfy quality checks

* Preserve staged plugin artifacts when another plugin updates

* Require cleanup intent and retain artifacts with unordered manifest versions

---------

Co-authored-by: ayush <workside@gamil.com>
Co-authored-by: Shivang <shivang.iitk@gmail.com>

* fix(plugins): defer fluck-browser hot-reload to a restart (#352)

* fix(plugins): defer stale jar cleanup until restart

* fix(plugins): defer fluck-browser hot-reload to a restart

Hot-reloading fluck-browser force-unloads the classloader that created its
JxBrowser native views. Every open tab - and every tab opened afterward,
since the factory that would recreate the view is gone too - draws an empty
box, and a second hot-reload does not recover it; only a full restart does.

HotReloadPolicy names plugins that must never be swapped in place, matching
the existing NOT_USER_INSTALLABLE/RetiredPlugins pattern. It's checked at
every path that can force-unload a live plugin to apply an update: the
resetPluginInstances/doReloadPlugin path that actually reproduced this bug,
the menu-driven Reload action, the Toolbox update flow, and the store
installer. For a not-hot-reloadable plugin, the new jar is staged into
installed.json without touching the running instance or its open tabs, and
a status message tells the user to restart to apply it - the next cold
start loads the update with a fresh classloader.

Also fixes two call sites that asked "restart dependent plugins?" before
checking whether an unload was even going to happen, which produced a
confusing prompt for an unload that a deferred update was never going to
do.

* fix(plugins): satisfy quality checks

* Preserve staged plugin artifacts when another plugin updates

* V…
* fix(overlays): honor RTL and fractional placement (#477)

* Stop anon reaching schema public by inheritance, and scope identity to real orgs

The BOSS Supabase anon key is compiled into this repo, which is public. Anything
`anon` can execute is therefore executable by anyone. Verified on 2026-09-08:

  * get_encryption_key() returned the Vault master encryption key, unauthenticated.
    decrypt_text() was anon-callable beside it, making a decryption oracle over
    everything encrypt_text protects - user secrets and the QBO/Google broker
    credentials.
  * find_user_by_email() confirmed any address and returned its uuid.
  * list_shareable_recipients() returned 152 users WITH full email addresses to
    any self-registered account, and 82 @risalabs.ai addresses on a search.
  * arcade_leaderboard() and arcade_bs_standings() published the roster of
    everyone who had opened the Arcade, unauthenticated.

None of it was granted on purpose. PostgreSQL hardwires EXECUTE to PUBLIC on
every new function, PUBLIC includes anon, and this project's default privileges
add anon on top - so a SECURITY DEFINER function is internet-callable from the
moment it is created. Both revokes are traps in mirror image: `from public`
leaves the explicit anon grant, `from anon` leaves the hardwired PUBLIC one, and
ALTER DEFAULT PRIVILEGES cannot remove the latter at all (pg_default_acl loses
the entry and new functions still get `=X`).

  20260908000000  event trigger: revoke PUBLIC+anon on every function created in
                  schema public. An explicit `grant ... to anon` after the create
                  still wins - anon access must be stated, never inherited.
  20260908010000  org_visible_users / org_is_vetted / user_display_name: ONE
                  definition of "may this account learn who that account is",
                  shared by the Arcade and poker rather than copied. Vetted means
                  a human approved the join, which excludes the catch-all `boss`
                  org every account joins on signup (153 members, 20 domains).
  20260908020000  route list_shareable_recipients through both. It was already
                  org-scoped, which is why it looked right; it accepted ANY
                  shared org.
  20260908030000  one-time sweep of the ~30 functions that already had the
                  inherited grant. The RBAC mutators fail closed
                  (is_user_admin(NULL) is false), so this is defence in depth,
                  not a patched escalation.

The rule is a SET, not a per-target predicate: as a per-row qual it is pushed
below a DISTINCT ON and evaluated once per underlying row - 2.7s over 29k score
rows for 45 players, against 37ms.

supabase/audit/identity_disclosure_audit.sql is the standing check, because "we
fixed the leak" is not a durable claim. All four checks report HEALTHY.

Left deliberately anon-callable, each documented where it is kept: the plugin
store browse API, the three helpers called from RLS policies on anon-readable
tables, and custom_access_token_hook. Verified after the sweep that anonymous
plugin-store browse and signed-in RBAC reads both still work.

Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>

* Add the master-key rotation procedure, and rotate

get_encryption_key() was anon-callable, so the Vault master_encryption_key was
retrievable by anyone holding the project anon key - which ships compiled into
this public repo. Revoking access does not un-disclose a key, so it was rotated
on 2026-09-09 and the 184 rows encrypted under it re-encrypted.

Scope of the original exposure, stated precisely because the capability was
worse than the reach: decrypt_text() was anon-callable beside it, so an attacker
holding ciphertext from ANY channel - a backup, an export, a screenshot - could
decrypt it through the API without even needing the key. But no bulk read path
to that ciphertext existed: qbo_token_state and google_token_state have no
client grants at all, and all 178 secrets rows have org_id NULL, so the secrets
policy reduces to owner-only. This was a serious latent vulnerability - one
org-shared secret, one RLS slip, or anyone with backup access would have had
plaintext - rather than a confirmed bulk disclosure.

The script is kept because rotation is not a one-off. It is atomic (one DO
block), self-verifying (md5 of every row's plaintext captured before, re-derived
after through decrypt_text so the check covers both the swap and the data), and
a mismatch or row-count drift raises and rolls back, so a broken rotation cannot
commit. Verified after the run: the live key differs from the disclosed one,
184/184 rows decrypt under it, and the disclosed key opens 0 rows.

The old key is retained in the Vault under an explicit name. Do NOT delete it
while pre-rotation backups exist - they are encrypted under it.

Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>

* fix(db): close signed-in crypto access and verify visibility boundaries

* test(db): exercise repeated key rotation and exact anonymous ACLs

* test(db): grant fixture role membership on Supabase Postgres

* test(db): inline rotation source for isolated pgTAP mounts

* test(db): keep generated rotation SQL out of source control

* fix(db): reserve identity-taking store mutators for the edge service

* fix(db): serialize rotations without requiring direct Vault writes

* fix(db): address review gaps in system-org and rotation coverage

* test(db): verify core secrets across hex and broker-free rotations

* test(db): execute standing audit and missing-signature regression

* fix(db): enforce revoke postconditions and harden rotation verification

* test(db): enable recovery metadata in the authenticated fixture

* test(db): use the schema-supported authenticator type

* Address remaining database review quality findings

* Fix invoker view audit boolean parsing and test timestamp bounds

* Rotate the TOTP envelope, exempt extension routines, and close the repo/prod drift

Addresses the handoff's database-integration item and the substantiated findings
from the current-head review. Everything below was executed against the PR's own
Supabase preview branch, not asserted from reading.

**The blocker: rotation refused to run once #417 landed.** The guard was a
blanket "TOTP is installed, refuse everything". It is now an adapter. The stored
form is 'v1:' || encrypt_text(...) - same cipher, same key, only the framing
differs - so the column map gained an envelope prefix and rotates like the rest
once the prefix is stripped and re-applied. Three things this needed that reading
the diff would not have shown:

  * #417's trigger RAISES on a v1: value ('TOTP input must be plaintext, not a
    storage envelope'), so the re-encryption update is rejected outright. The
    reviewed trigger is now disabled for the update and restored after, inside
    the same transaction.
  * safe_decrypt_recovery_codes returns jsonb, not text, so verification through
    the real read path needed a cast. Both fingerprints now go through each
    column's OWN application read path rather than decrypt_text, which also
    removes the step-1/step-5 asymmetry raised as U5.
  * a step 0 pre-check reports rows that are already unreadable, instead of
    letting a safe_decrypt_* NULL surface at the end as "a row was missed".

The rejection contract is preserved, not removed: an unknown envelope version,
an unmapped safe_decrypt_* wrapper, or an unreviewed BEFORE trigger on a mapped
table each still refuse. All three are now regression-tested, along with the
recovery-code column that was previously never exercised (its fixture was
vacuous - create_secret writes no secret_metadata row without p_twofa_enabled).
Verified: three consecutive rotations, TOTP/recovery/password all intact, v1
envelope preserved, trigger re-enabled and still enforcing its own contract.

**CREATE EXTENSION was impossible.** The fail-closed guard aborted the first
routine of any extension installed into public: `create extension pgtap` failed
with "Anonymous EXECUTE remains on public.pg_version()". A guard that forces
operators to disable it in order to install an extension is a guard that ends up
disabled. Extension-owned routines are now exempted with a warning, and the
exposure stays visible as advisory CHECK 1x rather than vanishing - it reports
pgtap (1079) on the preview. The sweep skips them too: pgcrypto-style helpers
are called from column DEFAULTs and CHECK constraints, which are evaluated with
the DML role's privileges. No extension owns a function in public on a clean
database, so no deployed behaviour changes.

**The repo was weaker than production.** find_user_by_email, get_session_status
and update_api_key_last_used were locked down on the live project on 2026-09-08
but never captured as a migration, so a fresh deploy re-opened them.
find_user_by_email is a user-enumeration oracle over auth.users and signup is
open. The standing audit caught this itself on the preview - CHECK 2 named it -
which is the drift that check exists for. Both remaining callers use
SUPABASE_SERVICE_ROLE_KEY, verified on this branch, so service_role keeps
EXECUTE and neither path changes.

Also: the guard no longer hard-fails on a database without the Supabase roles (a
plain restore), and the vault fixtures no longer assume the key is absent (U3) -
both suites failed outright on any database that already had one. Retained-key
assertions measure this run's delta instead of an absolute count.

Suites on the preview: rotation 16/16, db access audit, and visibility 54/54 all
clean; the standing audit reports no failing gated check.

Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>

* Exercise the anonymous read path, not just the grant

The keep-list assertions only checked has_function_privilege for the seven
allowlisted signatures. That proves the grant, not the path: an RLS policy
expression is evaluated as the QUERYING role, so revoking a policy helper turns
an anonymous SELECT into 'permission denied for function ...' rather than an
empty result, and no privilege assertion can see it.

The seeding is the part that matters. A policy expression runs PER ROW, so on
an empty table it is never evaluated - and plugins and user_roles are both empty
on a fresh database, which made the first version of this probe pass no matter
what had been revoked. Caught by trying to make it fail.

Sensitivity is stated from measurement, not assumption: with a row present,
revoking can_view_plugin_row from anon does fail the probe and revoking
authorize does not, because permissive policies are ORed and short-circuit. A
helper in a policy that never has to be evaluated cannot be detected this way by
any test, so the comment says so rather than implying broader coverage.

Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>

* Make the gated audit checks and the test generator provable

Both halves of this are the same failure: a suite that is green while proving
nothing. I hit that twice writing the previous commits - a recovery-code fixture
over a secret_metadata row create_secret never wrote, and an anonymous-read
probe over an empty table whose RLS policy therefore never evaluated - so these
are not hypothetical.

Finding 6. The four CI-GATED checks (1, 1b, 4, 5) only ever asserted HEALTHY,
while every advisory check already had a fixture-based detection test. An
inverted `not exists`, a wrong role literal or a typo in the evtenabled test
would have left the gate permanently green. Each is now broken deliberately and
asserted to report it: a routine granted to anon AFTER creation (which is how
one gets past the event trigger), a revoked deliberate anonymous grant, a
disabled event trigger, and a crypto routine exposed to authenticated. They have
teeth by construction - the assertion is that the finding appears, so a broken
audit query fails them.

Finding 8. The generator gained --check, which regenerates in memory and
compares without writing, and orphan removal for a generated suite whose .sql.in
has been renamed or deleted - that file otherwise keeps being executed forever
with stale content. Orphans are identified by a provenance banner rather than a
hard-coded list, so a hand-written suite is never touched; verified that
explicit_anon_and_org_visibility_test.sql is untouched. Each guard was proven by
making it fire: a hand edit and a planted orphan are both reported by --check,
and generate removes the orphan.

CI now runs generate and --check as their own step, so a preparation failure is
visible in the log instead of being attributed to the test run.

Preview: rotation 16/16, db access audit 15/15, visibility 56/56.

Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>

* Announce every project change, not only the plugin-initiated ones

Panels could come up empty and stay empty, and the reason was that the
startup restore told no one.

ProjectChangeEvent was published from ProjectDataProviderImpl.selectProject,
which is the path a PLUGIN takes. The two callers that matter most bypass
it: WorkspaceApplier.applyWorkspace calls windowProjectState.selectProject
directly when it restores the workspace, and BossTopBar's picker goes
through selectProjectInWindow. Neither published anything.

The ordering that produced the empty panel: DefaultPlugin is constructed in
a DisposableEffect keyed on registries and window state, not on
selectedProject, and it kicks off the plugin scan asynchronously while
BossAppScaffold composes and the sidebar builds panels immediately. The
restore meanwhile waits on WorkspaceManager's sequential Dispatchers.IO JSON
reads. When those reads are slow the panel is built first, reads the ""
that WindowProjectState seeds itself with, and renders its no-project state.
The restore then lands, silently, and nothing remounts the cached component.

Publishing from the state itself rather than from one caller catches all
three. The bus is MutableSharedFlow(replay = 0), so a publish that never
happens cannot be recovered by a later subscriber - which is why this could
not stay per-caller.

The publish is removed from selectProject rather than added alongside the
collector; keeping both would double-fire on the plugin path.

previousPath is seeded from the current value so the StateFlow's replay of
it is not announced as a change. That seed is "" at startup, and telling
every plugin the project just became "" moments before the real restore
arrives is precisely the clear-yourself signal worth avoiding.

One collector per window: projectDataProvider is `by lazy` on DefaultPlugin,
which is per-window, so this cannot stack.

Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>

* Publish from the state's own callback, not from a lazily-built provider

The review's finding 1: observing `selectedProject` from `ProjectDataProviderImpl`
put the fix behind two `by lazy` initializers. `projectDataProvider` and
`applicationEventBus` are both lazy on `DefaultPlugin`, and the second is the only
host path that creates the bus at all. So the collector started only if some plugin
touched both before the workspace JSON reads finished - and "the reads are slow" is
the premise of the bug. Touched after the restore, the collector seeds to the
restored path and announces nothing; never touched, no caller is announced at all.

The announcement now hangs off the `ProjectSelectionCallback` that
`WindowProjectStateRegistry` installs when it builds the window's state, which
`BossAppState` does eagerly in composition. `WindowProjectState.selectProject` is
the sole mutator of the selection and invokes that callback synchronously, so every
caller is covered with no coroutine, no scope and nothing lazy in the path. Being
synchronous also makes `previousProjectPath` a faithful history rather than
best-effort: there is no StateFlow conflation to collapse A -> B -> C into A -> C.

The two registry entry points carried a copy of the wiring each; they now share one
`newState`, so the announcement cannot be installed on some windows and not others.

Finding 1's third mitigation, which is a hole of its own: `publishSystemEvent` was a
no-op whenever the bus had not been created, so on a build where no installed plugin
had touched `applicationEventBus` yet, no host event existed - not `ProjectChangeEvent`,
not `AuthEvent`, not `TabEvent` - and with `replay = 0` none could be recovered.
It now creates the bus instead of dropping. `getInstance` also re-checks the registry
on every call rather than only at creation, so an instance that exists while the
registry is empty can no longer strand the host's publisher.

Findings 2 and 3: `ProjectDataProviderImpl` implements `DisposableProvider` and
`DefaultPlugin.dispose()` releases it through a named delegate, alongside
`logDataProviderDelegate` and `gitDataProviderDelegate`; its scope gets a
`SupervisorJob`, matching `pluginScope`.

Tests: `ProjectChangeAnnouncementTest` (6) pins a direct `selectProject` being
announced, the previous-path chain, the seeding rule, the same-path suppression,
both registry entry points, and the bus being created rather than dropping the event.
Full `:composeApp:desktopTest` green: 3695 tests, 0 failures. `detekt ktlintCheck` clean.

Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>

* Round 2: honest bus wording, atomic previousPath, three more tests

Review (1/2) and (2/2).

1. `publishSystemEvent` does not save the event it creates the bus for. Correct - no
   registered publisher means nobody holds the bus, so it has no subscribers and that
   first event still reaches no one. The comment, the test name and the PR body all
   claimed otherwise. Reworded to what it actually buys: the host stops being
   permanently silent while it waits for a plugin to touch `applicationEventBus`.

3. `previousPath` was check-then-act on a plain field, and
   `ProjectDataServiceBridge.selectProject` is a suspend gRPC handler with no hop to
   Main (verified: `KernelBootstrap` registers it, the bridge calls
   `provider.selectProject` directly). Now an `AtomicReference.getAndSet`, so the read
   and the write are one operation.

5. The registry read-modify-write moved back inside `synchronized(this)`. Both fields
   are in fact `@Volatile` in boss-plugin-api 1.0.87 (checked the pinned jar), but the
   lock is uncontended after the first call and removes the question. The
   bus-before-publisher ordering is now written down, including why a publish landing
   in that window loses nothing.

6. `initialPath` KDoc no longer describes a production scenario it cannot reach; it is
   documented as defensive and test-reachable, and defaulted to "".

7. Three tests added:
   - a plugin-initiated selection is announced exactly once (catches both a silent
     regression to zero and an accidentally re-added publish);
   - the registry test now asserts the recent-projects half of the callback ran -
     deleting it from `newState` previously left every test green;
   - `dispose()` stops the recent-projects collector, which is the whole reason
     `projectDataProviderDelegate` became a named lazy.

   `Dispatchers.setMain(UnconfinedTestDispatcher())` for the class: the provider
   collects on `Dispatchers.Main`, which has no implementation in a plain test JVM, so
   its collector silently never ran. Unconfined also makes the dispose test
   deterministic rather than a sleep.

Smaller: `SupervisorJob` comment describes it as future-proofing (there is one
collector); `systemEventBusScope` is `by lazy`; the KERNEL-mode consequence of
disposing the provider is documented on `dispose()`.

Not taken: `replay = 1` for `ProjectChangeEvent`. It would close the mirror race, but
it changes `events()` semantics for every subscriber and every event type on a bus
whose consumers are out of tree. The body now says the race is narrowed rather than
closed, and names the api-side `selectedProject` StateFlow as what closes it.

`:composeApp:desktopTest` 3697 tests, 0 failures. `detekt ktlintCheck` clean.

Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>

* Round 3: unconditional announcement, ordered publish, drop dead register

Review 3.

2. AGENTS.md: a bullet in the canonical "what a third-party plugin can observe"
   paragraph, since this widens *when* a filesystem path reaches every installed
   plugin.

3. The `expect` KDoc still said "a no-op if the bus has not been created yet". Only
   the `actual` had been corrected. Fixed, and it now states the part that IS still
   best-effort: replay = 0 means an unsubscribed event is gone either way.

4. The announcement sat downstream of `ProjectState.updateRecentProjects`, so a throw
   there skipped it AND left `previousPath` stale - every later selection reporting a
   previous path one step behind, silently, for the session. Now `try { recents }
   finally { announce }`: order preserved for anyone reading recents off the event,
   the announcement unconditional, the throw still propagating.

5. `getAndSet` closed the read-modify-write but not the publish order, so two
   concurrent selections could emit out of order. `previousPath` and the publish are
   now in one `synchronized` block (the AtomicReference is gone - the lock subsumes
   it). The KDoc says plainly what this still does not settle: `WindowProjectState`
   writes `_selectedProject.value` then calls the callback with no atomicity, so state
   and last event can still disagree. Closing that means locking upstream.

6. `ProjectState`'s async `loadRecentProjects()` assigns `_recentProjects.value`
   wholesale and could land mid-test, dropping a just-added path - only where
   `~/.boss/recent-projects.json` exists, so a developer-machine-only flake. A
   once-per-JVM settle in `@BeforeTest` puts that single file read before any test.
   The test paths stay deliberately non-existent, now with a comment saying why: the
   fire-and-forget saves are unordered, and `loadRecentProjects` reclaims entries whose
   directory is gone, so a real temp directory would leak where these self-heal.

7. `register` deleted. No production caller (`BossAppState:299` uses `getOrCreate`),
   and it overwrote an existing entry - handing back a state with a fresh announcer
   seeded to "" for a window that already had a project. `newState` stays; it is what
   keeps the wiring from drifting.

8. `@Volatile` dropped from `ApplicationEventBusImpl.instance` - every access is inside
   the lock now, and leaving it reads as if a fast path survives.

Also: a test for the actual regression path, `applyWorkspace` announcing the project it
restores, rather than a comment claiming to imitate it.

Answering the grep you could not run: the only `projectChanges()` consumers in
boss_plugins are the two fluck-agent panels (`FluckAgentViewModel`), and both assign
`_bossProject.value` and re-sweep - idempotent on a repeat. Nothing used the repeat
publish as a reload nudge. Recorded in the announcer comment.

Item 1 was already in the PR body from round 2 ("The startup race is narrowed, not
closed"), naming the mirror case and the api-side StateFlow that closes it.

`:composeApp:desktopTest` 3698 tests / 368 classes, 0 failures. `detekt ktlintCheck` clean.

Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>

* Round 4: split the dispose out, stop tests writing the real ~/.boss

Review 4. Items 1 and 3 were the before-merge ones.

1. Verified: ProjectDataServiceBridge.watchRecentProjects collects
   provider.recentProjects, a StateFlow, so cancelling the provider's scope on
   window close leaves that gRPC stream open and silently frozen for every
   out-of-process plugin. Taking the first option and SPLITTING the dispose out.

   Note this reverses what round 1 asked for, and the justification changed rather
   than the opinion: once the announcement moved to the registry callback,
   ProjectDataProviderImpl went back to being exactly what it was before this PR, so
   the leak is pre-existing and unrelated to the subject. Closing it properly means
   the bridge reading ProjectState directly instead of a per-window provider, which
   is its own change. The reasoning is on the class so it is not re-fixed by accident.

3. Verified and worse than described: MAX_RECENT_PROJECTS = 10, so test entries evict
   real ones from the developer's picker and no cleanup restores them.
   systemProperty("user.home", <build>/test-home) on the Test task. One run with it in
   place shows the existing suite was writing far more than recents to the real home -
   window-appearance-settings.json, keymap-settings.json, scrollbar-settings.json,
   recent-browser-pages.json, dashboard-stats.json and a ~/BossProjects/ directory all
   land in test-home now. The settle is gone with it: no recent-projects.json in
   test-home means the wholesale reload never happens.

2. publishSystemEvent now refuses the bus != null && systemPublisher == null state
   instead of falling through into a bus that may not be the registry's, with one
   warning rather than one per event. The comment at the fallback is true as written.

4. Both stale comments fixed (one construction path, not two).

5. hostProjectCallback(updateRecents, announcer) extracted so the try/finally claim is
   testable - ProjectState is an object, so a hard-coded call cannot be made to fail.

6. The publish-inside-the-lock trade is spelled out in the KDoc: what it buys
   (ordering), what it costs (an inline subscriber runs holding the lock inside
   selectProject), and that the contended path is untested.

7. The serial-execution dependency is recorded in the test class KDoc.

Plus: multi-window isolation, and a test that makes the recents update throw.

One thing this round caused and fixed: removing dispose() left two
ProjectDataProviderImpl collectors alive on the test dispatcher. On a
TestCoroutineScheduler a live coroutine is something every later runTest waits on, and
the git classes timed out at 60s in full-suite runs while passing in isolation.
Dispatchers.setMain(Dispatchers.Unconfined) rather than UnconfinedTestDispatcher():
same inline behaviour, not enrolled in a scheduler anyone else observes. It is also a
real argument for the follow-up - without dispose() the provider cannot be constructed
in a test without leaking.

:composeApp:desktopTest 3699 tests / 368 classes, 0 failures. detekt ktlintCheck clean.

Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>

* Round 5: reset test-home per run, stop getInstance stealing a publisher

Review 5.

1. Confirmed reproducibly - build/test-home/.boss/recent-projects.json was sitting
   there from the previous run. doFirst now deleteRecursively() before mkdirs(), so
   the home is fresh per run rather than merely private. Without it the redirect only
   helped the first run and ProjectState.init's load reintroduced the same race from
   the second. Verified by running the full suite twice back to back.

2. Right, and sharper than it looks: the guard tested `bus` but wrote both fields, and
   `systemPublisher != null && bus == null` is exactly what ProjectChangeAnnouncementTest,
   BrowserAnalyticsEmissionTest and BossTabsComponentMoveTest install. Guard now tests
   both, so getInstance cannot take a publisher away from whoever set it.

3. Test added for the warn-and-drop branch, asserting the DROP rather than the warning -
   partialRegistryWarned is a one-shot process global, so "it warns" is unassertable
   after the first test to trip it. Uses a stub bus so the half-registry state is real.

4. The re-entrancy hazard is now documented as SAFE and why (synchronized is reentrant,
   previousPath advances before the publish), so it is not "fixed" later. The
   lock-widens-a-UI-hang-to-a-cross-thread-one point is in the same block.

5. Taken, including the optional ones:
   - hostProjectCallback keeps both failures (addSuppressed) instead of letting finally
     discard the first. Needs @Suppress("TooGenericExceptionCaught") - catching
     Throwable is the contract, and both are rethrown.
   - ProjectDataProviderImpl takes an injectable dispatcher (default Dispatchers.Main).
     This removes the global setMain AND the round-4 collector leak at the source
     rather than working around them, without reopening the DisposableProvider split.
   - Three more pins: a null window state announces nothing, applyWorkspace
     (restoreProject = false) announces nothing, unregister + getOrCreate restarts the
     chain at "".

Not taken, with reasons: jvmArgumentProviders (the current form works, is
config-cache-serialisable and passed CI on three OSes); widening the user.home redirect
to plugin-path-utils (its test only mkdirs a directory every BOSS user already has).

There is no CHANGELOG in this repo, so the release-notes line for the same-path change
is an action item at release time, not a file change. Flagged in the body.

Two consecutive full runs: 3703 tests / 368 classes, 0 failures both times.
detekt ktlintCheck clean - it caught two TooGenericExceptionCaught and a long line in
this round's own code first.

Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>

* Address project announcement review feedback

* fix(plugin-store): restrict plugin_downloads RLS to the server-side pipeline (#488)

* Batch validation: promote latest reviewed dev changes to main (#463)

* Fix #30: Resolve duplicate context menu label collisions

* Cleanup: Remove dead code for #91 and #93

* chore: Sanitize SubmitResult.Error at construction rather than at one render site

* Fix panel component lifecycle disposal

* fixes

* Guard panel lifecycle destruction failures

* fix(logging): sanitize secret RPC failures and crash-report errors

Three related gaps in what gets logged and shown when something fails:

- SecretService.kt had no BossLogger in any of its ten catch blocks (#145).
  When the organisation migration broke all four secret RPCs (#144), the
  only WARN in the log came from the calling plugin - the code that
  actually failed said nothing. Every catch now logs via
  logger.warn(LogCategory.NETWORK, ...), reusing the already-sanitized
  failure for both the log and the returned Result rather than sanitizing
  twice. RoleService and RoleCreationService were checked and already log
  correctly - SecretService was the only silent one.

- LogSanitizer.sanitizeExceptionMessage redacted a hostname only when it
  appeared inside a URL - a bare hostname (exactly what
  UnknownHostException.getMessage() produces, i.e. every DNS failure, and
  what a proxy-connect failure looks like) passed through untouched (#109).
  Added a narrow hostname pattern: lowercase-only labels ending in a short
  explicit TLD/`.internal`/`.local` list, with a negative lookahead so a
  package path that happens to end in a real TLD word mid-FQN
  (kotlinx.coroutines.internal.ScopeCoroutine, kotlinx.io.EOFException)
  is not mistaken for one - caught by the existing realistic-stack-trace
  test after the first version of the pattern redacted a live Kotlin
  package name out of it.

- CrashReportService.SubmitResult.Error held a raw exception string,
  sanitized at exactly one render call site in CrashReportDialog (#110).
  The constructor is now private; SubmitResult.Error.of(...) is the only
  way to build one, and it sanitizes before the raw string can reach
  .message - a property of the type now, not something every future
  consumer (a copy button, a toast, a log line) has to remember on its own.
  Both construction sites (the service's two catch blocks, and the one in
  CrashReportDialog the issue names directly) now route through it.

Tests: new coverage for the ten now-logging SecretService paths (via
SupabaseWiringTest's existing sanitization-wiring guard, updated to
recognize the "sanitize once into a local, reuse for log and return" shape
SupabaseDataProviderImpl already used), six new LogSanitizerTest cases for
the hostname fix (including the FQN/version-number false-positive guards),
and a new CrashReportServiceTest for the sanitize-at-construction guarantee.

* test(crash): extract construction tests from #404

Selected unchanged test file from Antriksh1984 original commit 99d2a5228023c541e825fe2714619c8228140369 (PR #404). Maintainer extraction only; subsequent API/scope adaptations are recorded separately.

* chore(ipc): clarify advisory menu ID scope and fix formatting

* chore(ui): finish obsolete toolbar comment cleanup

* test(crash): adapt consolidated coverage and guard factory visibility

Maintainer consolidation: use #311 companion invoke and a URL fixture instead of depending on #404 hostname redaction. Add private constructor/copy bytecode assertions. Preserve original contributor tests and implementation credit separately.

* refactor(crash): consolidate construction sanitization in #311

Maintainer scope change: remove only the duplicate #110 implementation, retaining Antriksh1984 original #109/#145 work and commit history. Standalone construction tests are retained with attribution in #311; its Aditya8369 implementation supersedes Error.of. Keep render-time sanitization here until #311 merges and describe the remaining hostname coverage conservatively.

* test(panels): retain sibling lifecycle isolation coverage from #313

Adapt the original #313 test to the #317 constructor and supply the missing panelInfo overrides. Original test scenario and assertions are by @rehannayeem0786; these compile adaptations are maintainer integration work.

* fix(panels): complete lifecycle cleanup across failure and window teardown

Destroy partially constructed panels and replacements that fail to resume. Continue downward lifecycle transitions after a failing pause or stop callback. Dispose panels before plugin teardown in the same callback rather than relying on sibling Compose effect order. Add regression coverage and adapt the retained #313 test bodies for detekt. These changes are maintainer follow-up to the original #313/#317 contributions.

* docs(ui): remove stale disabled top-bar feature list

* test(ipc): protect advisory menu item ID uniqueness

* fix(panels): keep store registration scoped to its window effect

Remove the redundant unregister from plugin teardown. Document independent context services and synchronous Essenty onCreate replay, with tests for registration ownership and exactly-once create callbacks. Keep tab teardown hardening separate. Maintainer follow-up to the review of #317; original #313/#317 contributor credit is unchanged.

* fix(crash): address consolidated sanitization review notes

Maintainer follow-up to Claude N1-N4: document factory/copy invariant, correct stale comments, move Aditya original construction assertions into the service suite while retaining Antriksh blank/diagnostic cases, and log unexpected dialog submission failures. Original contribution credit remains separate.

* fix(logging): keep server failure payloads out of secret RPC logs

Maintainer follow-up to Claude review: log operation and exception type only, preserve sanitized return semantics, and check each catch for safe return/log wiring. Document measured hostname limits without broadening the matcher; add module-local redaction and diagnostic-preservation coverage. Antriksh original implementation remains credited separately.

* ci: build PR batches on dev

* Allow Claude diff reviews after approved fork builds (#413)

* fix(browser): preserve newer clipboard copies during plain-text paste (#316)

* fix(browser): paste-without-formatting no longer clobbers a copy made in its restore window (#205)

* fix(browser): make paste-without-formatting's restore identity-based, not text-based

Review of this PR caught that the text-equality guard cannot distinguish 'our write is still current' from 'a previous press already restored the rich original' - whose string projection is by construction the same text - so two presses inside the 200ms window permanently downgraded a rich clipboard to plain text. A PasteWithoutFormattingSession now tracks the exact Transferable each press installed and restores the pre-window original once, while a user copy in the window still wins. Adds five tests to BrowserClipboardCommandsTest, including the double-press regression; wraps the two over-limit lines; e.message -> e::class.simpleName in the touched handlers.

* fix(browser): fold tryRestore's early exits so it stays within detekt's ReturnCount

* fix(browser): blank lines between FakeTransferable overrides per ktlint

* test(browser): retain clipboard restore scenarios from #408

* fix(browser): track clipboard ownership through AWT wrappers

---------

Co-authored-by: rehannayeem0786 <rehannayeem0786@github.com>
Co-authored-by: Shivang <shivang.iitk@gmail.com>
Co-authored-by: Antriksh1984 <antrikshsingh850@gmail.com>

* fix(plugins): serialize concurrent first loads per class name (#324)

* fix(plugins): prevent duplicate class definitions during concurrent loads

* fix(plugins): make class loading parallel-safe

* test(plugins): pin concurrent loading lifecycle boundaries

Maintainer consolidation follow-up: retain #324 synchronization and its tests; add concurrent shared-name, superclass, and unload-marker coverage. Document caller-sensitive registration based on arjun28115 review feedback and clarify that marking unload does not drain an already admitted parent lookup. No global lifecycle lock or resource-policy changes.

---------

Co-authored-by: sgoel2be24-cyber <223222024+sgoel2be24-cyber@users.noreply.github.com>
Co-authored-by: Procs <168113425+ProportanilityConstant@users.noreply.github.com>
Co-authored-by: Shivang <shivang.iitk@gmail.com>

* fix(browser): defer native disposal until admitted calls drain (#312 + #409) (#412)

* fix: make BrowserHandle JavaScript execution cancellable

the previous synchronous JxBrowser call blocked the Main/EDT thread;
coroutine cancellation could not take effect while that call was blocking;
the implementation now uses JxBrowser’s asynchronous JavaScript callback API;
suspendCancellableCoroutine makes the Kotlin waiting side cancellable;
late callbacks after cancellation are safely ignored;
this does NOT terminate JavaScript already executing inside Chromium.

* fix: add robust native call lifecycle tracking for disposal

* test: verify native operation cleanup on synchronous failure

* fix: linearize browser disposal and pending operation tracking

* fix: resolve detekt violations in browser native tracking

* test: satisfy detekt failure simulation rule

* fix: close native operation disposal race

* fix(browser): drain an in-flight call before closing the browser

Issue #300 reports that executeJavaScript is a synchronous, non-
cancellation-aware native call, and a plugin's own withTimeoutOrNull
around it can only abandon the caller's wait - not the call itself -
which stays running on Main indefinitely and can race a concurrent
handle.dispose(), touching the same native object from two threads at
once.

The severe half of this was already fixed by BoundedBrowserCall: this
class confines every blocking round trip to one dedicated daemon thread
instead of Dispatchers.Main, so a wedged renderer no longer freezes the
app. What was not yet closed is the residual window this issue's core
report is actually about: shutdown() stopped new work but did not wait
for whatever was already running, so a caller could proceed straight to
browser.close() while a call from just before shutdown was still
finishing on the dedicated thread.

shutdown() now waits, bounded, for that in-flight call to drain before
returning. Costs nothing in the common case - awaitTermination returns
immediately once the one worker thread and its queue are both idle,
which is where an instance sits between calls - and only the bound in
the rare case something was genuinely still running.

Known, and disclosed in the KDoc rather than claimed away: this narrows
the race for the common case (a call that was always going to finish
quickly) rather than closing it. It cannot help when the in-flight call
is itself the wedge this class's own deadline exists for - waiting
unboundedly for a genuinely stuck call would reintroduce the exact freeze
BoundedBrowserCall exists to prevent, just moved from a plugin's await
into every caller's teardown path. There is no JxBrowser API on this
version able to interrupt a blocking round trip already inside the
native call, which is the whole reason the call is confined to its own
thread instead of cancelled - closing that window completely needs
JxBrowser's own cooperation, which the issue's own analysis already
concluded is unavailable.

Tests: shutdown waits for a fast in-flight call to finish before
returning, and does not wait past its own drain timeout for a wedged one
- the same before/after pair the rest of this test file already uses for
BoundedBrowserCall's deadline.

* fix(browser): defer native close until admitted calls drain

Consolidates the lifecycle work from #312 (johncybersage) and #409 (Antriksh1984), retaining both original histories. Replaces success-only callback accounting and timeout-then-close with executor termination signals and host-owned native/profile cleanup. These corrections and replacement tests are maintainer/agent work, separate from contributor scoring.

* fix(browser): bound profile waits and clarify deferred cleanup ownership

Address consolidation review: schedule both service disposal paths without awaiting native close, diagnose pending drains, centralize executor ownership, and bound profile lease acquisition without permitting unsafe reuse or eviction. Document process-exit abandonment and verify wiring and cleanup ordering. Maintainer/agent follow-up, separate from original #312 and #409 contributor credit.

* fix(browser): schedule disposal after early UI teardown failure

* ci: create launcher directory before Claude native installation

* Revert "ci: create launcher directory before Claude native installation"

This reverts commit 5184908e6c3f133502508513b4c5e17651b13bc0.

* test: keep warmup registry ordering check on one event loop

* test(browser): normalize CRLF in disposal source wiring guards

---------

Co-authored-by: john k <johnk@johns-MacBook-Pro.local>
Co-authored-by: john k <johnk@syn-172-100-137-112.res.spectrum.com>
Co-authored-by: Antriksh1984 <antrikshsingh850@gmail.com>

* feat(tabs): show a speaker glyph on tabs that are playing audio (#314)

* feat(tabs): show a speaker glyph on tabs that are playing audio (#308)

* fix(tabs): review round - compile, registry lifetime, UI-thread marshalling, owner flush

1. graphicsLayer import dropped (does not exist at that package); the fade now uses .alpha(audioAlpha), already imported. 2. TabAudioRegistry no longer outlives its owner: disposeAllTabsBlocking unregisters everything this component registered, and DetachedTab.destroy drops the entry for a tab destroyed without adoption - the handler captures the BossTabsComponent, so stale entries retained it. 3. The registry update is marshalled to the EDT via SwingUtilities.invokeLater, so the tab-model mutation happens on the UI thread as the KDoc claims. 4. setFullscreenHandler flushes the current playback state once ownerTabId becomes known, closing the starts-before-registration race the review could not verify. 5. TabAudioRegistryTest added: delivery, last-writer-wins, ownership-checked unregister.

* fix(tabs): CI round 2 - DetachedTab receiver error, long line, and baseline-preserving signatures

- BossMainWindowPanel.kt:2098: DetachedTab is a non-inner nested class and cannot use the outer component as receiver; the audio-handler drop moves to detachTab instead, which is where adoption-vs-destroy actually diverges. - TabAudioRegistry.kt:9 wrapped under detekt's 120-char limit. - FluckTabInfo.isPlayingAudio and BossTabButton's glyph read no longer change any signature: the flag is a mutable property (copied in copy()'s body) and the button reads it off tabInfo, so the constructor, copy() and BossTabButton keep their exact baseline-frozen detekt IDs and the resurfaced LongMethod/LongParameterList/CyclomaticComplexMethod findings retire.

* fix(tabs): fold handleAudioUpdate within ReturnCount; add missing final newline in the test file

* fix(tabs): publish audio state by browser ownership and keep icon layout stable

---------

Co-authored-by: rehannayeem0786 <rehannayeem0786@github.com>
Co-authored-by: Shivang <shivang.iitk@gmail.com>

* feat: connect chrome density settings and keyboard controls (#305)

* feat: wire the chrome density scale into settings and small-screen defaults

ChromeDensity / ChromeDimens.of() / LocalChromeDimens already existed on
main and every bar (BossTitleBar, BossTopBar, the main tab bar,
BossBottomBar) already read its height from BossChrome.dimens - but
LocalChromeDimens was never provided anywhere, so it silently resolved to
its staticCompositionLocalOf default (Comfortable) always. The scale was
built and unreachable.

This closes that gap:

- WindowAppearanceSettings gets a `density` field (default COMFORTABLE, so
  an existing install's settings file - which has never heard of this key
  - decodes to exactly the chrome it already had; no settings-version bump
  needed).
- BossApp.kt now provides LocalChromeDimens from that field, host-only and
  outside BossAppCompositionLocals (plugins never draw host chrome).
- A "Density" dropdown in Settings > Bars (Compact/Comfortable/Spacious),
  indexed in Settings search.
- A fresh install on a small screen (< 1000dp logical height, clearing the
  13" MacBook Air's ~931-956pt from #239's own measurements) now defaults
  to Compact and starts with the bottom bar off - the one bar this manager
  can still reclaim itself, since the side strips are already off by
  class default. Toolkit.getScreenSize() is read once, wrapped in
  runCatching (HeadlessException off a display must not break a fresh
  install), with a pure defaultDensityFor(screenHeightDp) so the decision
  is unit-testable without a display.

Addresses #239, scoped down from the full issue. Out of scope in this
pass, deliberately:

- The app does not yet report its own chrome budget as a measured
  percentage - the issue's own "state it, don't argue it" ask. Reachable
  later from the same ChromeDimens source, but needs a spot to render it.
- The title bar's 27dp "Boss Console" label row is untouched - collapsing
  or merging it with the tab bar is a separate, riskier layout change than
  a density scale.
- No regression intended to the existing per-bar show/hide switches or
  focus-mode edges: density only changes how much room a bar that is
  already on screen takes, never whether it is shown.

* fix: drop the Compact-density bottom-bar auto-off, wrap an overlong line

Address review feedback on #305:

- Removed showBottomBar = density != ChromeDensity.COMPACT from
  getDefaultSettings(). ChromeMetricsTest already shows the shipped
  macOS defaults reach 93.3% of a 931dp window at Comfortable, so
  #239's >=90% bar is met without touching the status bar - and that
  bar's own KDoc argues it must stay on ("the only always-on readout").
  It was also reachable from the settings-load catch fallback, so a
  transient read error could silently drop the bar and have the next
  save persist the loss. Compact now only changes density, nothing else.

- Wrapped primaryScreenHeightDp() - was 121 chars, one over detekt's
  default MaxLineLength (120), which applies here since .editorconfig's
  140 is a ktlint-only setting and this line wasn't in the baseline.

* feat: add chrome density setting

* feat: add small-screen chrome defaults

* feat: add chrome density controls and small-screen defaults

* fix(ui): preserve lean density defaults and test density controls

* style: format multiline screen-height lookup

* fix(ui): separate density recovery and make editor chords opt-in

* style: wrap density default documentation

---------

Co-authored-by: AdityaK-iiita <adityakolate0070@gmail.com>
Co-authored-by: Shivang <shivang.iitk@gmail.com>

* fix(plugins): stop host resource fallback after unload (#325)

* fix(plugins): stop host resource fallback after unload

* fix(plugins): preserve resource warning for a missing result

---------

Co-authored-by: sgoel2be24-cyber <223222024+sgoel2be24-cyber@users.noreply.github.com>
Co-authored-by: Shivang <shivang.iitk@gmail.com>

* Handle closed browser frames during navigation callbacks (#400)

* Handle closed browser frames during navigation callbacks

* test(browser): retain closed-event guard after navigation integration

* fix(browser): preserve helpers on PID failure and recognize closed transports

* style(browser): wrap review diagnostics for detekt

---------

Co-authored-by: Shivang <shivang.iitk@gmail.com>

* refactor(window): pin the panel content alignment width (#398)

* fix(window): restore strict width constraints for nested panels

Fixes #278. Commit c15660c5 inadvertently dropped the explicit width constraint for nested panels in the right dock by wrapping them inside a PanelColumn with a Box(weight(1f)) that lacked fillMaxWidth(). This loose constraint caused a known issue with SubcomposeLayout caching stale bounds when resized, resulting in Row content disappearing after weighted Spacers. This commit restores the .fillMaxWidth() propagation.

* Cover panel content alignment across width changes

* Keep panel layout regression in the existing app test package

* Document panel alignment contract and pin filling content width

* Wrap the panel width assertion to satisfy detekt

---------

Co-authored-by: Shivang <shivang.iitk@gmail.com>

* #320 - Fix quick actions vanishing in short tab rail (#328)

* #320 - Fix quick actions vanishing in short tab rail

* Fix: detekt & ktlint checks

* Fix rail action budgets and reversible fallback wiring

* Fix resize test assertion import and update rail coverage note

---------

Co-authored-by: Shivang <shivang.iitk@gmail.com>

* fix(crash): refine scroll boundary and bound error sanitization (#350)

* fix(crash): refine scroll boundary and bound error sanitization

* Avoid exposing a partial token at the crash message limit

* Document sanitizer input bound and verify expansion ordering

---------

Co-authored-by: Aishwary Anand <aishwary.cd22@bmsce.ac.in>
Co-authored-by: Shivang <shivang.iitk@gmail.com>

* fix(logging): redact private hostnames (#346)

* fix(logging): redact private hostnames

* Handle private hostname punctuation and preserve diagnostic ports

* Format hostname punctuation regression assertion

---------

Co-authored-by: ayush <workside@gamil.com>
Co-authored-by: Shivang <shivang.iitk@gmail.com>

* feat: Opening an .html file should ask open as a file or webpage (#333)

* feat: Opening an .html file should ask open as a file or webpage

* Fix HTML prompt delivery and persisted preference ordering

* Cover HTML routing and correct review test fixtures

* Honor HTML navigation intent and release pending prompts on failure

* Isolate HTML prompt handling from the general dialog host

---------

Co-authored-by: Shivang <shivang.iitk@gmail.com>

* fix(plugin-store): parse timestamps consistently in list and detail metadata (#379)

* Fix: Implement proper ISO timestamp parsing in PluginStoreClient

* fix(repository): implement robust ISO timestamp parsing for Supabase payloads

* style(repository): resolve detekt MaxLineLength and TooGenericExceptionCaught

* fix(plugin-store): implement plugin metadata timestamp parsing

PluginStoreClient.parseTimestamp was a stub that always returned 0L, so
every plugin fetched from the store showed "Last Updated"/"Published" as
the Unix epoch in the Toolbox UI regardless of what the server actually
sent (#337).

Parses the ISO-8601 timestamp (the shape the store sends, e.g.
2024-05-12T14:30:00Z, or with a numeric offset) via java.time.Instant,
falling back to 0L for a blank, missing, or malformed string rather than
throwing - matching the field's own empty-string default for a response
that omits it. java.time rather than adding kotlinx-datetime as a new
dependency: this module already uses java.util.* directly in the same
commonMain source set (it has one real target, jvm("desktop")), so nothing
is gained by introducing a second time library for one function.

Tests exercise the real PluginDetailResponse.toPluginInfo(), matching the
convention already established next to it in
PluginStoreResponseDecodingTest: a Z-suffixed timestamp, a numeric-offset
timestamp, a blank string, and a malformed string.

* Fix timestamp normalization edge cases and verify both response mappings

* Use release publication dates and pin timezone-independent fallback

---------

Co-authored-by: Sanjay <sanjaysaini4423@gmail.com>
Co-authored-by: Antriksh1984 <antrikshsingh850@gmail.com>
Co-authored-by: Shivang <shivang.iitk@gmail.com>

* feat(remote-ui): authenticate and expose remote UI surfaces (#348)

* feat(remote-ui): authenticate remote UI process identity

* feat(remote-ui): place authenticated remote UI surfaces

* fix(remote-ui): close ownership and placement lifecycle races

* test(remote-ui): expose placement recovery cases to JUnit

---------

Co-authored-by: Shivang <shivang.iitk@gmail.com>

* feat(dashboard): add shared read-only What's New release feed (#381)

* Add What's New release feed to dashboard

* Serialize update settings persistence

* Remove unused update settings import

* fix(updater): retain realtime refreshes during shared release fetches

* style(updater): format shared release fetch regression tests

* fix(updater): coalesce release refresh bursts and preserve visible history

---------

Co-authored-by: Shivang <shivang.iitk@gmail.com>

* fix(language): consolidate host and out-of-process language-id tables (#358)

* fix(language): consolidate host and out-of-process language-id tables

EditorLanguages (composeApp) and EditorServiceImpl (modules/boss-app-editor)
each hand-maintained their own extension-to-language-id table because
boss-app-editor - a plain JVM module compiled to a GraalVM native image -
could not depend on anything in composeApp. They disagreed: EditorServiceImpl
named .sh/.bash/.zsh "shell", EditorLanguages named them "bash", and
EditorServiceImpl was missing more than forty ids the other table had
(fortran, delphi, latex, lisp, tcl, clojure, batch, diff, ...) (#75).

Moves the table into a new plugin-platform/plugin-language-types module -
dependency-free by design, so it carries nothing extra into boss-app-editor's
native-image build - and has both EditorLanguages and EditorServiceImpl read
from it. This is the first time anything under modules/ depends on
plugin-platform/; verified compiling and passing tests before committing to
the approach.

EditorLanguages keeps its existing public API unchanged (same values for
every extension), so FileTypeCategoriesTest and EditorLanguageDetectionTest
needed no changes. EditorServiceImpl keeps its own "proto"->"protobuf" entry
and "plaintext" fallback as local additions on top of the shared table,
rather than folding them into it: proto isn't part of the boss-file-types.json
default-app-association surface the shared table backs, and "plaintext" is
this service's own gRPC default, not a value composeApp reads.

Adds LanguageIdsTest (the new module) and EditorServiceImplTest (previously
no tests existed for this class at all) - the latter pins the actual bug fix,
that detectLanguage("sh") now returns "bash" instead of "shell".

Out of scope, and disclosed rather than silently dropped: two of the five
duplicate tables the issue names - the editor-tab plugin's own
LanguageDetection and BossEditor's lexer registry - live in separate
repositories this build cannot reach. FileIcons.forSpecialFileName/forFile in
plugin-icons is also not consolidated: it keys icon selection off the raw
filename to preserve distinctions a language id can't carry (package.json,
yarn.lock and pnpm-lock.yaml are all valid JSON/YAML but get three different
brand icons) and never computes a language id in the first place, so
routing it through this table would need a separate icon-selection redesign.

* fix(language): keep file-association drift checks on the shared table

* fix(language): apply shared filename rules to editor file opens

---------

Co-authored-by: Shivang <shivang.iitk@gmail.com>

* fix(editor): contain write-local stack overflow and preserve fatal errors (#396)

* Make writeFileContentSafe actually safe: catch the Errors it was named for

`writeFileContentSafe` exists to return false rather than throw. It did not hold
that contract:

    } catch (e: Exception) {
        fileIoLogger.warn(LogCategory.EDITOR, "Error writing file", error = e)
        false
    }

StackOverflowError is an Error, not an Exception, so it went straight through -
out of writeFileContent, out of the editor_write_file MCP handler, and to the
caller as a bare StackOverflowError instead of the handler's own
"Write failed for <path>". The warn that would have named the file never ran
either.

That is not hypothetical. risa-labs-inc/boss-plugin-editor-tab#18 and #27 are two
independent reports of it, on unrelated content, and #27's complaint is precisely
the missing diagnosis: the error "gives no indication of which input caused it".

StackOverflowError and OutOfMemoryError are caught explicitly rather than
widening to Throwable. A stack overflow unwinds and leaves the JVM usable, and
readFileContentSafe in this same file already treats OutOfMemoryError as a
reportable outcome. Throwable would also absorb LinkageError and ThreadDeath,
which are not this function's to swallow - there is a test asserting a
NoClassDefFoundError still propagates.

The failure log now names the path and the character count. Not the content:
these writes carry whatever the user is editing.

**This does not fix the write.** Whatever recurses is upstream of this function,
which is mkdirs plus writeText - I ruled out the plugin's handler, this write,
and the host's MCP argument parsing, and said so on the issue. What changes is
that the failure is reported honestly instead of escaping, which is where a
diagnosis can start.

The body moves to `guardedWrite` with an injectable write, because a test JVM
cannot be made to overflow the stack inside writeText on demand.

Verified: 3729 tests, 0 failures, plus ktlintCheck and detekt.

Refs risa-labs-inc/boss-plugin-editor-tab#18, #27.

Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>

* docs(editor): clarify write guard scope and prior recursion fix

* fix(editor): preserve fatal heap errors in write guard

---------

Co-authored-by: Claude Opus 5 <noreply@anthropic.com>
Co-authored-by: Shivang <shivang.iitk@gmail.com>

* fix(state): apply version-checked JSON merge patches (#361)

* Fix: Implement proper ISO timestamp parsing in PluginStoreClient

* Feature: Implement JSON Merge Patch for plugin delta state synchronization

* fix(state): validate delta bases and exclude duplicate timestamp scope

* fix(state): reject malformed and deeply nested patches

---------

Co-authored-by: Shivang <shivang.iitk@gmail.com>

* :arrow_up: deps:(deps): Bump grpc from 1.83.1 to 1.84.0 (#363)

Bumps `grpc` from 1.83.1 to 1.84.0.

Updates `io.grpc:grpc-netty` from 1.83.1 to 1.84.0
- [Release notes](https://github.com/grpc/grpc-java/releases)
- [Commits](https://github.com/grpc/grpc-java/compare/v1.83.1...v1.84.0)

Updates `io.grpc:grpc-protobuf` from 1.83.1 to 1.84.0
- [Release notes](https://github.com/grpc/grpc-java/releases)
- [Commits](https://github.com/grpc/grpc-java/compare/v1.83.1...v1.84.0)

Updates `io.grpc:grpc-stub` from 1.83.1 to 1.84.0
- [Release notes](https://github.com/grpc/grpc-java/releases)
- [Commits](https://github.com/grpc/grpc-java/compare/v1.83.1...v1.84.0)

Updates `io.grpc:grpc-services` from 1.83.1 to 1.84.0
- [Release notes](https://github.com/grpc/grpc-java/releases)
- [Commits](https://github.com/grpc/grpc-java/compare/v1.83.1...v1.84.0)

Updates `io.grpc:grpc-util` from 1.83.1 to 1.84.0
- [Release notes](https://github.com/grpc/grpc-java/releases)
- [Commits](https://github.com/grpc/grpc-java/compare/v1.83.1...v1.84.0)

---
updated-dependencies:
- dependency-name: io.grpc:grpc-netty
  dependency-version: 1.84.0
  dependency-type: direct:production
  update-type: version-update:semver-minor
- dependency-name: io.grpc:grpc-protobuf
  dependency-version: 1.84.0
  dependency-type: direct:production
  update-type: version-update:semver-minor
- dependency-name: io.grpc:grpc-stub
  dependency-version: 1.84.0
  dependency-type: direct:production
  update-type: version-update:semver-minor
- dependency-name: io.grpc:grpc-services
  dependency-version: 1.84.0
  dependency-type: direct:production
  update-type: version-update:semver-minor
- dependency-name: io.grpc:grpc-util
  dependency-version: 1.84.0
  dependency-type: direct:production
  update-type: version-update:semver-minor
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
Co-authored-by: Shivang <shivang.iitk@gmail.com>

* :arrow_up: deps:(deps): Bump protobuf from 4.36.0 to 4.36.1 (#364)

Bumps `protobuf` from 4.36.0 to 4.36.1.

Updates `com.google.protobuf:protobuf-kotlin` from 4.36.0 to 4.36.1

Updates `com.google.protobuf:protobuf-java` from 4.36.0 to 4.36.1
- [Release notes](https://github.com/protocolbuffers/protobuf/releases)
- [Commits](https://github.com/protocolbuffers/protobuf/commits)

---
updated-dependencies:
- dependency-name: com.google.protobuf:protobuf-kotlin
  dependency-version: 4.36.1
  dependency-type: direct:production
  update-type: version-update:semver-patch
- dependency-name: com.google.protobuf:protobuf-java
  dependency-version: 4.36.1
  dependency-type: direct:production
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
Co-authored-by: Shivang <shivang.iitk@gmail.com>

* fix(plugins): defer stale jar cleanup until restart (#340)

* fix(plugins): defer stale jar cleanup until restart

* fix(plugins): satisfy quality checks

* Preserve staged plugin artifacts when another plugin updates

* Require cleanup intent and retain artifacts with unordered manifest versions

---------

Co-authored-by: ayush <workside@gamil.com>
Co-authored-by: Shivang <shivang.iitk@gmail.com>

* fix(plugins): defer fluck-browser hot-reload to a restart (#352)

* fix(plugins): defer stale jar cleanup until restart

* fix(plugins): defer fluck-browser hot-reload to a restart

Hot-reloading fluck-browser force-unloads the classloader that created its
JxBrowser native views. Every open tab - and every tab opened afterward,
since the factory that would recreate the view is gone too - draws an empty
box, and a second hot-reload does not recover it; only a full restart does.

HotReloadPolicy names plugins that must never be swapped in place, matching
the existing NOT_USER_INSTALLABLE/RetiredPlugins pattern. It's checked at
every path that can force-unload a live plugin to apply an update: the
resetPluginInstances/doReloadPlugin path that actually reproduced this bug,
the menu-driven Reload action, the Toolbox update flow, and the store
installer. For a not-hot-reloadable plugin, the new jar is staged into
installed.json without touching the running instance or its open tabs, and
a status message tells the user to restart to apply it - the next cold
start loads the update with a fresh classloader.

Also fixes two call sites that asked "restart dependent plugins?" before
checking whether an unload was even going to happen, which produced a
confusing prompt for an unload that a deferred update was never going to
do.

* fix(plugins): satisfy quality checks

* Preserve staged plugin artifacts when another plugin updates

* Validate deferred browser artifacts and reject ineffective downgrades

* Require cleanup intent and retain artifacts with unordered manifest versions

* Preserve unloaded-browser recovery and unify safe deferred selection

* Format scoped update cleanup integration

---------

Co-authored-by: ayush <workside@gamil.com>
Co-authored-by: Shivang <shivang.iitk@gmail.com>

* Harden OOP plugin reaping: hook-race flag, registry cleanup, spawn guard (#135) (#365)

* Harden OOP plugin reaping: hook-race flag, registry cleanup, spawn guard (#135)

reapDepth (AtomicInteger) replaces the boolean reaping flag, so the two JVM shutdown hooks (main.kt and KernelBootstrap) cannot clear the in-progress signal while the other is still reaping (item 2). reapChildren now unregisters reaped handles from the process-wide ProcessRegistry, so stale dead entries do not persist across an in-process mode switch (item 4). OutOfProcessPluginSpawnerImpl.spawn() stands down when isReaping(), so a plugin load racing host exit cannot register a child after the reap snapshot (item 3). Covered by ReapChildrenTest.

* Serialize plugin spawn registration with reaping and preserve replacement handles

* Fence late process creation without blocking shutdown and cover recovery

---------

Co-authored-by: Shivang <shivang.iitk@gmail.com>

* fix(plugins): complete loader cleanup after disposal linkage errors (#302)

* fix: API hot swap during startup

* fix: workflows

* …
kshivang and others added 7 commits September 14, 2026 20:19
…ive paths to the walk

java.io.File.canonicalPath does not follow a symlink or a directory junction on Windows, so the containment check in scanDirectory passed for anything reachable through a junction inside the project and the whole subtree behind it was indexed. mklink /J needs no elevation, so planting one takes only write access in the project. The comparison was also a String prefix with no separator, so a sibling whose name merely begins with the root's counted as inside it on every platform.

Confinement now resolves with Path.toRealPath() and compares with Path.startsWith, which matches whole name components, closing both holes with one comparison. Only a link can take an entry out of the directory it was listed in, and the walk only descends through already confined directories, so the resolve is paid only for entries that are links. A Windows junction is not reported by Files.isSymbolicLink but does set isOther, so both are checked, and an unreadable attribute falls through to the resolve rather than being waved through.

relativePath was produced by slicing the child's absolute path at the length of the root's canonical path. Those are two spellings of the same directory, so whenever they differed in length every entry was cut at the wrong offset: an 8.3 short component in the root displayed src\Main.kt as rc\Main.kt, and a project under /tmp on macOS lost its folders entirely. It now relativizes two paths that are both in the walk's own spelling.

ContentSearchService.resolveFile already reached both conclusions for the replace path and documents the Windows behaviour; this brings the index walk in line with it.

Extracting the per entry checks makes three FileIndexer suppressions unnecessary, so they are removed from detekt-baseline.xml rather than re-keyed to the new signature.
@Vidhaankhare16

Copy link
Copy Markdown
Contributor Author

Integrated and pushed. New head is c896ec9858e149d46ace3e762e9aace59bf4bae5, and the PR is back to MERGEABLE: 2 commits, 3 files, +378/-66.

The branch was rewritten to drop the merge commit a15c25b7, which is what made this read as seventeen commits and produced the .gitignore / BossBottomBar.kt / McpPolicyEngine.kt conflicts. Only the two search commits were replayed, which is the replay you verified yourself. Your c87b61e0 is preserved as c896ec98 with your authorship intact; its original SHA is no longer reachable from the head, which is the unavoidable cost of the rewrite rather than anything discarded.

Integrated onto de67e2a8 and rechecked against current dev 7082e2cb: still merges clean, and FileIndexer.kt has not been touched on dev since. The new RememberSpotlightFileIndexer.kt references only the FileIndexer type, not any internal this change moves, so the two compose.

Your integration points, one by one

  1. Fix/spotlight project session isolation #593's suspend scanner signatures retained. scanProjectFiles and scanDirectory are both suspend. No non-suspend signature was restored.
  2. ensureActive() at scan entry and each child retained. Three call sites: scanProjectFiles entry, scanDirectory entry, and once per child inside the loop.
  3. Mutex and cancellation handling retained. indexingMutex.withLock is kept, so requests queue rather than drop. My branch had tryLock, which skips; that behaviour is gone in favour of yours. The CancellationException rethrow ahead of the generic catch is kept.
  4. Injectable scan seam retained. The constructor is still FileIndexer(scan: (suspend (String) -> List<IndexedFile>)? = null), and indexProject still prefers scan?.invoke(...) over the real walk.
  5. Confinement helpers combined in. IndexRoot, resolveRoot, isSkipped, isConfined, passesExtensionFilter, relativeToRoot, plus file-level isLink and resolvesInsideRoot. toRealPath with component-wise Path.startsWith replaces the junction-blind canonicalPath and the separator-less String prefix.

Baseline entries. Three disappeared, not two: CyclomaticComplexMethod, NestedBlockDepth and LoopWithTooManyJumpStatements, all for the old scanDirectory. Detekt then ran against the integrated source and returned an empty report, so the decomposition genuinely drops all three rather than my having guessed at it. No obsolete signature was re-added.

Validation

Temurin 17, full :composeApp:desktopTest, both runs warm against the same populated build cache:

tests failures skipped
clean dev de67e2a8 5028 2 15
this head c896ec98 5033 2 16
delta +5 0 +1

The change adds exactly its five tests and one environmental skip; nothing else moves. Both remaining failures are the disclosed symlink-privilege ones, present on clean dev too.

Search package, all green: FileIndexerConfinementTest 5, FileIndexerTest 6, SpotlightFileIndexOwnerTest 4, GlobalSearchIsolationTest 3, SpotlightSearchEffectTest 1, GlobalSearchNewSourcesTest 30, GlobalSearchOrderingTest 5, GlobalSearchTabsTest 11, SearchSourceRegistrarTest 7. That is 72 tests, 0 failures, and it puts #593's cancellation cases and this change's confinement cases in the same passing build. :composeApp:ktlintCheck and :composeApp:detekt both clean.

One correction to my earlier evidence. I previously reported five confinement tests with no skips. On this Windows host that is wrong: a file link outside the project is excluded is skipped, because it needs a file symlink and the mklink /J fallback only makes directory junctions. Four pass, one skips. The three directory-link cases do use the junction fallback. Hosted Linux CI should run all five.

Worth knowing before you re-run anything. A cold run of this suite reports false failures. Mine reported 5: the 2 above plus HeadlessLoggingTest ("logging probe must finish") and two GitCloneProcessTreeTest cases (PID capture, process-tree termination). The identical commit re-run warm reports only the 2. Those three are timing-sensitive and starve when compilation runs alongside them - the cold run took 45m6s against 7m50s warm - and all three pass on this head warm. They are not related to this change: neither test imports anything from the search package, and FileIndexer is referenced only from search and dialog code.

Remaining gate

Required hosted CI on this new head, which is at action_required like every push of mine here. Previous green CI does not cover this integration and I am not offering it as though it did. That approval is the one step I cannot take.

Once it is green I will mark this ready, which is the order you asked for. The manual Spotlight checks through a linked root, internal links and external sibling links remain unperformed and I am not claiming them.

No merge or auto-merge is authorized.

@Vidhaankhare16
Vidhaankhare16 marked this pull request as ready for review September 15, 2026 05:27
@kshivang

Copy link
Copy Markdown
Contributor

@Vidhaankhare16 Your c896ec9 follow-up addresses the previous integration handoff: suspend scanning, all three cancellation checkpoints, mutex admission, cancellation propagation and the injected scan seam are retained. Thank you also for correcting the Windows file-symlink skip count.

Current dev was rebased again, so I integrated dev 77c4a40 in normal merge commit 0b7cfda, preserving your two published commits and their author identities. The resulting delta is exactly the intended three-file patch: FileIndexer, its five confinement tests, and removal of three obsolete detekt entries. Its patch is byte-identical to your two-commit delta except for the detekt baseline's old/new blob IDs, reflecting unrelated baseline updates on dev. No new production or test repair is claimed.

Required hosted CI is running on this head: https://github.com/risa-labs-inc/BossConsole/actions/runs/34959783785 . Local search-package tests plus composeApp ktlint/detekt are queued under the shared build lock. Prior Claude findings and their repair response remain applicable because the implementation/test patch is unchanged. Keeping this ready while checks run; pending CI is not an author defect. Final merge, if green, will be an exact-head squash into dev under the shared merge lock. Manual linked-root/internal-link/external-link Spotlight checks remain unperformed.

@kshivang
kshivang merged commit cf21742 into risa-labs-inc:dev Sep 15, 2026
11 checks passed
@kshivang

Copy link
Copy Markdown
Contributor

Merged into dev as cf21742 after all ten Build & Test jobs passed on exact reviewed head 0b7cfda. CI: https://github.com/risa-labs-inc/BossConsole/actions/runs/34959783785 . The optional Supabase Preview check was skipped.

Downloaded and parsed all three platform test artifacts: Ubuntu, Windows and macOS each report 140 search-package plus SpotlightSearchEffect tests, zero failures/errors/skips, including all five confinement cases and the existing cancellation/session-owner tests. Root detekt and ktlintCheck passed in the code-quality job. The local attempt waited nine minutes for the shared build lock without starting Gradle, so I cancelled only that owned waiter; these are hosted results, not a new local pass.

Under the shared merge lock I refreshed main/dev, rechecked OPEN/non-draft/dev, exact head, clean mergeability, review state and all checks; recomputed the merge tree against dev61200ffe6; and required the complete three-file delta to equal the reviewed patch (ignoring only blob-ID header lines). Used a squash merge matched to the verified head. Concurrent #710, #590 and #640 changes were preserved. Main and integration #713 were untouched.

Original algorithm/decomposition/three tests and your follow-up integration remain credited to @Vidhaankhare16; prior agent test/setup improvements remain separately credited in the description. This batch added only integration, not new contributor implementation. Manual Spotlight/Windows non-admin junction checks remain unperformed; the hosted Windows run executed every confinement test without skips.

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.

6 participants