Repository navigation
Conversation
Move OpenShell policy generation from non-deterministic Claude Code reasoning to declarative YAML component files with a two-tier catalog (remote GitHub repo + embedded fallback). Capture fetches matching components, build refresh assembles the policy deterministically. Assisted-By: 🤖 Claude Code
Add entries for 060 (OpenShell testing findings) and 061 (deterministic policy generation). Update open threads with testing workarounds and catalog design questions. Assisted-By: 🤖 Claude Code
Replace non-deterministic Claude-powered policy generation with declarative YAML component files and a three-tier catalog system (embedded, cached catalog, user-local). Assisted-By: 🤖 Claude Code
Wires up FetchAndCacheCatalog to a new CLI subcommand that fetches policy components from github.com/cc-deck/openshell-policies and caches them in openshell/components/ for use by build refresh. Assisted-By: 🤖 Claude Code
build refresh now fetches catalog components automatically when an OpenShell target is configured. Use --no-fetch for offline mode. Removes the standalone catalog-update subcommand. Assisted-By: 🤖 Claude Code
When re-running capture on a manifest with existing targets, show current settings and default to keeping them. In --all mode, skip target prompts entirely. Ensures build refresh always runs after manifest changes when an OpenShell target is configured. Assisted-By: 🤖 Claude Code
Deletes build.yaml and config/ before running the wizard so users can start from scratch without manual cleanup. Combines with --all for a fully automated fresh capture. Assisted-By: 🤖 Claude Code
Use absolute cursor positioning to place the note icon at a fixed column instead of padding-based alignment. Prevents the icon from shifting as the status text width changes. Assisted-By: 🤖 Claude Code
Describes extracting policy.yaml from OCI images at ws new time using go-containerregistry, with build-time layer labeling for efficient single-layer fetch and fallback layer scanning. Reverts the host-path auto-resolution approach since the policy should come from the image, not the build directory. Assisted-By: 🤖 Claude Code
Assisted-By: 🤖 Claude Code
Assisted-By: 🤖 Claude Code
- Resolve merge conflict markers in go.mod, go.sum, README.md, and cli.adoc left from a prior stash operation - Fix dead assertion in extract_test.go where a closure was assigned to _ but never called, making the labels emptiness check unreachable - Regenerate go.sum via go mod tidy - Mark remaining unmerged env files as resolved Assisted-By: 🤖 Claude Code
The merge conflict resolution commit (13bb498) incorrectly introduced internal/env/ and internal/cmd/env.go files that belong to a different feature branch. These files reference undefined types (EnvironmentType, StorageConfig, FileStateStore, etc.) causing build failures. They have no connection to the 060-oci-policy-extraction feature. Assisted-By: 🤖 Claude Code
Resolve conflict markers in go.mod (4 blocks), go.sum (12 blocks), README.md (2 blocks), and cli.adoc (3 blocks) left from a prior stash pop. Remove stale internal/env/ and internal/cmd/env.go files that belong to a different feature. Regenerate go.sum via go mod tidy. Assisted-By: 🤖 Claude Code
When --target openshell is passed to build init, automatically run the refresh logic (snippet extraction, catalog fetch, policy assembly) so the setup directory is ready to build without a separate build refresh step. Also add review artifacts from 060-oci-policy-extraction. Assisted-By: 🤖 Claude Code
Makes the flags visible in Claude Code's command picker autocomplete. Assisted-By: 🤖 Claude Code
Build should only build, not manage workspaces. Replaced auto ws-new calls in SSH (B9) and OpenShell (C9) sections with next-steps hints, matching the container section pattern. Assisted-By: 🤖 Claude Code
go-containerregistry's name.ParseReference normalizes
"localhost/repo:tag" to "docker.io/localhost/repo:tag" by default.
The daemon.ImageSave call uses ref.Name() (normalized), which
breaks podman lookups for local images.
Fix by passing name.WithDefaultRegistry("") to preserve the
original reference as-is.
Assisted-By: 🤖 Claude Code
The /cc-deck.build command was running podman build directly, bypassing the CLI's post-build label stamping. Now calls cc-deck build run which handles both the build and the dev.cc-deck.policy-layer label injection. Assisted-By: 🤖 Claude Code
Without WithBufferedOpener, go-containerregistry calls ImageSave (full image export) for every layer access during the fallback scan. For a 57-layer image this caused a 53-second delay. Buffering exports the image once and reads layers from memory. Assisted-By: 🤖 Claude Code
For local daemon images, first open unbuffered (config-only, fast) to check for the policy layer label. If labeled, fetch just that one layer without ever exporting the full image. Only fall back to buffered mode (single full export) when the label is missing and a reverse layer scan is needed. This avoids loading multi-GB images into memory when the label is present. For remote registry images, all access remains lazy (per-layer fetch), so only inspected layers are downloaded. Assisted-By: 🤖 Claude Code
Replace go-containerregistry daemon.Image (which calls ImageSave, exporting the full image) with runtime create + cp for local images. This reads directly from the overlay filesystem and completes in under a second for any image size. The go-containerregistry path is kept for remote registry images, where lazy per-layer fetch is already efficient. Assisted-By: 🤖 Claude Code
The allowed_domains loop was writing group names (e.g., "github") as literal hostnames in the policy, overwriting correct catalog entries that had real domains with binaries and access rules. Now: catalog/embedded components take precedence. Groups not covered by a component are expanded via the network.Resolver to actual domains. Literal domains (with dots) pass through unchanged. Added 5 tests covering: catalog precedence, group expansion, literal domains, unknown groups, and mixed entries. Assisted-By: 🤖 Claude Code
The Rust, Go, Node, and Python policy components were missing the binaries field. Without it, OpenShell blocks all processes from accessing those registries (CONNECT tunnel 403). Added binary paths for cargo, go, npm/node/npx, pip/uv covering common install locations (/usr/bin, /usr/local/bin, /sandbox/). Assisted-By: 🤖 Claude Code
Assisted-By: 🤖 Claude Code
Replace hardcoded binary paths in embedded policy components (go, rust, node, python) with automatic resolution from the build manifest's tools section. Package-installed tools resolve to /usr/bin/<name>, github-release tools use their install_path, and a well-known paths table adds common alternative locations. Components with explicit binaries are preserved as overrides. Assisted-By: 🤖 Claude Code
|
Caution Review failedPull request was closed or merged during review 📝 WalkthroughWalkthroughAdds deterministic policy assembly from YAML components, automatic binary resolution, OCI policy extraction with image-label fast path and layer-scan fallback, an OpenShell getifaddrs LD_PRELOAD shim, a build refresh command, wiring in CLI/build/workspace flows, extensive tests, and updated docs/specs. Removes legacy Specify scripts/templates. ChangesOpenShell deterministic policy, OCI extraction, and shim
Sequence Diagram(s)sequenceDiagram
participant User
participant Build as cc-deck build run/refresh
participant Emb as Embedded Components
participant Catalog as Cached Catalog
participant Local as User-Local Policies
participant OCI as oci.Label/Extract
participant WS as ws new --type openshell
User->>Build: build refresh
Build->>Emb: load components
Build->>Catalog: overlay components (if cached)
Build->>Local: apply overrides
Build-->>Build: assemble deterministic policy.yaml
User->>Build: build run --target openshell
Build->>OCI: StampPolicyLabel(image, policy layer)
User->>WS: ws new --image=<ref>
WS->>OCI: ExtractFileFromImage(ref, policy.yaml)
OCI-->>WS: policy bytes (label fast path or scan)
WS-->>User: sandbox created with policy
Estimated code review effort🎯 5 (Critical) | ⏱️ ~120 minutes Poem
✨ Finishing Touches📝 Generate docstrings
🧪 Generate unit tests (beta)
|
Collaborator
Author
|
Merged locally to main |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Spec
Feature spec:
specs/061-policy-binary-resolution/spec.mdAll 9 functional requirements (FR-001 through FR-009) implemented and verified. 164 build package tests pass. Lint clean.
Test plan
resolveBinaries()covering package tools, github-release tools, explicit override preservation, missing tools, deduplication, case-insensitive lookuppolicy_test.goverifying end-to-end assembly with binary resolutionmake testpasses (pre-existing compose_smoke_test failures unrelated to this change)make lintpassesAssisted-By: 🤖 Claude Code
Summary by CodeRabbit
New Features
cc-deck build refreshcommand for regenerating Containerfile snippets and policiesBug Fixes
Documentation