Skip to content

feat(zcode): persist clone-launch console output to tools/logs transcripts - #21

Merged
fotedev merged 1 commit into
mainfrom
fix/zcode-launch-logs
Nov 3, 2026
Merged

fotedev merged 1 commit into
mainfrom
fix/zcode-launch-logs

Conversation

@fotedev

@fotedev fotedev commented Nov 3, 2026 •

Copy link
Copy Markdown
Owner

Problem

GHOST.bat ZCode [1]-[6] open launcher windows that close automatically when done (by design - start "title" powershell with no redirect, no pause), and the Desktop/Start-menu shortcuts run the same script with -WindowStyle Hidden (no console at all). launch_zcode_second_instance.ps1 wrote zero log files, so the ram-guard question/answer, seed/telegram/sync step results, spawn PID and taskbar stamping were unreviewable after the fact. The only trace of a Launch ALL round was the child sync_zcode_assets.log.

Fix

  • launch_zcode_second_instance.ps1: appends every run to tools\logs\launch_zcode_<Instance>.log via Start-Transcript -Append -IncludeInvocationHeader right after = 'Stop'. One file per instance so the five parallel launchers never interleave. Fully best-effort: the whole setup sits in try/catch (a transcript failure prints a yellow warning and never blocks the launch), and Stop-Transcript (also try/catch) runs before both ram-guard exit 0 paths and at script end. No re-indentation of the body; PS 5.1 safe. Hidden shortcut launches benefit automatically.
  • GHOST.bat (gid 18, Launch ALL): one echo line after opening the five windows pointing at the logs.
  • CHANGELOG.md: Unreleased/Added entry.

Verification

  • Parser::ParseFile → PARSE_OK; all 808 lines CRLF intact.
  • Committed harness tests/repo-integrity.Tests.ps1 → 11/11 passed.
  • Runtime smoke of the exact gid-18 block (GH_SEQ env-feeder test copy, start/pause/timeout stubbed, pure CRLF): all five :StartClone calls executed with correct args, the new log-path echo printed, zero CMD errors, exit 0.
  • Safe live run (-Instance Sixth while Orange was running → already-running guard path, no new app spawn): launcher exit 0 and tools/logs/launch_zcode_Sixth.log contains the transcript header, every console line (ram-guard, seed, sync, watchers, launch env, taskbar stamp/kick) and the transcript footer.

Notes

  • Log files are gitignored (tools/logs/) - test artifacts did not enter the commit.
  • Branch built in an isolated worktree; the main working tree (another agent's in-progress AutoClaw2 work) is untouched.

Summary by CodeRabbit

  • New Features
    • ZCode clone launches now save append-only logs for each instance, including launch details. If logging cannot be started, the launcher displays a warning.
    • After opening all five clones, the launcher displays where to find the logs and their filename pattern.

…ripts

The launcher windows opened by GHOST.bat ZCode [1]-[6] close automatically
when done, and the Desktop/Start-menu shortcuts run the same script with
-WindowStyle Hidden - so the ram-guard exchange, seed/telegram/sync steps,
spawn PID and taskbar stamping were unreviewable after the fact.

launch_zcode_second_instance.ps1 now appends every run to
tools/logs/launch_zcode_<Instance>.log via Start-Transcript (one file per
instance so the five parallel launchers never interleave; -Append +
-IncludeInvocationHeader). Setup and teardown are best-effort: transcript
failure prints a yellow warning and never blocks the launch, and
Stop-Transcript runs before the ram-guard exit-0 paths and at script end.
GHOST.bat ZCode [6] prints the log location after opening the windows.
@coderabbitai

coderabbitai Bot commented Nov 3, 2026 •

Copy link
Copy Markdown

Review in Change Stack →

No actionable comments were generated in the recent review.

Walkthrough

The ZCode launcher now appends each run to an instance-specific transcript log under tools\logs. It handles transcript startup and shutdown failures without blocking the launch, stops transcripts on RAM-guard cancellation and at script end, and reports the log location when launching all clones.

Changes: ZCode launch logging

Layer / File(s) Summary
Transcript logging lifecycle
src/windows/launch_zcode_second_instance.ps1
The launcher creates or appends to a per-instance transcript log. Startup failures produce a warning, and shutdown failures are suppressed. The launcher stops the transcript on RAM-guard cancellation and at script end.
All-clones log location notice
GHOST.bat, CHANGELOG.md
The all-clones dispatch prints the per-clone log location. The changelog describes the transcript logging and cleanup behavior.

Estimated code review effort: 2 (Simple) | ~10 minutes

Change: Feature

Possibly related PRs

  • fotedev/ghost#20: Adds the RAM-guard prompt and hidden-console exit paths that this change updates to stop transcript logging before cancellation exits.
Merge Risk: Minimal · up to 900bf

The launcher adds best-effort per-instance transcripts without an established merge-blocking issue. Normal checks remain appropriate before merging.

Pre-merge checks: Passed 5
Check name Status Explanation
Description Check Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check Passed The title clearly and concisely describes the main change: persisting ZCode clone-launch console output to transcripts in tools/logs.
Docstring Coverage Passed No eligible functions found in the changed files. Skipping docstring coverage check. Docstring coverage is scoped to functions touched by this diff with cyclomatic complexity of at least 2. Documentat…
Linked Issues check Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check Passed Check skipped because no linked issues were found for this pull request.
Full details: Docstring Coverage

Explanation

No eligible functions found in the changed files. Skipping docstring coverage check. Docstring coverage is scoped to functions touched by this diff with cyclomatic complexity of at least 2. Documentation-only edits and deletions within surviving functions are included; unchanged diff context and fully deleted functions are excluded. Analyzed 0 functions across 0 files. (3 skipped: 3 unsupported.)

Finishing Touches
Generate unit tests (beta)
  • Commit to this branch
  • Create a new PR

Tip

🎯 Customize your risk assessments

Guide how CodeRabbit assesses merge risk and security architecture risk. Highlight sensitive changes and explain your security boundaries using Merge Risk Instructions and Security Risk Instructions in your review settings. Security architecture risk assessments require the Advanced plan or above.

✅ Automatic approvals, with your rules

Let CodeRabbit approve pull requests once required threads are resolved, pre-merge checks pass, and your risk limits are met. Enable Automatic approvals in review settings, with overrides for teams or file paths.

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

Share

CodeRabbit Verify

  • Run CodeRabbit Verify to test the changes in this pull request.
Recent review info
Run configuration
  • Source mode: Auto
  • Repository: Unavailable
  • Branch: Unavailable
  • File: No configuration file from this repository applied
  • Commit: Unavailable
  • Layers: defaults
  • Review profile: CHILL
  • Plan: Advanced
  • Run ID: bf951e2e-e2f1-4b78-b886-d314396adcb0
Commits

Reviewing files that changed from the base of the PR and between 7bf11ed and 900bf89.

Files selected for processing: 3
  • CHANGELOG.md
  • GHOST.bat
  • src/windows/launch_zcode_second_instance.ps1

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

@fotedev
fotedev merged commit ab226c9 into main Nov 3, 2026
4 checks passed
@fotedev
fotedev deleted the fix/zcode-launch-logs branch November 3, 2026 00:53
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.

1 participant