Skip to content

SecurityValidator: wire installer to materialize ~/.pai/package.json + bun install + PAI/PAISECURITYSYSTEM (#158 follow-up) #160

@virtualian

Description

@virtualian

Background

PR #159 (closing #158) restores the shipping artefacts (Releases/v4.0.3+/.claude/package.json, Releases/v4.0.3+/.claude/PAI/PAISECURITYSYSTEM/patterns.example.yaml) so that future installs would close the SecurityValidator no-op regression — but only if the installer also has a step that materializes ~/.pai/PAI/... from the cloned ~/.claude/PAI/... and runs bun install in ~/.pai/ to populate node_modules/yaml/.

Today there is no such step. The installer's engine/steps.ts has 8 steps; none of them touch ~/.pai/PAI/ or run bun install anywhere. migratePerPackSymlinks handles skills/ only.

Required work

  1. New installer step (or extension of an existing one) that, after the repo clone:

    • Copies (or symlinks) ~/.claude/package.json to ~/.pai/package.json if not present.
    • Runs bun install in ~/.pai/ (idempotent — skip if ~/.pai/node_modules/yaml/ already exists at the right version).
    • Materializes ~/.claude/PAI/PAISECURITYSYSTEM/ into ~/.pai/PAI/PAISECURITYSYSTEM/ (analogous to per-pack skill canonicalization, but for the PAI/ subtree).
  2. Decide: copy vs symlink for the PAI/ subtree. Skill packs use per-pack symlinks (Skills separation is documentation-only: Claude Code harness reads ~/.claude/skills/, not ~/.pai/skills/ #110); PAI/ has historically been a real directory under ~/.pai/PAI/ populated by other means (no current automated mechanism). Worth aligning on one model.

  3. Decide: should bun.lock be tracked in the repo (commit it) or treated as a runtime-only artefact (gitignore)?

  4. Test: after a fresh-install run-through, Tools/verify-security-validator.sh should report PASS=8 FAIL=0 without manual setup.

Verification

After implementation, a fresh install on a clean machine should:

  • Produce a working ~/.pai/node_modules/yaml/.
  • Produce a working ~/.pai/PAI/PAISECURITYSYSTEM/patterns.example.yaml.
  • Allow bash Tools/verify-security-validator.sh to pass with no further setup.

Refs

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions