-
Notifications
You must be signed in to change notification settings - Fork 1
ci(codeql): treat Java like every other managed runtime — add java-kotlin matrix + scan AlloyRunner.java #662
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Merged
Merged
Changes from all commits
Commits
Show all changes
3 commits
Select commit
Hold shift + click to select a range
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
118 changes: 118 additions & 0 deletions
118
docs/backlog/P2/B-0076-disowned-runtime-sweep-python-typescript-2026-04-28.md
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,118 @@ | ||
| --- | ||
| id: B-0076 | ||
| priority: P2 | ||
| status: open | ||
| title: Disowned-runtime sweep — Python + TypeScript surface (same pattern PR #662 fixed for Java) | ||
| effort: S | ||
| ask: extend the codeql.yml analyze matrix to cover python + javascript-typescript like PR #662 did for java-kotlin | ||
| created: 2026-04-28 | ||
| last_updated: 2026-04-28 | ||
| tags: [codeql, disowned-runtime, python, typescript, dependency-honesty, b-0075-sibling] | ||
| --- | ||
|
|
||
| # B-0076 — Disowned-runtime sweep: Python + TypeScript | ||
|
|
||
| ## Source | ||
|
|
||
| Discovered 2026-04-28 immediately after PR #662 landed the Java | ||
| side of this same pattern. EVIDENCE-BASED audit: | ||
|
|
||
| ```bash | ||
| find . -type f \( -name "*.py" -o -name "*.ts" \) \ | ||
| -not -path "*/node_modules/*" -not -path "*/.git/*" \ | ||
| -not -path "*/.claude/worktrees/*" \ | ||
| -not -path "*/references/upstreams/*" \ | ||
| -not -path "*/bench/*" 2>/dev/null | ||
| ``` | ||
|
|
||
| Returns first-party files: | ||
|
|
||
| - **Python (2):** | ||
| - `tools/hygiene/sort-tick-history-canonical.py` | ||
| - `tools/hygiene/fix-markdown-md032-md026.py` | ||
| - **TypeScript (2):** | ||
| - `eslint.config.ts` | ||
| - `tools/invariant-substrates/tally.ts` | ||
|
|
||
| (Lean's `tools/lean4/.lake/packages/...` JS files are vendored | ||
| and already excluded via `tools/lean4/**` in | ||
| `.github/codeql/codeql-config.yml` paths-ignore.) | ||
|
|
||
| ## The disowned-runtime pattern (per CURRENT-aaron.md §28) | ||
|
|
||
| When a runtime is in `.mise.toml`, every surface that touches it | ||
| (CodeQL matrix, install path, workflow comments) must treat it | ||
| consistently. The failure shape is "X is managed for install but | ||
| workflow Y pretends X doesn't exist." | ||
|
|
||
| EVIDENCE that this pattern applies to Python + TypeScript: | ||
|
|
||
| - `.mise.toml:25` → `python = "3.14"` (managed) | ||
| - `.mise.toml:28` → `bun = "1.3"` (TypeScript runtime, managed) | ||
| - `.github/workflows/codeql.yml` analyze matrix (after PR #662): | ||
| `actions / csharp / java-kotlin` — **no python, no | ||
| javascript-typescript** | ||
| - Path-gate uploads empty SARIF for python + | ||
| javascript-typescript (mitigates the umbrella-NEUTRAL surface | ||
| symptom) but does NOT scan the actual `.py` / `.ts` files | ||
|
|
||
| The current state silently scans nothing for Python and TS code | ||
| even though the runtimes are managed and the files exist. Same | ||
| shape as Java pre-#662. | ||
|
|
||
| ## Why P2 (not P1, not P3) | ||
|
|
||
| - Not P0/P1: no current incident; Python/TS code paths are small | ||
| (4 files total) and tooling-only (hygiene scripts + lint | ||
| config + small invariant tool). No production-path security | ||
| exposure today. | ||
| - Not P3: the pattern matches an active discipline (CURRENT-aaron | ||
| §28) and Aaron's recent framing is moving toward "managed | ||
| means scanned." Sleeping on it accumulates the same disownment | ||
| PR #662 just resolved. | ||
|
|
||
| ## Scope | ||
|
|
||
| `.github/workflows/codeql.yml` analyze matrix gains two cells: | ||
|
|
||
| ```yaml | ||
| - language: python | ||
| build-mode: none | ||
| - language: javascript-typescript | ||
| build-mode: none | ||
| ``` | ||
|
|
||
| `.github/codeql/codeql-config.yml` may need adjustment depending | ||
| on whether any current paths-ignore entry covers a python or ts | ||
| file path that should now be scanned. Audit `bench/**`, | ||
| `tools/lean4/**`, `references/upstreams/**` for masking effects | ||
| on the 4 first-party files. | ||
|
|
||
| `tools/invariant-substrates/tally.ts` should be confirmed | ||
| in-scope (it's a Zeta tool — first-party). `eslint.config.ts` | ||
| is repo-wide config; CodeQL scans configs as expected. | ||
|
|
||
| ## Acceptance | ||
|
|
||
| - [ ] `Analyze (python)` and `Analyze (javascript-typescript)` | ||
| legs added to the matrix and pass on a smoke PR | ||
| - [ ] Findings (if any) on the 4 first-party files surface as | ||
| code-scanning alerts in Security tab | ||
| - [ ] codeql.yml header doc updated to enumerate all 5 | ||
| first-party-runtime languages (actions / csharp / | ||
| java-kotlin / python / javascript-typescript) consistently | ||
| - [ ] `feedback_codeql_umbrella_neutral_vs_per_language_detection_pattern_aaron_2026_04_28.md` | ||
| updated with "all five legs honest" note when this lands | ||
|
|
||
| ## Composes with | ||
|
|
||
| - PR #662 (the Java leg of this same pattern; this row extends | ||
| the same fix to Python + TS) | ||
| - B-0075 (JVM language preference; this row is the | ||
| non-JVM-runtime sibling) | ||
| - CURRENT-aaron.md §28 (dependency-honesty rule — the | ||
| discipline this row applies) | ||
| - `.mise.toml` (the source of truth for what "managed" means) | ||
| - `feedback_codeql_umbrella_neutral_vs_per_language_detection_pattern_aaron_2026_04_28.md` | ||
| (the deeper structural cause section; this row is one of the | ||
| fallout cleanups it predicts) |
109 changes: 109 additions & 0 deletions
109
docs/backlog/P3/B-0075-jvm-language-preference-kotlin-scala-java-2026-04-28.md
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,109 @@ | ||
| --- | ||
| id: B-0075 | ||
| priority: P3 | ||
| status: open | ||
| title: JVM language preference — Kotlin > Scala > Java; sweep fallout when JVM code is added or rewritten | ||
| effort: S-per-fallout | ||
| ask: future-direction substrate; trigger sweep when JVM code touches the repo | ||
| created: 2026-04-28 | ||
| last_updated: 2026-04-28 | ||
| tags: [jvm, kotlin, scala, java, language-preference, alloy-runner, future-direction] | ||
| --- | ||
|
|
||
| # B-0075 — JVM language preference: Kotlin > Scala > Java | ||
|
|
||
| ## Source | ||
|
|
||
| Aaron 2026-04-28T14:48Z, after PR #662 landed `tools/alloy/AlloyRunner.java` | ||
| honestly back into the CodeQL surface: | ||
|
|
||
| > *"also i'm a big fan of kotlin we should prefere jvm languages in this | ||
| > order kotlin, scala, java backlog this any any updates that fall out"* | ||
|
|
||
| ## The preference | ||
|
|
||
| When Zeta adds new JVM-targeted code (or non-trivially rewrites existing | ||
| JVM code), prefer the language in this order: | ||
|
|
||
| 1. **Kotlin** — first choice. Aaron's stated favorite. Modern, | ||
| null-safe, concise, interoperates with Java, ships fast. | ||
| 2. **Scala** — second choice. Functional-first, mature, FP-friendly | ||
| (composes with the F# / DBSP factory aesthetic). | ||
| 3. **Java** — third choice. Use only when Kotlin / Scala friction | ||
| outweighs the language-preference cost (e.g. trivial single-file | ||
| tooling where Kotlin's gradle / kotlinc dependency would be heavier | ||
| than `javac AlloyRunner.java`). | ||
|
|
||
| The CodeQL `java-kotlin` extractor scans all three; the security-scanning | ||
| surface doesn't change with the language choice. | ||
|
|
||
| ## Trigger | ||
|
|
||
| Apply this preference when: | ||
|
|
||
| - A new JVM-targeted file lands (any `.kt`, `.scala`, `.java`) | ||
| - Existing JVM code is non-trivially rewritten (>20 lines, refactor, or | ||
| feature extension — not bug fixes) | ||
| - A new JVM-based tool is integrated (Spark, Flink, Kafka client, | ||
| custom Alloy / TLA harness, etc.) | ||
| - A round of formal-verifier work expands the JVM tool surface | ||
|
|
||
| ## Known fallout | ||
|
|
||
| - **`tools/alloy/AlloyRunner.java`** (existing first-party JVM file) is | ||
| the natural candidate for a Kotlin migration the next time it gets | ||
| non-trivial work. Current state: 1 file, single-purpose Alloy driver, | ||
| CodeQL-scanned via PR #662. Migration not urgent; trigger when the | ||
| file is touched for non-bug-fix reasons. | ||
|
|
||
| - Kotlin migration adds: gradle / kotlinc / kotlin-stdlib runtime | ||
| dependency | ||
| - Kotlin migration buys: null-safety, less ceremony, modern syntax | ||
| - Decision criterion: when the file gets a substantive feature | ||
| (e.g. JSON output, multi-spec composition, parallel-runs), the | ||
| rewrite cost amortizes; until then, keep as Java | ||
| - Composes with `.mise.toml` already pinning Java 26 — Kotlin would | ||
| need a parallel `kotlin = "<version>"` mise pin | ||
|
|
||
| - **`tools/setup/manifests/{apt,brew}` comments** mention "OpenJDK | ||
| moved off brew/apt onto mise" — accurate today; if Kotlin migration | ||
| lands, comments should mention "JDK + Kotlin via mise" for clarity. | ||
|
|
||
| - **`docs/research/build-machine-setup.md`** documents the mise pin | ||
| rationale; would gain a "JVM languages we prefer" note when this | ||
| preference graduates from backlog. | ||
|
|
||
| ## Why P3 (deferred / convenience) | ||
|
|
||
| No JVM code is currently being added. The preference is future-direction | ||
| substrate that pays off as the JVM surface grows. Promoting to P2/P1 | ||
| when: | ||
|
|
||
| - Aaron names a specific JVM project he wants to start | ||
| - A round of formal-verifier work expands the harness | ||
| - The Alloy runner needs a feature the current Java surface doesn't | ||
| support cleanly | ||
|
|
||
| ## Acceptance | ||
|
|
||
| - [ ] Preference indexed in `MEMORY.md` so future-Otto sees it at | ||
| session bootstrap (covered by this row's existence + the row's | ||
| indexing in the BACKLOG.md / per-row index) | ||
| - [ ] When the next JVM file lands, the PR description cites this | ||
| row's preference order and explains the language choice (Kotlin | ||
| by default, Scala / Java with rationale) | ||
| - [ ] If `tools/alloy/AlloyRunner.java` gets a non-trivial rewrite, | ||
| the rewrite ships in Kotlin with a `tools/alloy/AlloyRunner.kt` | ||
| replacement + a brief migration note in the commit message | ||
|
|
||
| ## Composes with | ||
|
|
||
| - PR #662 (the codeql java-honesty fix that surfaced this preference | ||
| as fallout-worthy substrate) | ||
| - `.mise.toml` (where any Kotlin / Scala pin would live) | ||
| - `feedback_speculation_leads_investigation_not_defines_root_cause_aaron_2026_04_28.md` | ||
| (the EVIDENCE-BASED labeling discipline this row exemplifies — the | ||
| preference IS labeled, the trigger conditions ARE listed, the | ||
| fallout IS enumerated) | ||
| - `docs/research/build-machine-setup.md` (the eventual sweep target | ||
| when the preference activates) |
Oops, something went wrong.
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.