Skip to content

Selective compilation with -s flag #66

@jlowin

Description

@jlowin

Summary

Add -s / --select flag to colin run to compile only the subgraph needed for specific files. The flag name allows future expansion to support glob patterns, tags, or subproject selectors.

Agent Context

Must read:

Blocked by: #62 (storage architecture must be implemented first)

Behavior

# Compile only file.md's subgraph, publish file.md + public deps
colin run -s file.md

# Multiple selections
colin run -s file1.md -s file2.md

# Don't clean output/ first (additive)
colin run -s file.md --no-clean

Default colin run (no -s)

  1. Compile all files
  2. Clean output/
  3. Publish all public files

With -s file.md

  1. Compute minimum subgraph to produce selected file
  2. Compile subgraph (cache hits where possible)
  3. Clean output/
  4. Publish selected file + its public refs

Implementation

  • Add -s / --select flag (repeatable)
  • Add --no-clean flag
  • Subgraph traversal: walk refs from selected file(s)
  • Manifest: merge updates (don't touch entries outside subgraph)
  • Cache in .colin/compiled/ preserved for files not in subgraph

Future expansion

The --select flag can grow to support richer selectors:

  • --select "models/*.md" - glob patterns
  • --select "tag:public" - tag filters
  • --select "project:auth" - subproject filters

Use cases

  • Large project, only need one output
  • Faster iteration during development
  • Minimize LLM calls when only one file changed

Related

Metadata

Metadata

Assignees

No one assigned

    Labels

    cliCLI commands, CLI tools, or command-line interface functionalityenhancementNew feature or request

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions