Rename repo-memory runtime artifacts
This commit is contained in:
+1
-1
@@ -1,4 +1,4 @@
|
||||
package brief
|
||||
package documents
|
||||
|
||||
import (
|
||||
"crypto/sha256"
|
||||
+6
-6
@@ -1,4 +1,4 @@
|
||||
package brief
|
||||
package documents
|
||||
|
||||
import (
|
||||
"os"
|
||||
@@ -16,14 +16,14 @@ func TestParseFile(t *testing.T) {
|
||||
t.Fatal(err)
|
||||
}
|
||||
|
||||
file := filepath.Join(path, "repo-brief.md")
|
||||
file := filepath.Join(path, "repo-memory.md")
|
||||
content := strings.TrimSpace(`
|
||||
---
|
||||
title: Zeus Repo Brief
|
||||
title: Zeus Repo Memory
|
||||
repo: zeus
|
||||
---
|
||||
|
||||
# Repo Brief
|
||||
# Repo Memory
|
||||
|
||||
Intro text.
|
||||
|
||||
@@ -45,10 +45,10 @@ Intro text.
|
||||
t.Fatal(err)
|
||||
}
|
||||
|
||||
if got, want := doc.Title, "Zeus Repo Brief"; got != want {
|
||||
if got, want := doc.Title, "Zeus Repo Memory"; got != want {
|
||||
t.Fatalf("title = %q, want %q", got, want)
|
||||
}
|
||||
if got, want := doc.DocPath, "docs/ai/repo-brief.md"; got != want {
|
||||
if got, want := doc.DocPath, "docs/ai/repo-memory.md"; got != want {
|
||||
t.Fatalf("doc path = %q, want %q", got, want)
|
||||
}
|
||||
if len(doc.Sections) != 3 {
|
||||
@@ -9,7 +9,7 @@ import (
|
||||
"strings"
|
||||
"time"
|
||||
|
||||
"ai-workflow-skill/packages/repo-memory-runtime/internal/brief"
|
||||
"ai-workflow-skill/packages/repo-memory-runtime/internal/documents"
|
||||
_ "github.com/mattn/go-sqlite3"
|
||||
)
|
||||
|
||||
@@ -421,7 +421,7 @@ func (s *Store) UpsertEntry(ctx context.Context, in EntryInput) (int64, error) {
|
||||
return entryID, tx.Commit()
|
||||
}
|
||||
|
||||
func (s *Store) ImportDocument(ctx context.Context, doc brief.Document, repoState RepoState) error {
|
||||
func (s *Store) ImportDocument(ctx context.Context, doc documents.Document, repoState RepoState) error {
|
||||
repoState.RootPath = doc.RepoPath
|
||||
if _, err := s.UpsertRepo(ctx, repoState); err != nil {
|
||||
return err
|
||||
@@ -759,7 +759,7 @@ func classifyImportedKind(docKind, heading string) string {
|
||||
return "term"
|
||||
case "playbooks":
|
||||
return "entry"
|
||||
case "repo-brief":
|
||||
case "repo-memory", "repo-brief":
|
||||
switch {
|
||||
case strings.Contains(lowerHeading, "module"):
|
||||
return "module"
|
||||
|
||||
@@ -5,13 +5,13 @@ import (
|
||||
"path/filepath"
|
||||
"testing"
|
||||
|
||||
"ai-workflow-skill/packages/repo-memory-runtime/internal/brief"
|
||||
"ai-workflow-skill/packages/repo-memory-runtime/internal/documents"
|
||||
)
|
||||
|
||||
func TestImportDocumentAndSearch(t *testing.T) {
|
||||
t.Parallel()
|
||||
|
||||
dbPath := filepath.Join(t.TempDir(), "briefs.db")
|
||||
dbPath := filepath.Join(t.TempDir(), "repo-memory.db")
|
||||
st, err := Open(dbPath)
|
||||
if err != nil {
|
||||
t.Fatal(err)
|
||||
@@ -23,14 +23,14 @@ func TestImportDocumentAndSearch(t *testing.T) {
|
||||
t.Fatal(err)
|
||||
}
|
||||
|
||||
doc := brief.Document{
|
||||
doc := documents.Document{
|
||||
RepoPath: "/tmp/zeus",
|
||||
DocPath: "docs/ai/repo-brief.md",
|
||||
Kind: "repo-brief",
|
||||
Title: "Zeus Repo Brief",
|
||||
DocPath: "docs/ai/repo-memory.md",
|
||||
Kind: "repo-memory",
|
||||
Title: "Zeus Repo Memory",
|
||||
Hash: "abc",
|
||||
Metadata: map[string]string{"repo": "zeus"},
|
||||
Sections: []brief.Section{
|
||||
Sections: []documents.Section{
|
||||
{Heading: "Module Map", Level: 2, Ordinal: 1, Body: "AI insight lives in app/app and gateway."},
|
||||
{Heading: "Danger Zones", Level: 2, Ordinal: 2, Body: "Avoid shared libs first."},
|
||||
},
|
||||
@@ -67,7 +67,7 @@ func TestImportDocumentAndSearch(t *testing.T) {
|
||||
func TestUpsertEntryWithAliasesAndDependencies(t *testing.T) {
|
||||
t.Parallel()
|
||||
|
||||
dbPath := filepath.Join(t.TempDir(), "briefs.db")
|
||||
dbPath := filepath.Join(t.TempDir(), "repo-memory.db")
|
||||
st, err := Open(dbPath)
|
||||
if err != nil {
|
||||
t.Fatal(err)
|
||||
@@ -178,7 +178,7 @@ func TestUpsertEntryWithAliasesAndDependencies(t *testing.T) {
|
||||
func TestApplyVerificationResult(t *testing.T) {
|
||||
t.Parallel()
|
||||
|
||||
dbPath := filepath.Join(t.TempDir(), "briefs.db")
|
||||
dbPath := filepath.Join(t.TempDir(), "repo-memory.db")
|
||||
st, err := Open(dbPath)
|
||||
if err != nil {
|
||||
t.Fatal(err)
|
||||
|
||||
Reference in New Issue
Block a user