chore(task-85): finalize closure tracking and launcher path enforcement

This commit is contained in:
2026-02-20 23:15:02 -08:00
parent f8db9e7119
commit c8c7f46a16
12 changed files with 211 additions and 31 deletions

View File

@@ -60,3 +60,6 @@ jobs:
- name: Verify Bun subminer wrapper - name: Verify Bun subminer wrapper
run: dist/launcher/subminer --help >/dev/null run: dist/launcher/subminer --help >/dev/null
- name: Enforce generated launcher workflow
run: bash scripts/verify-generated-launcher.sh

View File

@@ -208,6 +208,9 @@ jobs:
- name: Verify Bun subminer wrapper - name: Verify Bun subminer wrapper
run: dist/launcher/subminer --help >/dev/null run: dist/launcher/subminer --help >/dev/null
- name: Enforce generated launcher workflow
run: bash scripts/verify-generated-launcher.sh
- name: Package optional assets bundle - name: Package optional assets bundle
run: | run: |
VERSION="${GITHUB_REF#refs/tags/}" VERSION="${GITHUB_REF#refs/tags/}"
@@ -220,7 +223,7 @@ jobs:
- name: Generate checksums - name: Generate checksums
run: | run: |
shopt -s nullglob shopt -s nullglob
files=(release/*.AppImage release/*.dmg release/*.zip release/*.tar.gz subminer) files=(release/*.AppImage release/*.dmg release/*.zip release/*.tar.gz dist/launcher/subminer)
if [ "${#files[@]}" -eq 0 ]; then if [ "${#files[@]}" -eq 0 ]; then
echo "No release artifacts found for checksum generation." echo "No release artifacts found for checksum generation."
exit 1 exit 1
@@ -288,6 +291,6 @@ jobs:
release/*.zip release/*.zip
release/*.tar.gz release/*.tar.gz
release/SHA256SUMS.txt release/SHA256SUMS.txt
subminer dist/launcher/subminer
draft: false draft: false
prerelease: false prerelease: false

View File

@@ -1,10 +1,10 @@
--- ---
id: TASK-85 id: TASK-85
title: Refactor large files for maintainability and readability title: Refactor large files for maintainability and readability
status: In Progress status: Done
assignee: [] assignee: []
created_date: '2026-02-19 09:46' created_date: '2026-02-19 09:46'
updated_date: '2026-02-21 03:29' updated_date: '2026-02-21 07:11'
labels: labels:
- architecture - architecture
- refactor - refactor
@@ -16,7 +16,7 @@ priority: medium
## Description ## Description
<!-- SECTION:DESCRIPTION:BEGIN --> <!-- SECTION:DESCRIPTION:BEGIN -->
Several core files are oversized and high-coupling (`src/main.ts`, `src/anki-integration.ts`, `src/config/service.ts`, `src/core/services/immersion-tracker-service.ts`). This task tracks phased, behavior-preserving decomposition plus guardrails and generated-launcher workflow cleanup. This task tracked decomposition of historically oversized/high-coupling core files (`src/main.ts`, `src/anki-integration.ts`, `src/config/service.ts`, `src/core/services/immersion-tracker-service.ts`) plus launcher generated-artifact workflow guardrails and verification.
<!-- SECTION:DESCRIPTION:END --> <!-- SECTION:DESCRIPTION:END -->
## Suggestions ## Suggestions
@@ -54,28 +54,58 @@ Several core files are oversized and high-coupling (`src/main.ts`, `src/anki-int
## Acceptance Criteria ## Acceptance Criteria
<!-- AC:BEGIN --> <!-- AC:BEGIN -->
- [ ] #1 `src/main.ts` reduced to orchestration-focused module with extracted runtime domains - [x] #1 `src/main.ts` reduced to orchestration-focused module with extracted runtime domains
- [x] #2 `src/anki-integration.ts` reduced to facade with helper collaborators - [x] #2 `src/anki-integration.ts` reduced to facade with helper collaborators
- [x] #3 Config and immersion tracker services decomposed without behavior regressions - [x] #3 Config and immersion tracker services decomposed without behavior regressions
- [ ] #4 `subminer` generated artifact ownership/workflow documented and enforced - [x] #4 `subminer` generated artifact ownership/workflow documented and enforced
- [x] #5 Full build + config/core tests pass after refactor - [x] #5 Full build + config/core tests pass after refactor
<!-- AC:END --> <!-- AC:END -->
## Implementation Notes ## Implementation Notes
<!-- SECTION:NOTES:BEGIN --> <!-- SECTION:NOTES:BEGIN -->
TASK-95 completion slice evidence: decomposed hotspot collaborators and reduced LOC across all remaining core hotspots. TASK-95 completion slice evidence: decomposed three non-main hotspots and reduced LOC in each targeted file.
TASK-95 LOC deltas: `src/anki-integration.ts` -407 (1722 -> 1315), `src/config/service.ts` -1492 (1591 -> 99), `src/core/services/immersion-tracker-service.ts` -361 (1470 -> 1109). TASK-95 LOC deltas: `src/anki-integration.ts` -407 (1722 -> 1315), `src/config/service.ts` -1492 (1591 -> 99), `src/core/services/immersion-tracker-service.ts` -361 (1470 -> 1109).
TASK-95 extracted collaborators: `src/anki-integration/field-grouping-merge.ts`, `src/config/{load.ts,parse.ts,warnings.ts,resolve.ts}`, `src/core/services/immersion-tracker/{types.ts,reducer.ts,queue.ts,maintenance.ts,query.ts}`. TASK-95 extracted collaborators: `src/anki-integration/field-grouping-merge.ts`, `src/config/{load.ts,parse.ts,warnings.ts,resolve.ts}`, `src/core/services/immersion-tracker/{types.ts,reducer.ts,queue.ts,maintenance.ts,query.ts}`.
TASK-95 verification evidence: `bun run build`, `bun run test:config:dist`, `bun run test:core:dist`, `bun run check:file-budgets` completed with no failing tests. TASK-95 verification evidence: `bun run build`, `bun run test:config:dist`, `bun run test:core:dist`, `bun run check:file-budgets` completed with no failing tests.
2026-02-21 finalization evidence: `src/main.ts` currently 2878 LOC; runtime fan-in guard passes at 85 import lines / 10 unique runtime paths (`bun run check:main-fanin`).
Main-entrypoint scope validation for this task is fan-in/orchestration behavior, not absolute LOC target.
Launcher generated artifact workflow now strictly enforced end-to-end: `scripts/verify-generated-launcher.sh` fails on stale repo-root `./subminer`; CI and release workflows verify `dist/launcher/subminer` and run the verifier script; release checksum/upload paths updated to `dist/launcher/subminer`.
Docs policy updated in `docs/development.md` and `docs/installation.md` to state repo-root `./subminer` is stale/unsupported and generated path must be `dist/launcher/subminer`.
Final verification gate passed: `bun run build && bun run test:config:dist && bun run test:core:dist && bun run check:file-budgets && bun run check:main-fanin`.
TASK-85 AC/DoD ownership map:
- AC#1 (`src/main.ts` orchestration-focused runtime domains): `TASK-94` (primary), `TASK-71` (supporting predecessor)
- AC#2 (`src/anki-integration.ts` facade + collaborators): `TASK-95`
- AC#3 (config + immersion decomposition with no regressions): `TASK-95`
- AC#4 (generated launcher ownership/workflow documented + enforced): `TASK-85` parent finalization evidence
- AC#5 (full build + config/core tests pass): shared verification evidence in `TASK-95`, `TASK-94`, and final TASK-85 gate
- DoD#1 (plan executed/decomposed): `TASK-94` + `TASK-95`
- DoD#2 (regression coverage for extracted seams): `TASK-94` + `TASK-95`
- DoD#3 (docs updated): `TASK-71` architecture docs + `TASK-85` launcher workflow docs
Remaining Scope (ordered):
1. Execution scope: none (all TASK-85 AC/DoD complete).
2. Process hygiene: TASK-93 closure synchronization and provenance note alignment.
<!-- SECTION:NOTES:END --> <!-- SECTION:NOTES:END -->
## Final Summary
<!-- SECTION:FINAL_SUMMARY:BEGIN -->
Closed remaining TASK-85 scope by enforcing generated launcher ownership (`dist/launcher/subminer`) across local verification, CI, release packaging/checksums, and contributor docs. Revalidated refactor integrity with full build + config/core test gates plus maintainability guardrails (`check:file-budgets`, `check:main-fanin`) and marked parent AC/DoD complete.
<!-- SECTION:FINAL_SUMMARY:END -->
## Definition of Done ## Definition of Done
<!-- DOD:BEGIN --> <!-- DOD:BEGIN -->
- [ ] #1 Plan at `docs/plans/2026-02-19-repo-maintainability-refactor-plan.md` executed or decomposed into child tasks - [x] #1 Plan at `docs/plans/2026-02-19-repo-maintainability-refactor-plan.md` executed or decomposed into child tasks
- [x] #2 Regression coverage added for extracted seams - [x] #2 Regression coverage added for extracted seams
- [ ] #3 Docs updated for architecture and contributor workflow changes - [x] #3 Docs updated for architecture and contributor workflow changes
<!-- DOD:END --> <!-- DOD:END -->

View File

@@ -1,10 +1,10 @@
--- ---
id: TASK-93 id: TASK-93
title: Synchronize TASK-85 closure tracking and child-task status title: Synchronize TASK-85 closure tracking and child-task status
status: To Do status: Done
assignee: [] assignee: []
created_date: '2026-02-20 12:06' created_date: '2026-02-20 12:06'
updated_date: '2026-02-20 12:06' updated_date: '2026-02-21 07:11'
labels: labels:
- process - process
- refactor - refactor
@@ -33,14 +33,37 @@ priority: high
## Acceptance Criteria ## Acceptance Criteria
<!-- AC:BEGIN --> <!-- AC:BEGIN -->
- [ ] #1 `TASK-85` status metadata and updated date reflect latest reality. - [x] #1 `TASK-85` status metadata and updated date reflect latest reality.
- [ ] #2 Each unresolved `TASK-85` AC/DoD item has explicit owning child ticket(s). - [x] #2 Each unresolved `TASK-85` AC/DoD item has explicit owning child ticket(s).
- [ ] #3 `TASK-85` has a clear, ordered “Remaining Scope” list with next execution order. - [x] #3 `TASK-85` has a clear, ordered “Remaining Scope” list with next execution order.
- [ ] #4 No stale or contradictory progress statements remain in `TASK-85`. - [x] #4 No stale or contradictory progress statements remain in `TASK-85`.
<!-- AC:END --> <!-- AC:END -->
## Implementation Notes
<!-- SECTION:NOTES:BEGIN -->
Synchronized TASK-85 closure tracking against current child-task outcomes and finalization evidence.
Updates applied to TASK-85:
- Normalized description wording to historical/closure framing so parent status and narrative are aligned.
- Added explicit AC/DoD ownership map linking completed slices to child tasks (`TASK-94`, `TASK-95`) and supporting context (`TASK-71`) plus parent-owned closure evidence.
- Added clear ordered Remaining Scope list showing execution scope is complete and only process-hygiene tracking remained.
- Clarified `src/main.ts` closure signal for TASK-85 (fan-in/orchestration validation) to avoid LOC-only ambiguity.
Post-update validation:
- TASK-85 metadata shows `Status: Done` with updated timestamp.
- No stale contradictory progress statements observed in TASK-85 notes.
- Child-ticket mapping for pending/remaining items is explicit (execution: none remaining).
<!-- SECTION:NOTES:END -->
## Final Summary
<!-- SECTION:FINAL_SUMMARY:BEGIN -->
Completed TASK-93 by normalizing TASK-85 closure metadata and progress narrative, adding explicit AC/DoD child-task ownership mapping, and recording an ordered remaining-scope list with no execution scope left. TASK-85 now reads as a consistent source-of-truth for completed vs pending work, and TASK-93 is closed.
<!-- SECTION:FINAL_SUMMARY:END -->
## Definition of Done ## Definition of Done
<!-- DOD:BEGIN --> <!-- DOD:BEGIN -->
- [ ] #1 `TASK-85` reads as a reliable source-of-truth for what is done vs pending. - [x] #1 `TASK-85` reads as a reliable source-of-truth for what is done vs pending.
- [ ] #2 Child-ticket mapping for pending work is complete and unambiguous. - [x] #2 Child-ticket mapping for pending work is complete and unambiguous.
<!-- DOD:END --> <!-- DOD:END -->

View File

@@ -40,6 +40,7 @@ make build-macos-unsigned # macOS DMG + ZIP (unsigned)
- Source of truth: `launcher/*.ts` - Source of truth: `launcher/*.ts`
- Generated output: `dist/launcher/subminer` - Generated output: `dist/launcher/subminer`
- Do not hand-edit generated launcher output. - Do not hand-edit generated launcher output.
- Repo-root `./subminer` is a stale artifact path and is rejected by verification checks.
- Install targets (`make install-linux`, `make install-macos`) copy from `dist/launcher/subminer`. - Install targets (`make install-linux`, `make install-macos`) copy from `dist/launcher/subminer`.
Verify the workflow: Verify the workflow:

View File

@@ -65,6 +65,7 @@ make install
``` ```
`make build-launcher` generates the wrapper at `dist/launcher/subminer`. The checked-in launcher source remains `launcher/*.ts`. `make build-launcher` generates the wrapper at `dist/launcher/subminer`. The checked-in launcher source remains `launcher/*.ts`.
Do not use a repo-root `./subminer` artifact when building from source; workflow checks enforce `dist/launcher/subminer` as the only generated path.
## macOS ## macOS

View File

@@ -32,3 +32,6 @@ Read first. Keep concise.
| `codex-task95-anki-20260221T031836Z-6f3e` | `codex-task95-anki` | `Implement TASK-95 anki-integration extraction for field-grouping merge collaborator` | `done` | `docs/subagents/agents/codex-task95-anki-20260221T031836Z-6f3e.md` | `2026-02-21T03:26:55Z` | | `codex-task95-anki-20260221T031836Z-6f3e` | `codex-task95-anki` | `Implement TASK-95 anki-integration extraction for field-grouping merge collaborator` | `done` | `docs/subagents/agents/codex-task95-anki-20260221T031836Z-6f3e.md` | `2026-02-21T03:26:55Z` |
| `opencode-task-94-20260221T033647Z-7ou2` | `opencode-task-94` | `Finish TASK-94 thin composition root refactor and close acceptance criteria` | `done` | `docs/subagents/agents/opencode-task-94-20260221T033647Z-7ou2.md` | `2026-02-21T04:12:45Z` | | `opencode-task-94-20260221T033647Z-7ou2` | `opencode-task-94` | `Finish TASK-94 thin composition root refactor and close acceptance criteria` | `done` | `docs/subagents/agents/opencode-task-94-20260221T033647Z-7ou2.md` | `2026-02-21T04:12:45Z` |
| `codex-task71-round2-20260221T043541Z-k9t3` | `codex-task71-round2` | `Execute TASK-71 round 2 split of main.ts into domain runtime modules` | `done` | `docs/subagents/agents/codex-task71-round2-20260221T043541Z-k9t3.md` | `2026-02-21T04:57:00Z` | | `codex-task71-round2-20260221T043541Z-k9t3` | `codex-task71-round2` | `Execute TASK-71 round 2 split of main.ts into domain runtime modules` | `done` | `docs/subagents/agents/codex-task71-round2-20260221T043541Z-k9t3.md` | `2026-02-21T04:57:00Z` |
| `codex-task85-20260221T051308Z-164g` | `codex-task85-exec` | `Execute TASK-85 remaining AC/DoD with writing-plans and executing-plans flow` | `done` | `docs/subagents/agents/codex-task85-20260221T051308Z-164g.md` | `2026-02-21T05:45:50Z` |
| `codex-review-refactor-20260221T062353Z-p6k2` | `codex-review-refactor` | `Perform code review for current refactor changes and report actionable findings` | `done` | `docs/subagents/agents/codex-review-refactor-20260221T062353Z-p6k2.md` | `2026-02-21T06:25:27Z` |
| `opencode-task93-sync-20260221T070842Z-71c6` | `opencode-task93-sync` | `Synchronize TASK-85 closure tracking and child-task status in Backlog` | `done` | `docs/subagents/agents/opencode-task93-sync-20260221T070842Z-71c6.md` | `2026-02-21T07:11:58Z` |

View File

@@ -0,0 +1,34 @@
# Agent: `codex-review-refactor-20260221T062353Z-p6k2`
- alias: `codex-review-refactor`
- mission: `Review current refactor diff; report correctness/regression/test gaps`
- status: `done`
- branch: `main`
- started_at: `2026-02-21T06:23:53Z`
- heartbeat_minutes: `5`
## Current Work (newest first)
- [2026-02-21T06:25:27Z] handoff: review complete; no blocking/important defects found in refactor + launcher-workflow enforcement diff; targeted guardrails/tests passed.
- [2026-02-21T06:25:27Z] test: `bun run check:main-fanin` and `bun run test:core:dist` passed on current tree.
- [2026-02-21T06:24:30Z] progress: audited diffs in `.github/workflows/{ci,release}.yml`, `scripts/verify-generated-launcher.sh`, docs/task updates; validated launcher verifier behavior.
- [2026-02-21T06:23:53Z] intent: open refactor diff; audit behavior changes; run targeted tests; return severity-ranked findings.
## Files Touched
- `docs/subagents/INDEX.md`
- `docs/subagents/agents/codex-review-refactor-20260221T062353Z-p6k2.md`
- `.github/workflows/ci.yml` (reviewed)
- `.github/workflows/release.yml` (reviewed)
- `scripts/verify-generated-launcher.sh` (reviewed)
- `docs/development.md` (reviewed)
- `docs/installation.md` (reviewed)
- `backlog/tasks/task-85 - Refactor-large-files-for-maintainability-and-readability.md` (reviewed)
## Assumptions
- User asks for review only; no code changes requested.
- Review target is current working tree refactor deltas on `main`.
## Open Questions / Blockers
- None.
## Next Step
- Await user direction (fixes optional; no required corrections identified).

View File

@@ -0,0 +1,36 @@
# Agent: codex-task85-20260221T051308Z-164g
- alias: codex-task85-exec
- mission: Execute TASK-85 remaining AC/DoD with writing-plans then executing-plans flow (no commit)
- status: done
- branch: main
- started_at: 2026-02-21T05:13:08Z
- heartbeat_minutes: 5
## Current Work (newest first)
- [2026-02-21T05:45:50Z] completed: executed TASK-85 finalization plan end-to-end (no commit); enforced generated launcher policy in verifier + CI/release workflows, updated docs, ran full gates, and finalized TASK-85 to `Done` via Backlog MCP.
- [2026-02-21T05:45:50Z] test: `make build-launcher && bash scripts/verify-generated-launcher.sh` pass after removing stale repo-root `./subminer`; full gate pass: `bun run build && bun run test:config:dist && bun run test:core:dist && bun run check:file-budgets && bun run check:main-fanin`.
- [2026-02-21T05:13:08Z] intent: load backlog TASK-85 context, produce execution plan via writing-plans skill, then execute via executing-plans skill using parallel subagents where independent.
- [2026-02-21T05:13:08Z] planned files: `src/main.ts`, `src/main/runtime/**`, `docs/development.md`, `docs/installation.md`, `scripts/verify-generated-launcher.sh`, `backlog/tasks/task-85 - Refactor-large-files-for-maintainability-and-readability.md`, `docs/plans/**`.
- [2026-02-21T05:13:08Z] assumptions: Backlog initialized (`backlog/` exists) and TASK-85 remains active with AC #1/#4 + DoD #1/#3 open.
## Files Touched
- `docs/subagents/agents/codex-task85-20260221T051308Z-164g.md`
- `docs/subagents/INDEX.md`
- `docs/subagents/collaboration.md`
- `docs/plans/2026-02-21-task85-finalization-plan.md`
- `scripts/verify-generated-launcher.sh`
- `.github/workflows/ci.yml`
- `.github/workflows/release.yml`
- `docs/development.md`
- `docs/installation.md`
## Open Questions / Blockers
- none
## Next Step
- handoff complete; await user direction (optional commit/PR).

View File

@@ -0,0 +1,40 @@
# Agent Session: opencode-task93-sync-20260221T070842Z-71c6
- alias: `opencode-task93-sync`
- mission: `Synchronize TASK-85 closure tracking and child-task status in Backlog`
- status: `done`
- started_utc: `2026-02-21T07:08:42Z`
- completed_utc: `2026-02-21T07:11:58Z`
- backlog_task: `TASK-93`
## Intent
- Load TASK-93 + TASK-85 + related child tasks from Backlog MCP.
- Build execution plan via writing-plans skill.
- Execute plan via executing-plans skill.
- Update Backlog task metadata/notes/checklists to satisfy TASK-93 AC.
## Planned Files/Surfaces
- `backlog/tasks/task-93 - Synchronize-TASK-85-closure-tracking-and-child-task-status.md` (via MCP)
- `backlog/tasks/task-85 - Refactor-large-files-for-maintainability-and-readability.md` (via MCP)
- Child task tickets linked to TASK-85 (via MCP)
- `docs/subagents/INDEX.md` (own row only)
- `docs/subagents/collaboration.md` (append-only note)
## Assumptions
- Backlog already initialized (folder exists).
- TASK-85 was recently marked Done and needs consistency cleanup.
## Heartbeat Log
- `2026-02-21T07:08:42Z` session started; reading backlog + planning context.
- `2026-02-21T07:11:58Z` execution complete; TASK-85 synchronized and TASK-93 finalized Done.
## Outcome
- Created plan: `docs/plans/2026-02-21-task-93-sync-task85-closure-plan.md`.
- Updated `TASK-85` description + implementation notes with child ownership map and ordered remaining scope.
- Updated `TASK-93` implementation notes, checked all AC/DoD items, set final summary, marked status Done.
- No product-code changes; backlog/process/documentation surfaces only.

View File

@@ -31,3 +31,7 @@ Shared notes. Append-only.
- [2026-02-21T04:12:45Z] [opencode-task-94-20260221T033647Z-7ou2|opencode-task-94] TASK-94 finalized in Backlog MCP: AC checklist complete, notes+final summary recorded, status moved to Done. - [2026-02-21T04:12:45Z] [opencode-task-94-20260221T033647Z-7ou2|opencode-task-94] TASK-94 finalized in Backlog MCP: AC checklist complete, notes+final summary recorded, status moved to Done.
- [2026-02-21T04:35:41Z] [codex-task71-round2-20260221T043541Z-k9t3|codex-task71-round2] overlap note: starting TASK-71 round 2 follow-up on `src/main.ts` + `src/main/runtime/composers/*` + docs; preserving prior TASK-94/TASK-95 edits. - [2026-02-21T04:35:41Z] [codex-task71-round2-20260221T043541Z-k9t3|codex-task71-round2] overlap note: starting TASK-71 round 2 follow-up on `src/main.ts` + `src/main/runtime/composers/*` + docs; preserving prior TASK-94/TASK-95 edits.
- [2026-02-21T04:57:00Z] [codex-task71-round2-20260221T043541Z-k9t3|codex-task71-round2] completed TASK-71: extracted AniList tracking + MPV runtime composition into new composers, added seam tests, rewired `main.ts` + composer barrel, strict fan-in green, and finalized Backlog task as Done. - [2026-02-21T04:57:00Z] [codex-task71-round2-20260221T043541Z-k9t3|codex-task71-round2] completed TASK-71: extracted AniList tracking + MPV runtime composition into new composers, added seam tests, rewired `main.ts` + composer barrel, strict fan-in green, and finalized Backlog task as Done.
- [2026-02-21T05:13:08Z] [codex-task85-20260221T051308Z-164g|codex-task85-exec] starting TASK-85 execution pass: load backlog task context, generate plan via writing-plans, execute via executing-plans, no commit.
- [2026-02-21T05:45:50Z] [codex-task85-20260221T051308Z-164g|codex-task85-exec] completed TASK-85 pass: enforced launcher generated-artifact workflow across verifier + CI/release + docs, ran full build/test/guardrails, and finalized TASK-85 status to Done in Backlog MCP.
- [2026-02-21T07:08:42Z] [opencode-task93-sync-20260221T070842Z-71c6|opencode-task93-sync] starting TASK-93 backlog synchronization pass: align TASK-85 closure tracking, AC/DoD mapping, and child-task ownership; backlog-only edits expected.
- [2026-02-21T07:11:58Z] [opencode-task93-sync-20260221T070842Z-71c6|opencode-task93-sync] completed TASK-93: updated TASK-85 description/notes with explicit AC/DoD ownership + remaining-scope order; finalized TASK-93 AC/DoD and status Done.

View File

@@ -5,34 +5,36 @@ REPO_ROOT="$(cd "$(dirname "${BASH_SOURCE[0]}")/.." && pwd)"
LAUNCHER_OUT="$REPO_ROOT/dist/launcher/subminer" LAUNCHER_OUT="$REPO_ROOT/dist/launcher/subminer"
if [[ ! -f "$REPO_ROOT/launcher/main.ts" ]]; then if [[ ! -f "$REPO_ROOT/launcher/main.ts" ]]; then
echo "[FAIL] launcher source missing: launcher/main.ts" echo "[FAIL] launcher source missing: launcher/main.ts"
exit 1 exit 1
fi fi
if ! rg -n --fixed-strings -- "--outfile=\"\$(LAUNCHER_OUT)\"" "$REPO_ROOT/Makefile" >/dev/null; then if ! rg -n --fixed-strings -- "--outfile=\"\$(LAUNCHER_OUT)\"" "$REPO_ROOT/Makefile" >/dev/null; then
echo "[FAIL] Makefile build-launcher target is not writing to dist/launcher/subminer" echo "[FAIL] Makefile build-launcher target is not writing to dist/launcher/subminer"
exit 1 exit 1
fi fi
if [[ ! -f "$LAUNCHER_OUT" ]]; then if [[ ! -f "$LAUNCHER_OUT" ]]; then
echo "[FAIL] generated launcher not found at dist/launcher/subminer" echo "[FAIL] generated launcher not found at dist/launcher/subminer"
echo " run: make build-launcher" echo " run: make build-launcher"
exit 1 exit 1
fi fi
if [[ ! -x "$LAUNCHER_OUT" ]]; then if [[ ! -x "$LAUNCHER_OUT" ]]; then
echo "[FAIL] generated launcher is not executable: dist/launcher/subminer" echo "[FAIL] generated launcher is not executable: dist/launcher/subminer"
exit 1 exit 1
fi fi
if [[ -f "$REPO_ROOT/subminer" ]]; then if [[ -f "$REPO_ROOT/subminer" ]]; then
echo "[WARN] stale repo-root launcher artifact found: ./subminer" echo "[FAIL] stale repo-root launcher artifact found: ./subminer"
echo " expected generated location: dist/launcher/subminer" echo " expected generated location: dist/launcher/subminer"
echo " remove stale artifact and use: make build-launcher"
exit 1
fi fi
if git -C "$REPO_ROOT" ls-files --error-unmatch dist/launcher/subminer >/dev/null 2>&1; then if git -C "$REPO_ROOT" ls-files --error-unmatch dist/launcher/subminer >/dev/null 2>&1; then
echo "[FAIL] dist/launcher/subminer is tracked by git; generated artifacts must remain untracked" echo "[FAIL] dist/launcher/subminer is tracked by git; generated artifacts must remain untracked"
exit 1 exit 1
fi fi
echo "[OK] launcher workflow verified" echo "[OK] launcher workflow verified"