Commit Graph

206 Commits

Author SHA1 Message Date
khyari hamza eeb0d49377 test(security): add coverage for audit CLI, logging, and redaction edge cases
Add 22 new Behave scenarios covering:
- audit CLI commands (list, show, prune, count)
- audit service context manager and owned-session paths
- corrupt JSON details fallback in _row_to_entry
- configure_structlog dev/prod/invalid and get_logger
- redaction edge cases (empty key, empty URL, empty pattern,
  show_secrets bypass, nested dict processor)
2026-02-19 20:10:56 +00:00
khyari hamza 201be39632 fix(security): address review findings for audit logging 2026-02-19 19:23:30 +00:00
khyari hamza ae41167a1d feat(security): add audit logging for apply 2026-02-19 19:23:30 +00:00
khyari hamza cea3bad758 refactor(ops): address re-review findings for cleanup commands
- Use model_copy(update=...) in test helpers so Pydantic ge=
  validators are enforced during tests, not just env vars (NEW-1)
- Promote _extract_plan_id_from_sandbox to public staticmethod
  and reuse in CLI active-plan detection to eliminate duplicate
  plan-ID parsing logic (NEW-2)
- Cache _get_sandbox_dirs result for service instance lifetime
  and have CLI active-plan detection use the cached listing so
  /tmp is iterated only once per invocation (NEW-3)
2026-02-19 14:20:16 +00:00
khyari hamza bab4560dde feat(ops): add cleanup commands 2026-02-19 13:46:48 +00:00
khyari hamza d815339c52 feat(security): add secrets masking and validation (H-21/SEC5)
Implement centralized redaction utility that masks API keys, tokens,
and credentials across CLI output, structlog logs, and error messages.

- Add shared/redaction.py with pattern-based secret detection (sk-*,
  sk-ant-*, tok_*, Bearer tokens), sensitive key name detection,
  database URL masking, custom pattern registration, and thread-safe
  global show_secrets flag
- Add config/logging.py with structlog configuration integrating the
  secrets_masking_processor into the processor chain
- Add --show-secrets global CLI option to reveal secrets when needed
- Redact error details in main.py, project.py, and auto_debug.py
  error handlers before printing
- Wrap format_output() in formatting.py with automatic dict redaction
- Add show_secrets field and safe __repr__ to Settings model
- Add 43-scenario Behave feature (features/security_secrets.feature)
- Add 10 Robot Framework smoke tests (robot/security_secrets.robot)
- Add ASV benchmarks (benchmarks/security_secrets_bench.py)
- Add reference docs (docs/reference/secrets_handling.md)
2026-02-19 11:15:18 +00:00
brent.edwards 9802424a41 Merge branch 'master' into develop-20260217
# Conflicts:
#	robot/database_integration.robot
2026-02-19 00:57:48 +00:00
CoreRasurae 272f6fc255 test(unit): fix failing tests related to RichTerm usage 2026-02-18 23:55:05 +00:00
brent.edwards 2dfad7ec71 Merge branch 'master' into develop-20260217
# Conflicts:
#	implementation_plan.md
2026-02-18 23:08:48 +00:00
brent.edwards b50987731a fix(test): resolve CI test failures from session isolation and subprocess timeouts
- Fix resource_repository Behave scenario 'Resolve by ULID returns the
  resource' by propagating res_type_name through context instead of
  relying on fragile list_types() across SQLAlchemy sessions
- Increase subprocess timeouts in Robot Framework integration tests to
  prevent SIGTERM kills under parallel execution load (10s->30s, 20s->60s,
  30s->60s across 7 robot files)
2026-02-18 22:59:09 +00:00
khyari hamza 02c75fb4bb feat(cli): enhance version/info/diagnostics with --format and --check
Add structured data builders and Rich renderers for version, info, and
diagnostics commands. Support --format rich/plain/json/yaml output parity
and --check flag for diagnostics (exits non-zero on errors).

Includes Behave scenarios, Robot smoke tests, ASV benchmarks, and updates
existing tests to match the new Rich panel output format.
2026-02-18 12:18:03 +00:00
brent.edwards 52f74f3ddb Merge master into develop-20260217 2026-02-18 05:52:05 +00:00
freemo b2c3c08415 Tests: Fixed broken tests 2026-02-17 22:59:16 -05:00
brent.edwards 24866b2244 Merge branch 'master' into develop-20260217 2026-02-18 03:27:00 +00:00
brent.edwards 629f286bd3 Merge branch 'feature/m3-skill-domain-robot' into develop-20260217 2026-02-18 02:45:31 +00:00
brent.edwards a2ec1ccc44 Merge branch 'feature/m3-tool-domain-robot' into develop-20260217 2026-02-18 02:45:27 +00:00
brent.edwards 0a7a8d15be Merge branch 'feature/m1-resource-db-robot-tests' into develop-20260217 2026-02-18 02:45:22 +00:00
brent.edwards 4e3150bd50 Merge branch 'feature/m3-session-domain-robot' into develop-20260217
# Conflicts:
#	implementation_plan.md
2026-02-18 02:45:08 +00:00
brent.edwards a9ee5fbc0e Merge branch 'feature/m3-session-persistence' into develop-20260217 2026-02-18 02:44:11 +00:00
brent.edwards 6f09f23d29 Merge branch 'feature/m1-persistence-tests' into develop-20260217
# Conflicts:
#	docs/development/testing.md
2026-02-18 02:43:58 +00:00
brent.edwards b6c1c72d43 Merge branch 'feature/m1-cli-tests' into develop-20260217 2026-02-18 02:43:05 +00:00
brent.edwards d476e45fba style(ruff-format): fix one unformatted file 2026-02-18 02:17:58 +00:00
freemo 77a0a95dc3 Tests: Added coverage to get us to 97% 2026-02-17 21:00:05 -05:00
freemo 79f91c51b1 Tests: ensuring tests have coverage and work. 2026-02-17 20:55:49 -05:00
freemo a4db605e1c feat(tool): add resource binding resolution 2026-02-17 20:55:46 -05:00
freemo a8558f13ca feat(cli): add project context commands 2026-02-17 20:55:43 -05:00
freemo 08639183e2 feat(resource): add DAG linking and discovery 2026-02-17 20:55:32 -05:00
freemo 3b005ddcd4 feat(service): resolve automation profiles with precedence 2026-02-17 20:18:18 -05:00
freemo 7e7d2e7727 feat(execute): add changeset model and change capture 2026-02-17 20:18:15 -05:00
freemo 5480cd36fd feat(project): add context policy model 2026-02-17 20:07:38 -05:00
freemo 9464ec6285 feat(domain): add automation profile model and built-ins 2026-02-17 20:07:34 -05:00
freemo 093204a703 feat(resource): add fs-mount and fs-directory types 2026-02-17 20:07:31 -05:00
brent.edwards 3598924d6f test(cov): add skill CLI and service coverage scenarios
Add 19 behave scenarios covering uncovered paths in skill_service.py
and cli/commands/skill.py to bring coverage above the 97% threshold:
- show with includes, MCP servers, agent_skills, inline tools, Referenced By
- tools with mixed MCP/inline sources
- list with non-local namespaces
- remove without --yes (abort path)
- update with dependent skills (Affected Actors panel)
- service edge cases: skill_count, empty names, source filtering, no config_path
- add with missing-description YAML (validation failure)
2026-02-18 01:03:11 +00:00
brent.edwards 686c834602 feat: merge branch 'master' into feature/m3-tool-domain-robot 2026-02-17 17:02:27 -08:00
brent.edwards b528cde8e7 feat: merge branch 'master' into feature/m1-persistence-tests 2026-02-18 00:43:28 +00:00
brent.edwards 60d10cef7c Merge branch 'master' into feature/m1-cli-tests 2026-02-18 00:42:19 +00:00
brent.edwards c8fa6f716d style(ruff-format): ruff format run
One file repaired.
2026-02-18 00:39:41 +00:00
brent.edwards 1fbc062b48 style(format): 1 file reformatted 2026-02-18 00:34:44 +00:00
brent.edwards 9e9f229b3a fix(test): commit edge row so delete step sees it in its own session
The "Deleting a resource with edges is rejected" scenario was failing
because the ResourceEdgeModel row was flushed but never committed.
Since ResourceRepository.delete() obtains its own session from the
factory, the uncommitted edge was invisible and ResourceHasEdgesError
was never raised.
2026-02-18 00:28:29 +00:00
brent.edwards b1c011702f feat: merge branch 'master' into feature/m3-skill-domain-robot 2026-02-18 00:21:04 +00:00
CoreRasurae 47cad3c77b feat(session): add session persistence and repositories 2026-02-18 00:10:15 +00:00
brent.edwards ea7fcc0ba0 fix(test): resolve AmbiguousStep collision, invalid ULIDs, and edge commit
Three issues prevented the behave suite from running:

1. plan_persistence_steps.py and plan_repository_steps.py both defined
   @then('the retrieved plan description should be "..."'), causing an
   AmbiguousStep error that broke all ~50 feature files. Renamed the
   persistence step to "the persisted plan description should be".

2. The three-level hierarchy scenario used plan IDs containing O, I,
   and L which are excluded from the ULID charset. Replaced with valid
   characters (O->0, I->0, L->K).

3. resource_repository_steps.py flushed but never committed the edge
   row, so the delete method's separate session could not see it.
2026-02-18 00:09:56 +00:00
brent.edwards bd647d58cf fix(resource_repository_steps.py): add missing commit() statement 2026-02-18 00:04:09 +00:00
brent.edwards d950d48aa9 fix(resource_repository_steps.py): add missing commit() statement 2026-02-18 00:00:22 +00:00
brent.edwards 2840514729 feat: Merge branch 'master' into feature/m1-resource-db-robot-tests 2026-02-17 15:59:22 -08:00
brent.edwards d24079f129 fix(resource_repository_steps.py): add missing commit() statement 2026-02-17 23:58:10 +00:00
brent.edwards 6c7bcab01e feat: merge branch 'master' into feature/m3-session-domain-robot 2026-02-17 15:56:13 -08:00
brent.edwards 9db88a9541 fix(test): commit edge row so delete step sees it in its own session
The "Deleting a resource with edges is rejected" scenario was failing
because the ResourceEdgeModel row was flushed but never committed.
Since ResourceRepository.delete() obtains its own session from the
factory, the uncommitted edge was invisible and ResourceHasEdgesError
was never raised.
2026-02-17 23:38:45 +00:00
brent.edwards cdbd0bdd23 feat: merge branch 'master' into feature/m3-skill-cli 2026-02-17 22:45:44 +00:00
brent.edwards da40bff33d fix(test): commit edge row so delete step sees it in its own session
The "Deleting a resource with edges is rejected" scenario was failing
because the ResourceEdgeModel row was flushed but never committed.
Since ResourceRepository.delete() obtains its own session from the
factory, the uncommitted edge was invisible and ResourceHasEdgesError
was never raised.
2026-02-17 22:26:38 +00:00