Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
23 commits
Select commit Hold shift + click to select a range
f5baa13
perf(sequences): recurse on the projected database, not the full one
pablontiv Jul 25, 2026
fd30f8b
docs: plan systemic index compatibility
pablontiv Aug 18, 2026
5a053e8
feat(compat): add hermetic release schema inventory
pablontiv Aug 18, 2026
607863b
fix(compat): verify release schema fixtures
pablontiv Aug 18, 2026
d421c92
feat(compat): inspect released schema shapes
pablontiv Aug 18, 2026
4a3846d
fix(compat): load checked-in lineage signatures
pablontiv Aug 18, 2026
c81c9e7
fix(storage): migrate inspected lineages atomically
pablontiv Aug 19, 2026
7de2619
fix(compat): canonicalize equivalent schema shapes
pablontiv Aug 19, 2026
a24ebc5
fix(storage): harden legacy migration execution
pablontiv Aug 19, 2026
bb09d91
refactor(recovery): share canonical indexed record model
pablontiv Aug 19, 2026
2610295
feat(recovery): adapt supported indexes read-only
pablontiv Aug 19, 2026
01dea6c
feat(recovery): plan deterministic active stranded union
pablontiv Aug 19, 2026
a129aca
feat(cli): add read-only stranded recovery dry run
pablontiv Aug 19, 2026
5faae39
feat(recovery): build verified union destination
pablontiv Aug 19, 2026
8c42518
feat(recovery): atomically replace active with preserved backup
pablontiv Aug 19, 2026
3d081f6
fix(cli): block every stale index consumer
pablontiv Aug 19, 2026
c8cc21f
docs: add long-running agent execution runbook
pablontiv Aug 19, 2026
8687d1a
fix(cli): expose safe recovery from incompatible indexes
pablontiv Aug 19, 2026
c9a3c74
test(recovery): prove active stranded atomic union
pablontiv Aug 19, 2026
921066d
test(recovery): prove active stranded atomic union
pablontiv Aug 19, 2026
c8aa51e
docs: design recovered source accounting
pablontiv Aug 19, 2026
c8b0815
docs: plan recovered source accounting
pablontiv Aug 19, 2026
baefa03
chore: ignore local worktrees
pablontiv Aug 19, 2026
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,9 @@ graphify-out/
# Local Pi runtime state
.atl/
.codegraph/
.worktrees/

# Calibration worksheets carry private session text — never commit
docs/eval/corrections-labeling-*.csv
docs/eval/corrections-labeling-*.md
.pi/subagents-debug.log
18 changes: 11 additions & 7 deletions cmd/backscroll/annotate.go
Original file line number Diff line number Diff line change
@@ -1,13 +1,13 @@
package main

import (
"context"
"fmt"
"io"

"github.com/spf13/cobra"

"github.com/pablontiv/backscroll/internal/config"
"github.com/pablontiv/backscroll/internal/storage"
)

func newAnnotateCmd(stdout, stderr io.Writer) *cobra.Command {
Expand All @@ -20,8 +20,9 @@ func newAnnotateCmd(stdout, stderr io.Writer) *cobra.Command {
)

cmd := &cobra.Command{
Use: "annotate",
Short: "Annotate a message (agent-classification loop write surface)",
Use: "annotate",
Short: "Annotate a message (agent-classification loop write surface)",
SilenceUsage: true,
Long: `Annotate a message with a classification label. Validates message existence
before writing. Supports both uuid (preferred) and legacy source_path+ordinal
fallback. Re-annotating the same (source_path, ordinal, kind) replaces the label.`,
Expand All @@ -46,7 +47,7 @@ fallback. Re-annotating the same (source_path, ordinal, kind) replaces the label
}

func runAnnotate(stdout, stderr io.Writer,
uuid, path string, ordinal int, kind, label string) error {
uuid, path string, ordinal int, kind, label string) (retErr error) {

// Early flag validation
if uuid == "" && (path == "" || ordinal < 0) {
Expand All @@ -62,11 +63,14 @@ func runAnnotate(stdout, stderr io.Writer,
return fmt.Errorf("load config: %w", err)
}

db, err := storage.Open(cfg.DatabasePath)
db, diag, err := prepareIndex(context.Background(), cfg, indexMutation, false)
if diag != nil {
return refuseIndex(stdout, stderr, *diag, false, false)
}
if err != nil {
return fmt.Errorf("open database: %w", err)
return fmt.Errorf("prepare index: %w", err)
}
defer func() { _ = db.Close() }()
defer func() { retErr = closeIndexDB(db, retErr) }()

// Upsert annotation
if err := db.UpsertAnnotation(uuid, path, ordinal, kind, label); err != nil {
Expand Down
Loading