Skip to content

[Hackathon] Add structured debug logging to silent catch blocks #186

Closed as not planned

Description

@farhank15

Discord Username / User ID

getmawa_22

What does this improvement do?

Multiple catch blocks across the CLI silently swallow errors with no
logging or trace output, making debugging difficult. When a feature
silently degrades (e.g., duplicate-name advisory, skill nudge,
bundle stream verification), the operator has no way to know an
error occurred — the CLI just returns a confusing result.

This adds structured debug logging (gated behind --debug / --verbose)
to these catch blocks so developers and support can trace suppressed
errors without changing behavior or exit codes.

Details / implementation notes

Found ~12 catch blocks across:

  • src/commands/test.ts (lines 634, 4429, 4440, 4727, 5739)
  • src/lib/skill-nudge.ts (lines 63, 130)
  • src/lib/bundle.ts (line 606)
  • src/commands/init.ts (lines 43, 290, 316)
  • src/lib/dry-run/fetch.ts (line 41)
  • src/lib/facade.ts (lines 78, 95)

For each location, inject a conditional stderr log when opts.debug
or opts.verbose is set, e.g.:

if (opts.debug) {
  stderr(`[debug] <context>: ${err instanceof Error ? err.message : String(err)}`);
}

Changes are additive — no existing behavior is altered, no exit codes
change, and the default (no --debug) output is byte-identical.
Estimated < 100 lines changed across ~12 files.

Tests: verify that with --debug the catch path prints a stderr line
and without --debug the output is unchanged (byte-identical snapshots).

Confirmations

  • I have searched existing issues and this is not a duplicate.
  • I have provided my Discord identity above for reward coordination.

Activity

  1. added
    needs-triage
    hackathon
    on Jul 6, 2026
  2. zeshi-du commented on Jul 18, 2026

    @zeshi-du
    Contributor

    Scope bookkeeping so this doesn't get closed prematurely: the issue enumerates ~12 silent catch sites across 6 files. So far exactly one is covered (init.ts whoami fallback, merged via #223); a second PR (#229) targeted update-check.ts, which isn't on this issue's list, and got a rework request. Everything else here — test.ts ×5, skill-nudge.ts ×2, bundle.ts, the remaining init.ts sites, dry-run/fetch.ts, facade.ts ×2 — is still open for contributors. The pattern to follow is #223: gate strictly on the parsed --debug option, stderr only, with a byte-identical-without-debug test.

  3. yuhaouno commented on Jul 25, 2026

    @yuhaouno

    /assign

  4. removed
    needs-triage
    on Jul 25, 2026
  5. testsprite-hob commented on Jul 25, 2026

    @testsprite-hob

    Assigned to @yuhaouno. Thanks for taking this on. (2 more slots available.)

    Your open assigned issues (1/3):
    (none)

  6. added
    in-progress
    on Jul 25, 2026
  7. added
    accepted
    on Aug 13, 2026
  8. removed
    in-progress
    on Sep 25, 2026
  9. zeshi-du commented on Sep 25, 2026

    @zeshi-du
    Contributor

    @yuhaouno — this issue has been assigned to you since July 25 without a linked PR, so we're releasing the claim to free the slot for other contributors. You're welcome to /assign again if it's still free when you're ready.

    For whoever picks it up next: #223 and #317 already covered some of the catch sites listed above, so check current main before starting.

  10. yuhaouno commented on Sep 25, 2026

    @yuhaouno

    /assign

    I am ready to resume with a narrow remaining part of this issue: debug-only diagnostics when the best-effort duplicate-name lookup fails during test creation. I checked current main and #223 / #317; this will not duplicate the completed skill-nudge work. The PR will preserve create behavior and non-debug output, with regression coverage.

  11. added
    in-progress
    on Sep 25, 2026
  12. 5 remaining items

  13. testsprite-hob commented on Nov 3, 2026

    @testsprite-hob

    @yuhaouno, your claim expired after 48 hours without a linked PR. This issue is open for others now, and you're welcome to /assign again if it's still free.

  14. removed
    in-progress
    on Nov 10, 2026
  15. testsprite-hob commented on Nov 10, 2026

    @testsprite-hob

    @naufalfx805-source, your claim expired after 48 hours without a linked PR. This issue is open for others now, and you're welcome to /assign again if it's still free.

  16. bhushan4work commented on Nov 11, 2026

    @bhushan4work

    /assign

  17. added
    in-progress
    on Nov 11, 2026
  18. testsprite-hob commented on Nov 11, 2026

    @testsprite-hob

    Assigned to @bhushan4work. Thanks for taking this on. (2 more slots available.)

    Your open assigned issues (1/3):
    (none)

  19. zeshi-du commented on Nov 19, 2026

    @zeshi-du
    Contributor

    Closing as not planned: 0.17.0 removes the listed test.ts sites, #223, #317 and #354 covered the init and skill-nudge sites, and we're leaving the remaining portal-URL, video-extension and dry-run parses as they are.

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

Metadata

Metadata

Assignees

No one assigned

    Labels

    acceptedhackathonin-progress

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions