Skip to content

feat: #65 remaining polish — import gate, import:true opt-in, SPEC-006 core (3 of 4) - #67

Merged
nmccready merged 3 commits into
mainfrom
feat/65-remaining-polish
Jul 5, 2026
Merged

feat: #65 remaining polish — import gate, import:true opt-in, SPEC-006 core (3 of 4)#67
nmccready merged 3 commits into
mainfrom
feat/65-remaining-polish

Conversation

@nmccready

Copy link
Copy Markdown
Contributor

Addresses the deferred backlog in #65. Three of four items done, each with tests; the fourth (Part C sandbox) is deliberately not included — see below.

Done (tested, go test ./... + go vet green)

Item 2 — import routes through the quarantine gate (security)
import <url> used to write remote content straight into .agents/ with no scan and no review gate, while pull was gated — the exact hole SPEC-005 names. Now import scans the fetched artifact and quarantines it by default; sync-agents quarantine/approve handle it identically to pull. --trust (or quarantine = off) bypasses, loudly, with the scan still run. CRITICAL findings block a non-forced approve.

Item 1 — import: true opt-in for plans/specs/adrs
Reference-doc buckets can join the managed CLAUDE.md @-import block via import: true frontmatter. Both collectors share one managedImportSuffix helper routing them to their own bucket dir (.claude/specs/X.md), mirroring the symlink destination.

Item 3 — SPEC-006 OS-scoped routing (core)
macos//linux//unix//windows/ subdirs under any bucket route only when runtime.GOOS matches, gated at discovery. Scoped names keep the subdir prefix so destinations + @-imports nest for free. Adds .agents/config os = <goos> override for CI/tests.
Pending (non-blocking): AGENTS.md [os] badges + concat OS-header comments — OS rules route correctly, they're just not listed in the static index yet.

Deliberately NOT included

Item 4 — SPEC-005 Part C sandboxed exec (sandbox-exec/bwrap+Landlock).
This is the security-critical "stretch" item. A sandbox that looks like it confines but doesn't is worse than none. Verifying a correct default-deny macOS seatbelt profile needs iteration I can't complete confidently in one pass, and the Linux bwrap/Landlock path can't be tested on a macOS dev box — it needs a Linux CI runner. Shipping it unverified would be security theater. Left for a focused, CI-tested PR.

🤖 Generated with Claude Code

nmccready and others added 3 commits July 5, 2026 09:26
…m 2)

import used to write remote content straight into .agents/ with no scan
and no review gate, while pull was gated — the exact hole SPEC-005 names.
Now import scans the fetched artifact and quarantines it by default;
--trust (or quarantine=off) bypasses, loudly, with the scan still run.
Adds source.QuarantineImport; Approve skips origin/lock writes for
untracked imports. Tests: quarantine-by-default, --trust bypass,
CRITICAL blocks approve.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
…UDE.md block (fixes #65 item 1)

Reference-doc buckets can now join the managed @-import block by setting
'import: true' in frontmatter. Both collectors (global CollectClaude...
and local ManagedImportBlockForLocal) share one managedImportSuffix
helper that routes reference docs to their own bucket dir
(.claude/specs/X.md) mirroring the symlink destination, while rules/
workflows keep qualifying by semantic. Tests for opt-in routing and
frontmatter parsing.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
…06 core, #65 item 3)

macos/linux/unix/windows subdirs under any bucket route only when the
host matches (runtime.GOOS), gated at discovery so non-matching subtrees
are skipped. Scoped artifacts keep the subdir as a name prefix, so
destinations (.claude/rules/macos/brew.md) and @-imports mirror the
source tree for free — all destinations already filepath.Join(name).
Adds .agents/config 'os = <goos>' override for cross-platform CI/tests.
Tests: scope table, per-OS discovery, config override.

Pending (follow-up, non-blocking): AGENTS.md [os] badges + concat
OS-header comments — OS rules route correctly now, just aren't listed
in the static index yet.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
@github-actions

github-actions Bot commented Jul 5, 2026

Copy link
Copy Markdown

🤖 AI Code Review Complete

Review performed on changed files. Check inline comments for specific findings.

Severity Levels:

  • 🔴 Critical: Must fix (bugs, security, data loss)
  • 🟡 Warning: Should fix (performance, maintainability)
  • 🔵 Suggestion: Nice to have (style, alternatives)
  • Nit: Optional (cosmetic)

@nmccready
nmccready merged commit 8cddbdf into main Jul 5, 2026
6 checks passed
@nmccready
nmccready deleted the feat/65-remaining-polish branch July 5, 2026 13:40
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