Files
archie/.okf/codebase/internal/store/store_test.md
T
sam 7c34bdae5a okf: scaffold knowledge bundle and MCP server config
Adds a harvested .okf/ knowledge bundle (codebase concepts + starter
architecture/services/rules scaffolding) and .mcp.json pointing at the
shared okf MCP service (http://localhost:8765/archie-core/), which
serves multiple projects' bundles from a single process.
2026-07-22 04:36:50 +10:00

898 B

description, resource, tags, timestamp, title, type
description resource tags timestamp title type
Source module internal/store/store_test.go (114 lines). internal/store/store_test.go
go
source
2026-07-21T18:36:22Z store_test.go Module

Module store_test.go

Path: internal/store/store_test.go
Lines: 114

Snippet Preview

package store

import (
	"context"
	"path/filepath"
	"testing"

	"github.com/samcharles93/archie-core/internal/events"
)

func openTest(t *testing.T) *Store {
	t.Helper()
	s, err := Open(filepath.Join(t.TempDir(), "test.db"))
	if err != nil {
		t.Fatal(err)
	}
	t.Cleanup(func() {
		if err := s.Close(); err != nil {
			t.Errorf("close store: %v", err)
		}
	})
	return s
}

func TestEnqueueIsIdempotent(t *testing.T) {
	s := openTest(t)
	ctx := context.Background()

	ins, err := s.EnqueueIssue(ctx, "sam", "todo", 1, "add tests", "body", "archie")
	if err != nil || !ins {