feat(types): add template molecules infrastructure for beads-1ra
Add support for template molecules (is_template field and TypeMolecule type): - Add IsTemplate field to Issue type with JSON support - Add TypeMolecule constant to IssueType constants - Add IsTemplate filter to IssueFilter for querying - Update all SQL queries to include is_template column - Add migration 024 for is_template column - Add FindMoleculesJSONLInDir helper for molecules.jsonl path detection This enables treating certain issues as read-only templates that can be instantiated to create work items. The template flag allows separating template molecules from regular work items in queries and exports. 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
This commit is contained in:
@@ -2,6 +2,7 @@
|
||||
package utils
|
||||
|
||||
import (
|
||||
"os"
|
||||
"path/filepath"
|
||||
)
|
||||
|
||||
@@ -55,6 +56,19 @@ func FindJSONLInDir(dbDir string) string {
|
||||
return filepath.Join(dbDir, "issues.jsonl")
|
||||
}
|
||||
|
||||
// FindMoleculesJSONLInDir finds the molecules.jsonl file in the given .beads directory.
|
||||
// Returns the path to molecules.jsonl if it exists, empty string otherwise.
|
||||
// Molecules are template issues used for instantiation (beads-1ra).
|
||||
func FindMoleculesJSONLInDir(dbDir string) string {
|
||||
moleculesPath := filepath.Join(dbDir, "molecules.jsonl")
|
||||
// Check if file exists - we don't fall back to any other file
|
||||
// because molecules.jsonl is optional and specific
|
||||
if _, err := os.Stat(moleculesPath); err == nil {
|
||||
return moleculesPath
|
||||
}
|
||||
return ""
|
||||
}
|
||||
|
||||
// CanonicalizePath converts a path to its canonical form by:
|
||||
// 1. Converting to absolute path
|
||||
// 2. Resolving symlinks
|
||||
|
||||
Reference in New Issue
Block a user