Skip to content

feat(electron): resolve stable local constant window options - #4400

Merged
N0zoM1z0 merged 8 commits into
mainfrom
feat/electron-static-window-options
Oct 16, 2026
Merged

N0zoM1z0 merged 8 commits into
mainfrom
feat/electron-static-window-options

Conversation

@N0zoM1z0

@N0zoM1z0 N0zoM1z0 commented Oct 16, 2026 •

Copy link
Copy Markdown
Collaborator

Summary

new BrowserWindow(options) previously lost explicit preferences when options was a local constant. This resolves stable const options/preferences through the shared lexical and mutation owners, while keeping relevant writes, escapes, shadowing and ambiguous initialization unknown. Unrelated options.icon writes do not discard webPreferences.

Fixes #4366; part of #3536 and #4027. #3536 remains open for popup overrides and optional spreads.

Contract and boundaries

  • Existing CLI/MCP analysis and retained fact views share the implementation; no new tool or target authority. Existing private analyzer workers read inert source; application code never executes.
  • Preserve constructor identity, construction order across mixed inline/constant/unresolved forms, inline observed Evidence and explicit unknowns. Constant associations are inferred and retain original object source ranges. The strict worker schema accepts the additive optional provenance field.
  • Build the yielding shared mutation index only for plausible constant candidates; no persistent cache or arbitrary new limits.

Evidence and validation

Real official Joplin 3.7.21 ASAR: one unchanged window identity now reports five explicit preferences (four literal booleans and dynamic session). Both trial orders pass independent source oracles and exact complete CLI/MCP view Evidence parity. Complete semantic content is equal after excluding only the changed parent-graph commitment and its derived graph ID; raw digests remain recorded.

  • Current shared-query implementation: npm run check and npm run docs:check (5 consistency cases) passed; 107 focused cases across ten files passed. Seventeen current source pins and the 1647-JavaScript runtime tree verified after commit.

  • Shared owner exposes lexical identity and early-exit mutation checks without allocating full reports; complete effects remain available to the require-source consumer. A deterministic regression bounds repeated effect reads. The synthetic capacity control at 1024 constructors measured 4.413→0.200 median CPU seconds; first-run/V8 warm-up and raw samples are retained. This is not a real-app speedup claim.

  • Focused 9-file invocation: 156/157 passed. An unchanged upstream generator case hit its 30s limit; isolated runs at that same limit passed on main and candidate (18.590/18.034s). The original failure remains recorded; no deadline changed.

  • The pinned checker passes two original real trial pairs, both subsequent real-app validations and eight mutated-result controls. The complete CLI semantic-content comparison and checker replay passed. The ordering regression failed before the producer fix; fresh real Joplin runs after the ordering and shared-query fixes preserve the exact complete answer and semantic fingerprint (44.028/44.607s, same BPE). Original trial receipts remain unchanged. The stored-alias review example already returned unknown on the reviewed code; executed CLI evidence and its retained regression document the disagreement, with no mutation-rule change.

Reproducible record and limitations, compact data.

Projected structured-task BPE 13337→13432 (+95); identical selected catalog. No speedup claim: the reversed pair was 42.958s on main versus44.793s here. One CPU, 8GiB hard limit; all observed runs reported no OOM and verified payload cleanup. No Electron GUI, live-model billing or system-cold claim.

Author readiness

Human owner: @N0zoM1z0

The session authorized implementation, validation, ready PRs and merging, including waiving manual declarations. The agent reviewed the diff/evidence. A human final-diff review is not asserted; declarations remain unchecked.

  • I reviewed the final diff and relevant existing code, understand the change and its edge cases, and take responsibility for the complete PR, including AI-assisted work.
  • I checked the evidence above, confirmed it supports the current change, and recorded meaningful validation gaps.
  • I declare this PR ready for initial maintainer review.

Before merge

  • Scope, shared ownership, caller choices, Evidence and local validation reviewed by the agent.
  • Current-main integration and reproducible real-application checks recorded without discarding negative results.
  • Current-head CI and automated reviews completed; attributable findings addressed.

Final head 73ac512f9ae633e3a65849ec7a862ad3c151fa7f: all 39 checks passed; core CI completed with all 36 jobs successful. Codex and Greptile reviewed this head with no outstanding findings; all three review threads are resolved.

N0zoM1z0 and others added 4 commits October 16, 2026 05:16
Reuse lexical initialization and alias-aware mutation facts, retain inferred configuration source ranges, and preserve inline observations. Refs #4366; part of #3536.

Co-authored-by: Kaoru0822 <[email protected]>
Integrate guarded factory fallthrough before final validation.

Co-authored-by: Kaoru0822 <[email protected]>
The real Joplin window query exposed an artifact-path-only coverage assertion; the independent selector already handled both location kinds.

Co-authored-by: Kaoru0822 <[email protected]>
Preserve both trial orders, independent source oracles and complete semantic-content comparison; distinguish graph commitments, observed variance and unmeasured costs. Grouped upstream timeout and same-deadline passing controls remain recorded.

Co-authored-by: Kaoru0822 <[email protected]>
@chatgpt-codex-connector

chatgpt-codex-connector Bot commented Oct 16, 2026 •

Copy link
Copy Markdown

Codex Review Summary

This comment shows the latest Codex review activity on this pull request.

Review Status Commit Review trigger
📝 Code Review ✅ Completed 2026-10-16T06:45:58.215297Z 73ac512 Manual request
ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review" or "@codex security review".

Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings.

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: 77d43d1f2f

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

@greptile-apps

greptile-apps Bot commented Oct 16, 2026 •

Copy link
Copy Markdown
Contributor

RetriggerView in GreptileConfidence Score: 5/5

[Medium impact] The PR appears safe to merge, with no outstanding findings.

Summary

Resolves stable local const objects passed to BrowserWindow while preserving unknown results for relevant writes, escapes, and uncertain initialization.

  • BrowserWindow findings now resolve stable local constant options.
  • Repeated mutation checks stop when an earlier change settles the answer.

Diagram

%%{init: {'theme': 'neutral'}}%%
flowchart TD
  A[BrowserWindow argument] --> B{Local constant candidate?}
  B -->|No| C[Keep inline or unknown result]
  B -->|Yes| D[Build shared mutation index]
  D --> E{Relevant prior or uncertain effect?}
  E -->|Yes| F[Keep options unknown]
  E -->|No| G[Read original object]
  G --> H[Attach inferred source ranges]
  C --> I[Restore constructor order]
  F --> I
  H --> I
  I --> J[CLI, MCP, and retained fact views]
Loading

Reviews (3) · Last reviewed commit: "test(javascript): preserve mutation quer..." · Reviewed by Greptile

N0zoM1z0 and others added 2 commits October 16, 2026 05:53
Restore source order in the producing collection before module attribution and graph consumers. Cover mixed constant, inline, unresolved and previously escaped options; preserve uncertainty after the first constructor receives an object.

Co-authored-by: Kaoru0822 <[email protected]>
Keep the original two trial pairs unchanged and append source-order red/green results, the same complete Joplin answer, current source/runtime pins and current check receipts.

Co-authored-by: Kaoru0822 <[email protected]>
@N0zoM1z0

Copy link
Copy Markdown
Collaborator Author

@codex review

@chatgpt-codex-connector

Copy link
Copy Markdown

Codex Review: Didn't find any major issues. Hooray!

Reviewed commit: 7bc925c7ad

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

N0zoM1z0 and others added 2 commits October 16, 2026 06:23
Separate lexical identity lookup from effect reporting, stop mutation predicates at the first relevant prior or unknown effect, and reuse the owner in window and request analysis. Preserve complete reports for the require-source consumer. Add bounded-read and stored-reference regressions plus a reproducible scaling control.

Co-authored-by: Kaoru0822 <[email protected]>
Retain raw before/after capacity samples, separate V8 warm-up and real Joplin results, preserve earlier trials, and record current source/runtime and verification receipts. Document the nonreproduced stored-reference finding with executed CLI and regression evidence.

Co-authored-by: Kaoru0822 <[email protected]>
@N0zoM1z0

Copy link
Copy Markdown
Collaborator Author

@codex review

@chatgpt-codex-connector

Copy link
Copy Markdown

Codex Review: Didn't find any major issues. Hooray!

Reviewed commit: 73ac512f9a

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

@N0zoM1z0
N0zoM1z0 merged commit d72d856 into main Oct 16, 2026
40 checks passed
@N0zoM1z0
N0zoM1z0 deleted the feat/electron-static-window-options branch October 16, 2026 06:52
@N0zoM1z0

Copy link
Copy Markdown
Collaborator Author

Merged as d72d856. All 17 authored source hashes and the exact tested feature patch match; the required coauthor is present. A separate cleanup-diagnostics main commit landed before the squash, so whole-tree equality with the reviewed head does not hold.

The combined merged tree was independently verified: 124 cases across 12 files passed (the original 107 plus the newly integrated provider/error-projection coverage); full static checks passed (6 tasks plus architecture guards). A fresh real Joplin CLI/MCP workflow returns the exact same complete answer, raw semantic fingerprint, token projections and view Evidence parity as the reviewed source. One CPU / 8 GiB, no observed OOM and payload cleanup verified. The original PR-head CI remains 36/36 core jobs successful; these post-merge local checks are separate evidence.

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

Labels

enhancement New feature or request provider: electron Analysis provider / engine: electron

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[Feature] Resolve stable local constant BrowserWindow options through shared binding facts

2 participants