Skip to content

fix(wave2): security hardening — atomic writes, dry-run, scripts gate, checksum (#142–#146) - #176

Closed
matheusmlopess wants to merge 1 commit into
mainfrom
feature/wave2-security
Closed

fix(wave2): security hardening — atomic writes, dry-run, scripts gate, checksum (#142–#146)#176
matheusmlopess wants to merge 1 commit into
mainfrom
feature/wave2-security

Conversation

@matheusmlopess

Copy link
Copy Markdown
Owner

Summary

Test plan

  • TestWave2Security — 11 new regression tests (atomic, dry-run, scripts gate, checksum, project-root)
  • 110 tests pass locally
  • All new flags are backward-compatible (off by default)

🤖 Generated with Claude Code

…, checksum (#142#146)

#146  Atomic manifest writes: _atomic_write_json() uses temp-file +
      os.replace() (POSIX atomic rename) everywhere JSON manifests are
      written — _save_manifest, deregister_from_project, sync_to_global,
      register_in_project.  Mid-write interrupt no longer corrupts state.

#146  import --dry-run: prints agent name, version, target path, file
      count, scripts list, and conflict status then exits without writing
      anything.  Works with local ZIP, --from-git, and --from-registry.

#141  Pre-unpack inspection: _inspect_zip() scans ZIP member list before
      extraction to detect missing agent-manifest.json and enumerate
      scripts/ entries — no bytes are written to disk during inspection.

#142  Scripts review gate: if scripts/ files are present the operator is
      shown a list and prompted to confirm.  --allow-scripts bypasses the
      prompt for CI/automation use.

#144  SHA-256 sidecar: wrap emits <name>-v<ver>.zip.sha256 alongside the
      archive (BSD sha256sum format).  import --checksum <file> verifies
      the ZIP before any extraction and aborts on mismatch.

#143  --project-root validation: when an explicit non-default value is
      passed, the CLI asserts the path contains a .ai/ directory before
      proceeding, preventing silent imports into unrelated directories.

Tests: 11 new regression tests in TestWave2Security; 110 tests pass.

Co-Authored-By: 🤖Factory <noreply@agentfactory.dev>
@matheusmlopess

Copy link
Copy Markdown
Owner Author

Superseded by #177 (feature/wave2-gap-mitigations), which contains all security hardening commits from this branch plus gap mitigations and Gemini open-standard alignment.

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