Skip to content

fix: harden CLI correctness and anchor handling#2

Merged
laulauland merged 3 commits intomainfrom
lau/drift-cli-correctness
Mar 25, 2026
Merged

fix: harden CLI correctness and anchor handling#2
laulauland merged 3 commits intomainfrom
lau/drift-cli-correctness

Conversation

@laulauland
Copy link
Copy Markdown
Member

Summary

  • harden drift link/unlink around non-drift frontmatter and comment-based drift blocks
  • make command failures exit non-zero, include inline anchors in status, and emit valid escaped JSON
  • add regression tests and update CLI/user docs for the corrected behavior

Testing

  • zig fmt --check src/main.zig src/frontmatter.zig src/scanner.zig test/integration/link_test.zig test/integration/status_test.zig test/integration/unlink_test.zig test/integration/lint_test.zig test/helpers.zig tests.zig
  • zig test src/frontmatter.zig -target aarch64-macos.15.0
  • zig test src/scanner.zig -target aarch64-macos.15.0
  • zig test $(mktemp /tmp/jsoncheckXXXX.zig) -target aarch64-macos.15.0 (one-off std.json API compile check)

Tackle:
- preserve non-drift frontmatter when linking
- handle quoted inline anchors correctly
- exit non-zero on command failures
- include inline anchors in status
- support unlink for comment-based anchors
- emit valid JSON from status --format json
- update docs and regression tests
@laulauland laulauland merged commit ea30340 into main Mar 25, 2026
5 checks passed
@laulauland laulauland deleted the lau/drift-cli-correctness branch March 25, 2026 18:27
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