Skip to content

fix: harden CLI input validation, add callgraph/logging/deploy tests,…#1067

Merged
Gbangbolaoluwagbemiga merged 1 commit into
HyperSafeD:mainfrom
Jayy4rl:fix/issues-305-521-526-527
Jun 28, 2026
Merged

fix: harden CLI input validation, add callgraph/logging/deploy tests,…#1067
Gbangbolaoluwagbemiga merged 1 commit into
HyperSafeD:mainfrom
Jayy4rl:fix/issues-305-521-526-527

Conversation

@Jayy4rl

@Jayy4rl Jayy4rl commented Jun 28, 2026

Copy link
Copy Markdown
Contributor

… update README

Closes #305
Closes #521
Closes #526
Closes #527

Changes by issue:

#305 — README.md

  • Update sanctifier analyze CLI reference to document all flags: --timeout, --exit-code, --min-severity, --profile, --format ndjson|sarif
  • Refresh quick-start example (sanctifier analyze ./contracts)
  • Expand JSON output example to match actual schema (error_codes, rule_violations)
  • Note ndjson streaming mode in the output-contract section

#527 — runtime guards integration UX (input validation + error messages)

  • errors.rs: add E010 (invalid network) and E011 (missing credentials) with constructor methods and actionable hint strings; 6 new unit tests
  • deploy.rs: validate network against testnet|futurenet|mainnet before any I/O, return structured E010 error on bad value; replace bare eprintln+exit for the missing-credentials path with a structured E011 return
  • tests/deploy_validation_tests.rs: 8 integration tests covering E010/E011 rejection, hint content, and pass-through for all three valid networks

#526 — callgraph command correctness (integration/e2e)

  • tests/callgraph_tests.rs: 7 integration tests covering empty contract (0 edges), invoke_contract_check variant, multiple callers in one contract, nonexistent path exit, default output file, DOT syntax validity, and two-contract attribution

#521 — logging performance benchmarks + budgets

  • logging.rs: add make_filter(verbosity) helper for filter-build benchmarking without global side-effects; 4 unit tests including a 50 ms build-time budget
  • tests/logging_bench_tests.rs: 6 integration tests — 30 s wall-clock budget for quiet/verbose/JSON log modes, stderr-stream correctness for text and JSON modes, and a no-ERROR assertion for clean files in quiet mode

Summary

Describe the change, the motivation behind it, and any important implementation details.

Fixes #

Type of change

  • Bug fix
  • New feature
  • Breaking change
  • Documentation update
  • Maintenance or refactor

Testing

List the commands you ran and the scope of validation.

cargo fmt --all --check
cargo clippy --workspace --all-targets --all-features -- -D warnings
cargo test -p sanctifier-core --all-features
cargo test -p sanctifier-cli
cd frontend && npm test

Checklist

  • I ran the relevant tests locally, or explained why they were not needed.
  • I updated documentation for any user-facing behavior changes.
  • I added or updated tests for the change when appropriate.
  • I added a changelog or release-notes entry when needed, or confirmed none is required.
  • I verified this branch is up to date with main and merge conflicts are resolved.

… update README

Closes HyperSafeD#305, HyperSafeD#521, HyperSafeD#526, HyperSafeD#527.

Changes by issue:

HyperSafeD#305 — README.md
- Update `sanctifier analyze` CLI reference to document all flags:
  --timeout, --exit-code, --min-severity, --profile, --format ndjson|sarif
- Refresh quick-start example (sanctifier analyze ./contracts)
- Expand JSON output example to match actual schema (error_codes, rule_violations)
- Note ndjson streaming mode in the output-contract section

HyperSafeD#527 — runtime guards integration UX (input validation + error messages)
- errors.rs: add E010 (invalid network) and E011 (missing credentials) with
  constructor methods and actionable hint strings; 6 new unit tests
- deploy.rs: validate network against testnet|futurenet|mainnet before any I/O,
  return structured E010 error on bad value; replace bare eprintln+exit for the
  missing-credentials path with a structured E011 return
- tests/deploy_validation_tests.rs: 8 integration tests covering E010/E011
  rejection, hint content, and pass-through for all three valid networks

HyperSafeD#526 — callgraph command correctness (integration/e2e)
- tests/callgraph_tests.rs: 7 integration tests covering empty contract (0 edges),
  invoke_contract_check variant, multiple callers in one contract, nonexistent
  path exit, default output file, DOT syntax validity, and two-contract attribution

HyperSafeD#521 — logging performance benchmarks + budgets
- logging.rs: add make_filter(verbosity) helper for filter-build benchmarking
  without global side-effects; 4 unit tests including a 50 ms build-time budget
- tests/logging_bench_tests.rs: 6 integration tests — 30 s wall-clock budget for
  quiet/verbose/JSON log modes, stderr-stream correctness for text and JSON modes,
  and a no-ERROR assertion for clean files in quiet mode
@vercel

vercel Bot commented Jun 28, 2026

Copy link
Copy Markdown

@devjayy43 is attempting to deploy a commit to the gbangbolaoluwagbemiga's projects Team on Vercel.

A member of the Team first needs to authorize it.

@drips-wave

drips-wave Bot commented Jun 28, 2026

Copy link
Copy Markdown

@Jayy4rl Great news! 🎉 Based on an automated assessment of this PR, the linked Wave issue(s) no longer count against your application limits.

You can now already apply to more issues while waiting for a review of this PR. Keep up the great work! 🚀

Learn more about application limits

@Gbangbolaoluwagbemiga Gbangbolaoluwagbemiga merged commit bf7fdfb into HyperSafeD:main Jun 28, 2026
9 of 27 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment