logs.gokuls.in

3 pull requests merged across 2 repos

Offline-Protocol/offline-protocol-sdk

Moves every install pin from 0.31.0 to 0.32.0 ahead of the v0.32.0 tag: the README install table and its Swift and Android snippets, the Java and Python binding READMEs, the service image README, and the C# \LibraryVersion\ doc example (which still said 0.31.0 after #700).

Same scope as #642 for 0.31.0, plus the C# line. Run logs in docs/bridges/kotlin-devices.md and the rc example in docs/bridges/ruby.md name 0.31.0 as history and stay.

bahdotsh/wrkflw

Fixes the findings from the principal review of #163. That review asked for changes on three points: kept workspaces trusted a directory the job can write to, the log redactor had gaps, and the TUI's event-driven job state was wrong for batched matrix legs and skipped jobs. This PR fixes those and nearly all the other findings. Each commit covers one area and passes fmt and clippy on its own.

Checkout sync and workspaces

  • Symlinks are never followed. A step that replaced a directory or .git in its kept workspace with a symlink made the next checkout prune the link's target on the host. A symlink at a file made the copy write through it. The sync now removes whatever non-directory sits where a directory belongs, and never trusts a symlink as an up-to-date copy.
  • Tracked files always reach the workspace, as in a clone, even where .gitignore or the user's global excludes match them. The tracked set comes from git ls-files. Untracked files inside an ignored directory stay out. Without git, the old rules apply.
  • Hidden files the repository deleted are removed when git tracked them at the last sync. Untracked tool state such as .pytest_cache still stays.
  • .git/config is mirrored without core.hooksPath, core.fsmonitor and core.worktree, which would run host programs or point outside the workspace.
  • Callers of one reusable workflow get their own workspaces. The key includes the calling job; other keys are unchanged, so existing workspaces stay valid.
  • WRKFLW_WORKSPACES_DIR is made absolute. clean reports an unreadable root as an error. The "in use" message also names wrkflw clean.

Secrets in logs and live output

  • The log masker is scoped to runs. It starts empty when a run starts while no other run is going, and keeps values until then. In the TUI, an ::add-mask::main no longer masks every later "main" in the session.
  • Docker, Podman and Kubernetes commands are masked before {:?} formatting, and the environment is logged by name only. Debug escaping hid secrets containing " or \ from the redactor.
  • Credential-like names match by word end (APIKEY, DB_PASS), so AUTHOR=main no longer counts. If the redactor can't be installed, the log says so.
  • The sandbox and secure-emulation scripts log at debug level, as emulation already does.
  • Live output: stdout and stderr keep separate partial lines. Lines are sent under the buffer lock, so observers see them in order. An overflowing workflow command is held to its newline even after a redraw, so the end of an ::add-mask:: value no longer streams. A value too long to collect registers no prefix. Blank lines are kept, and long redrawn lines are cut at a redraw.
  • A partial UTF-8 character after an invalid byte is kept for the next read.

Executor events

  • Skipped jobs emit job_started and job_finished (status skipped). This covers skips by if:, a failed needs job, fail-fast, GitLab rules and gate: false. History merges these with the result as before.
  • Folded matrix legs are matched to results by position, so legs with duplicate names no longer swap results. A folded leg whose original was skipped says so.

TUI

  • A matrix job stays running until every leg has ended, including between max-parallel batches. The UI compares against the matrix size from the workflow when a matrix isn't built from an expression.
  • The graph and header follow the running workflow, as the Jobs and Log views do. ↑↓ browse other workflows' graphs once the run ends.
  • The Jobs cursor stays on its job when the result reorders the pane.
  • Late output no longer makes a finished job look running.
  • The Output pane says how many earlier lines it isn't showing.
  • Failure tail lines are capped at 4096 bytes.
  • Durations round instead of truncating, so 59m 59.9s reads 1h 00m. A finished run reads took 3.9s, matching its steps.
  • Help no longer overflows on terminals wider than 7,281 columns. Two dead helpers are removed.

CLI and docs

  • The executor reads env switches exactly as clap does, without trimming. The agreement test now covers spaces, case and unknown values.
  • clean --format json includes schema_version and type: "clean", reports a failure as {"type": "error"}, and handles non-UTF-8 paths. human_bytes no longer prints 1024.0 KB.
  • README and AGENTS.md cover the new sync rules, run-scoped masking, the matrix fold's blind spot for scripts outside the workflow, and the new skipped-job events.

Behavior changes to note

  • OutputTap::new and OutputTap::send take a Stream (stdout or stderr), and live_output::send does too.
  • NDJSON gains job_started and job_finished lines for skipped jobs.
  • clean --format json gains schema_version and type.
  • WRKFLW_FRESH_WORKSPACE=" 0" and other values with spaces now count as on in the executor too, matching the CLI.
  • WorkflowExecution::live_job_state and unfinished_jobs in wrkflw-ui take the known matrix sizes.

Not changed

  • Hard-linked .git/objects still share inodes with the repository. README now says a step writing there directly changes the repository's files.
  • clean still holds a workspace's lock while it deletes. Only the message a waiting run logs changed.
  • Pre-existing gaps that #163 didn't touch: secrets under 3 characters are not masked, container.env and services.*.env are not scanned for secrets, and full step output is buffered in memory without a cap.
  • Not addressed: modal backdrop contrast over lit buttons, path canonicalisation in refresh_runs, the env-mutating CLI test, and Windows-only or Docker-only tests.

Testing

  • cargo test --workspace --all-features: 1,563 passed, 0 failed.
  • cargo clippy --workspace --all-features --all-targets -- -D warnings is clean on every commit.
  • cargo fmt --check and cargo check --no-default-features --workspace are clean.
  • New tests cover:
  • symlinks planted at a directory, at .git and at a file
  • tracked-but-ignored files with a real git index, removal of tracked dotfiles, and the git config filter
  • relative workspace roots, unreadable clean roots, and reusable-workflow keys
  • run-scoped masking, Debug-escaped secrets, and word-end name matching
  • live output: stream separation, blank lines, redraw cuts, held and truncated commands, and long lookalike lines
  • skipped-job events and the skipped-original fold note
  • batched matrix state, cursor re-anchoring, late tails, earlier-line counts and capped failure lines
  • duration rounding at every unit boundary, including u64::MAX
  • clean end to end through the binary, and reading pre-#163 history records

A design pass over the TUI turned up one security bug, one broken feature, and a set of polish issues. This PR fixes all of them, then uses the executor's existing event stream to make the run easier to follow.

Secrets no longer reach the logs

  • The emulation runtime logged every environment variable value at info level. Docker and Podman log the environment at debug level. The TUI keeps every level, so secret values showed up in the Logs tab, and --verbose printed them to the console.
  • wrkflw_logging now has a one-time redaction hook. The executor installs a process-wide masker and registers every secret, --variable value and ::add-mask:: value as a run resolves it.
  • The emulation runtime now logs variable names only. Its diagnostics moved to debug level.
  • On-disk run history was unaffected, because it only stores masked step output.

Fixes

  • Run selection. r ("Run selected") ignored the checkboxes. It now runs every checked workflow in list order, or the highlighted one when nothing is checked. Enter no longer ticks a checkbox as a side effect.
  • List movement. Lists stop at the ends instead of wrapping. Home and End jump to the first or last row on Workflows, DAG, Execution and Runs.
  • Naming. The Workflows card "Trigger filter" is now "Diff filter", so it no longer clashes with the Trigger tab. Tab 6 is now "Setup", with the runtime picker above the secret providers.
  • Copy. Removed the stale "Press 'Enter' to start" message and the --verbose hint inside the TUI.
  • Glyph. ◼ replaces the double-width ⛔ that misaligned the Runs table. A test now checks that every status symbol is one cell wide.
  • Execution header. It now reads "started 12:21:31 · took 3s", or "running 11s" while live.
  • Modals. Tweaks and Help open as centered modals over a muted backdrop, built on a shared helper. Tweaks no longer straddles panel borders.

Character

  • Story view in Logs. RunOptions takes extra observers, and the TUI subscribes to the masked ExecutionEvent stream. By default the Logs tab shows each job and step with its time, exit code and the step's own failure output. o switches to the raw log. Debug lines are hidden unless the TUI starts with --verbose. A two-workflow run went from 291 raw lines to 16.
  • Workflows preview. It shows the last recorded run: outcome, time, duration and the failing job.
  • DAG graph. It shows stage and job durations. Cards on the critical path, the slowest chain of dependent jobs, get a thick border.

Incremental local reruns and live output

The second feature commit makes a local rerun cheaper than a hosted runner's cold start.

  • Kept workspaces. Each job keeps its workspace under the cache directory, keyed by repository, workflow file and job. Checkout syncs source files in by git's own ignore rules, keeps mtimes of unchanged files, deletes what the repository deleted, and leaves ignored build output alone. .git is mirrored without hooks, and its objects are hard-linked where the filesystem allows. wrkflw clean removes every workspace no run holds. --fresh-workspace restores hosted-runner behavior.
  • Matrix folding. A leg that differs from another only in what runs-on reads, and lands in the same image, reports that leg's result instead of running. Its job_finished event and history record carry repeated_from. --every-matrix-leg runs every leg.
  • Live step output. Every runtime streams what a step prints as StepOutput events, masked line by line, with ::add-mask:: applied as it streams. History and NDJSON skip these events; step_finished still carries the full output.
  • Run tab. Execution, DAG and Logs fold into one Run tab with jobs, graph and log views, in a DOS-style Blueprint theme with contrast tests for both palettes.

Review fixes

A principal review of the first push found issues that the last five commits address:

  • ::add-mask:: lines and later occurrences of the value reached the TUI unmasked through the live stream.
  • The TUI could drop a run's final events, leaving its last job shown as running.
  • The Docker log follow could hang a step until its job timeout when the stream outlived the container.
  • Folded matrix legs looked like real 0 ms successes.
  • Workspace sync matched anchored ignore rules wrongly in subdirectories, skipped tracked dotfiles, copied hooks and the full object store, and keyed workspaces by workflow name.

Second review round

A second principal review asked for changes. The last fifteen commits address every finding:

  • Tests no longer write to the user's cache. cargo test filled ~/Library/Caches/wrkflw/workspaces with hundreds of workspaces, and tests could see each other's files. .cargo/config.toml now sets WRKFLW_FRESH_WORKSPACE=1, and a test checks that it is set.
  • WRKFLW_FRESH_WORKSPACE=1 no longer breaks the CLI. clap rejected 1 for both env flags, so the value the README recommends stopped every subcommand from starting. Both flags now accept 1/0/yes/no.
  • The log masker only takes credential-like variables. BRANCH=main used to mask every later "main" in the process's log. Step output still masks every variable.
  • Live output keeps multibyte characters whole across pipe reads and Docker frames.
  • A carriage return redraws a line in live output, so a progress bar no longer floods the tail. ::add-mask:: still takes effect in states that get drawn over.
  • Checkout sync handles read-only files. On Linux it failed on them, and it lost their mtimes. Where hard links fail, it no longer copies the git object store again on every run.
  • The CLI job summary marks folded matrix legs as not run.
  • wrkflw clean reports the space it freed, including as bytes in JSON.
  • UI: the story settles jobs that never finished once the run ends. A matrix stage's time waits for its last leg. n switches to the raw log it searches. The Output pane marks a finished job's tail.
  • Cleanup: one shown-workflow helper replaces ten hand-written lookups. History uses the Run tab's duration format. Live output, matrix folding and checkout sync move out of engine.rs into their own modules, as a pure code move.
  • Tests: the every-size render test now draws a populated story and live tails. The dark contrast test covers every color the light one does.

Each commit passes fmt, clippy and the full test suite on its own. The full suite has 1,520 passing tests and no failures.

Third review round

A third principal review asked for changes. The last thirteen commits address every finding:

  • Live output is masked with every value the run masks. It used only the log masker, which skips --variable values that don't look like credentials, so those showed in the TUI while a step ran. An ::add-mask:: line too long to hold now takes effect when it ends, instead of when the step ends.
  • WRKFLW_FRESH_WORKSPACE=no no longer turns fresh workspaces on. The executor now reads switch variables exactly as clap does, and a test checks the two agree.
  • A folded matrix result is not reused by --every-matrix-leg. That mode is part of the result key for matrix jobs; default keys are unchanged.
  • Live output only streams when an observer asks. The recorder doesn't, so CLI runs no longer mask and dispatch every line twice.
  • wrkflw clean carries on past a workspace it can't remove, reports each failure, adds failed to its JSON, and exits 1.
  • WRKFLW_WORKSPACES_DIR moves kept workspaces.
  • A just-freed workspace lock is retried for up to 200ms. A process forked by another thread can briefly inherit the lock; this made a workspace test flaky.
  • rust-version = "1.89" is declared, since workspaces use File::try_lock.
  • UI: job state follows the event stream, so the graph and Jobs pane agree with the story mid-run. The Jobs cursor reaches running jobs and pins the Output pane to them. The critical path is the slowest job of each stage, which is what sets run time. The story no longer says no job started after a validation run. 59.95s reads as "1m 00s". Dead run-start code and a double clear are gone.

Each commit passes fmt, clippy, cargo check --no-default-features and the full test suite on its own.

Behavior changes to note

  • RunOptions gained a public observers field and now implements Debug by hand.
  • ExecutionObserver gained wants_step_output(), default false. Observers that want StepOutput events must return true.
  • SecretMasker gained snapshot().
  • wrkflw clean --format json adds failed, and clean exits 1 when a workspace could not be removed.
  • The minimum supported Rust version is 1.89.
  • Two tests that asserted the job picker wraps around now assert it stops at the ends.
  • The blocked glyph also changes in CLI output from the runtime crates.
  • Jobs keep their workspace between runs by default. A job that never runs actions/checkout now finds its last run's files instead of an empty directory, and files a step writes persist until overwritten or cleaned.
  • Matrix legs that would only repeat another leg don't run by default.
  • job_finished gains an optional repeated_from; other NDJSON lines are unchanged.
  • New wrkflw clean subcommand, and new --fresh-workspace and --every-matrix-leg flags.
  • JobResult gained a public repeated_from field, so code that builds one with a struct literal must set it.
  • wrkflw clean --format json adds bytes.
  • The Docker runtime now builds its combined setup image with build-essential.

Testing

  • cargo test --workspace --all-features: 1,493 passed, 0 failed. New tests cover redaction, the live add-mask path, a secret split across a forced line cut, the timeline race, step-indexed tails, repeated_from in events and NDJSON, workspace keying and cleaning, git-checkout sync rules, anchored ignores in subdirectories, and hook-free, linked git mirrors.
  • cargo clippy --workspace --all-features -- -D warnings and cargo fmt --check are clean.
  • cargo check --no-default-features --workspace is clean.
  • Manual checks from the first push still apply: secret values never appear at --verbose or --debug, and every changed screen was driven at 160x45 and 80x24.