Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
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
3 changes: 3 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -39,4 +39,7 @@ ui/server/node_modules/
ui/server/dist/
ui/client/node_modules/
ui/client/dist/
/.dashboard/
/.orchestrator/
# legacy, see AUT-52; safe to `rm -rf .kip/` locally
/.kip/
8 changes: 4 additions & 4 deletions tools/kip-state/index.py
Original file line number Diff line number Diff line change
@@ -1,13 +1,13 @@
#!/usr/bin/env python3
r"""Build .kip/state.db from project sources.
r"""Build .dashboard/state.db from project sources.

Inputs:
blueprint/status.yaml - node lifecycle flags, comments
blueprint/src/chapters/*.tex - node IDs, kinds, edges (\uses), Lean bindings (\lean), \leanok
KIP/**/*.lean - declarations + sorry counts (per fully-qualified name)
agents/*/logs/run-*/ - agent runs (meta.json + .jsonl with session_end)

Output: .kip/state.db (SQLite, gitignored, safe to drop)
Output: .dashboard/state.db (SQLite, gitignored, safe to drop)

Usage:
python tools/kip-state/index.py [--project PATH] [--db PATH]
Expand Down Expand Up @@ -300,12 +300,12 @@ def main(argv: list[str] | None = None) -> int:
ap.add_argument("--project", type=Path, default=Path.cwd(),
help="KIP project root (default: cwd)")
ap.add_argument("--db", type=Path, default=None,
help="Output SQLite path (default: <project>/.kip/state.db)")
help="Output SQLite path (default: <project>/.dashboard/state.db)")
ap.add_argument("--quiet", action="store_true")
args = ap.parse_args(argv)

project: Path = args.project.resolve()
db_path: Path = args.db or (project / ".kip" / "state.db")
db_path: Path = args.db or (project / ".dashboard" / "state.db")
db_path.parent.mkdir(parents=True, exist_ok=True)

log = (lambda *a, **k: None) if args.quiet else (lambda *a, **k: print(*a, **k, file=sys.stderr))
Expand Down
2 changes: 1 addition & 1 deletion ui/client/src/views/Overview.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ export default function Overview() {
<div className={styles.root}>
<h2 className={styles.title}>State index unavailable</h2>
<div className={styles.empty}>
{health?.error || 'Run python tools/kip-state/index.py to build .kip/state.db.'}
{health?.error || 'Run python tools/kip-state/index.py to build .dashboard/state.db.'}
</div>
</div>
);
Expand Down
8 changes: 4 additions & 4 deletions ui/server/src/routes/nodes.ts
Original file line number Diff line number Diff line change
Expand Up @@ -196,7 +196,7 @@ function getChapterOrder(projectPath: string): string[] {
}

function openDb(projectPath: string): Database.Database | null {
const candidate = path.join(projectPath, '.kip', 'state.db');
const candidate = path.join(projectPath, '.dashboard', 'state.db');
if (!fs.existsSync(candidate)) return null;
const stat = fs.statSync(candidate);
if (dbInstance && dbPath === candidate && dbMtime === stat.mtimeMs) {
Expand All @@ -214,7 +214,7 @@ function openDb(projectPath: string): Database.Database | null {
// Separate write handle, used only by review actions. Each call opens / closes
// to avoid juggling cache invalidation alongside the readonly handle above.
function openDbForWrite(projectPath: string): Database.Database | null {
const candidate = path.join(projectPath, '.kip', 'state.db');
const candidate = path.join(projectPath, '.dashboard', 'state.db');
if (!fs.existsSync(candidate)) return null;
return new Database(candidate, { readonly: false, fileMustExist: true });
}
Expand Down Expand Up @@ -334,7 +334,7 @@ export function register(fastify: FastifyInstance, paths: ProjectPaths) {
if (!db) {
return {
ok: false,
error: 'No .kip/state.db found. Run: python tools/kip-state/index.py',
error: 'No .dashboard/state.db found. Run: python tools/kip-state/index.py',
};
}
const meta = db.prepare("SELECT key, value FROM meta").all() as { key: string; value: string }[];
Expand Down Expand Up @@ -557,7 +557,7 @@ export function register(fastify: FastifyInstance, paths: ProjectPaths) {
// approve_nl drafted → nl_reviewed
// confirm_alignment nl_reviewed+bound → aligned
// Source of truth is blueprint/status.yaml (what tools/kip-state/index.py
// reads on rebuild). We mirror the change into .kip/state.db so the dashboard
// reads on rebuild). We mirror the change into .dashboard/state.db so the dashboard
// reflects it immediately without re-running the indexer.
fastify.post<{
Params: { id: string };
Expand Down
Loading