Skip to content

feat: agent identity, provenance, and open-source release security remediation#14

Merged
0xNyk merged 7 commits into
mainfrom
feat/agent-identity-provenance
Mar 17, 2026
Merged

feat: agent identity, provenance, and open-source release security remediation#14
0xNyk merged 7 commits into
mainfrom
feat/agent-identity-provenance

Conversation

@0xNyk

@0xNyk 0xNyk commented Mar 17, 2026

Copy link
Copy Markdown
Owner

Summary

Agent identity & provenance system plus security remediation for open-source release.

Agent Identity & Provenance

  • C1/C2: fcntl.flock() exclusive locking for agent-id registry and provenance chain (TOCTOU prevention)
  • C3: Corrupted JSON recovery with automatic .corrupt.<ts> backup
  • H1: Fix pre-existing mode-gates and security-controls test failures (LACP_SANDBOX_RECURSION_GUARD env pollution)
  • H2: Double-start warning for provenance when pending.json exists
  • M3: Edge case tests for corrupted registry, double-start, corrupted chain mid-file
  • Plugin installer, smart-connections manifest, and AI-agent plugin curation

Open-Source Security Remediation

  • Replace all hardcoded personal paths (~/control/, ~/obsidian/nyk) with env-var defaults (${LACP_SESSIONS_ROOT}, ${LACP_SKILLS_ROOT}, ~/obsidian/vault)
  • Genericize graph_view colorGroups in obsidian manifest (remove personal vault taxonomy)
  • Replace personal automation paths in CI tests with ${HOME}/.lacp/automation
  • Replace personal paths in docs with $LACP_ROOT / $LACP_KNOWLEDGE_ROOT
  • Add .claude/ and .gitnexus/ to .gitignore
  • Add missing command refs (repos-index, skill-score) to README
  • Add AGENTS.md, bin/lacp-repos-index, and test-repos-index.sh

Verification

  • grep -r '~/control/' bin/ scripts/ docs/ config/ → 0 matches
  • grep -r 'obsidian/nyk' config/ → 0 matches
  • bin/lacp-test --quick → passes

Test plan

  • bin/lacp-test --quick — passes
  • test-agent-id.sh — passes
  • test-provenance.sh — passes
  • test-mode-and-gates.sh — passes
  • test-security-controls.sh — passes
  • test-route-policy.sh — passes
  • Zero personal path leaks in tracked files

🤖 Generated with Claude Code

0xNyk and others added 7 commits March 16, 2026 23:26
…audit/scaffold

- `lacp-agent-id`: persistent agent IDs per (hostname, project) pair with register/show/touch/revoke/list
- `lacp-provenance`: SHA-256 hash-chained session receipts with start/end/verify/log/export
- `lacp-brain-stack audit`: system-wide memory coverage report across all Claude projects
- `lacp-brain-stack scaffold-all`: batch-create memory dirs for high-traffic projects missing them
- `lacp-brain-stack init --with-gitnexus`: optional GitNexus code intelligence MCP wiring
- Full CI coverage for all new commands (test-agent-id.sh, test-provenance.sh, test-brain-stack.sh)
Critical:
- Add fcntl.flock() exclusive locking to agent-id registry (register,
  touch, revoke) and provenance chain append to prevent TOCTOU races
- Add corrupted JSON recovery with automatic backup to agent-id
  registry (try/except + .corrupt.<ts> backup + empty recreation)

High:
- Fix pre-existing mode-gates and security-controls test failures
  caused by LACP_SANDBOX_RECURSION_GUARD env pollution from session
  hooks bypassing all gate logic
- Add double-start warning to provenance (log when pending.json
  already exists)

Medium:
- Add edge case tests: corrupted registry recovery, double-start
  warning, corrupted chain mid-file detection
- Fix verify_cmd crash on corrupted chain lines (safe_parse helper)
- Add CHANGELOG 0.3.0 release section, deduplicate README brain-ingest,
  add mcp-health to README, add env var reference to CLAUDE.md

Low:
- Document SHA-256 truncation to 96 bits as design choice
- Add trap cleanup to test-route-policy.sh
Resolve 6 conflicts:
- CHANGELOG.md: keep 0.3.0 section header from branch
- README.md: accept main's additions (brain-ingest, mcp-health cleanup)
- bin/lacp-agent-id: keep branch (file locking + JSON recovery)
- bin/lacp-provenance: keep branch (file locking + double-start)
- scripts/ci/test-agent-id.sh: keep branch (corrupted registry test)
- scripts/ci/test-provenance.sh: keep branch (double-start + chain tests)
…plugin curation

- Add smart-connections, calendar, automatic-linker, obisidian-note-linker,
  mcp-tools to community_plugins manifest
- Add smart-connections default settings (local transformers embeddings)
- Add `lacp-obsidian install-plugins` subcommand: resolves plugin IDs via
  official Obsidian registry, downloads GitHub release assets, registers in
  community-plugins.json (--dry-run, --json supported)
- Wire install-plugins into brain-stack init
- Add brain-doctor check for smart-connections Obsidian plugin
…source release

- Replace ~/control/sessions and ~/control/skills with ${LACP_SESSIONS_ROOT} / ${LACP_SKILLS_ROOT}
- Replace ~/obsidian/nyk with ~/obsidian/vault in obsidian manifest and CLI fallbacks
- Genericize graph_view colorGroups in obsidian manifest (remove personal taxonomy)
- Replace personal automation paths in CI tests with ${HOME}/.lacp/automation
- Replace personal paths in docs with $LACP_ROOT / $LACP_KNOWLEDGE_ROOT
- Add .claude/ and .gitnexus/ to .gitignore
- Add missing command refs (repos-index, skill-score) to README
- Fix context-contract example using ~/control path in README
- Add AGENTS.md, repos-index command, and repos-index test
@0xNyk 0xNyk changed the title fix: add file locking, JSON recovery, and fix gate test failures feat: agent identity, provenance, and open-source release security remediation Mar 17, 2026
@0xNyk 0xNyk merged commit 39d38a2 into main Mar 17, 2026
@0xNyk 0xNyk deleted the feat/agent-identity-provenance branch March 17, 2026 16:29
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