Files
Willie 6e176ddb0c feat(extras): share Markdown memory across agents (#349)
* feat(extras): add shared Markdown memory management

Store user-managed notes in extras/memory for global and project scopes.
Add CLI operations, a nested dashboard browser, versioned edits, and
backup-backed deletion and recovery.

Connect selected agents with reviewed, marked reading guidance while
preserving existing instruction files and routes. Add explicit INDEX
linking, conflict draft comparison, and copy-content previews.

Document the workflow in five website locales with English screenshots
and translate dashboard copy across all eleven locales. Native automatic
memory remains separate from this shared file overlay.

Validation: make check; 22 UI tests; TypeScript and ESLint; production UI
build; six isolated CLI E2E steps; five-locale website build; explicit
Claude-write/fresh-Codex-read smoke test.

* feat(memory): support dashboard note moves and redesign browser

Add version-checked rename and folder moves without replacing existing notes.
Back up the old path and preserve content and permissions while refreshing
selection, search, index warnings, and backup links.

Integrate the two-pane Memory browser and compact agent controls. Refresh all
English screenshots and document move/link/history behavior in five locales.

Validation: make check, scoped UI tests, TypeScript, ESLint, UI production build,
five-locale website build, locale parity, and visible Chrome workflow checks.

* fix(memory): recheck reviewed files before committing changes

Preserve external edits detected after note backup or draft preparation, and create new notes exclusively. Revalidate each guidance file before writing, report stale partial failures, and correct the built-in move/rename documentation.

* fix(memory): repair initialization and preserve note recovery scope

Detect missing starter files before dashboard note creation and refresh the index after initialization. Honor requested backup paths, include external project memory sources in recovery scope, and log initialization failures after partial mutations.

* fix(memory): protect guidance creates and match Windows history paths

Create new reviewed instruction files exclusively to preserve competing writes. Match Windows history links with native backup paths while keeping POSIX names and backup API paths intact.

* fix(memory): require configured extra for external backup access

Keep project backup scope inside the repository unless a valid memory folder extra enables its external source. Cover listing, version preview and restore denial without changing configured-source recovery.

* fix(memory): lock backup scope validation through restore

Validate project memory backup access under the restore write lock so concurrent extra deletion cannot revoke access between validation and writing. Hold read locks across scoped backup reads as well.
2026-10-03 14:16:58 +08:00

35 lines
948 B
Go

package memory
import (
"os"
"path/filepath"
"strings"
"testing"
)
func TestListKeepsValidNotesBesideInvalidExternalFiles(t *testing.T) {
root := t.TempDir()
for name, content := range map[string][]byte{
"valid.md": []byte("# Valid\nFind this note."),
"large.md": []byte(strings.Repeat("x", MaxNoteBytes+1)),
"binary.md": {0xff, 0xfe},
} {
if err := os.WriteFile(filepath.Join(root, name), content, 0644); err != nil {
t.Fatal(err)
}
}
notes, err := List(root, "")
if err != nil || len(notes) != 3 {
t.Fatalf("expected all files with valid notes still available: %v, %v", notes, err)
}
found, err := List(root, "find this")
if err != nil || len(found) != 1 || found[0].Path != "valid.md" {
t.Fatalf("valid note search: %+v, %v", found, err)
}
for _, path := range []string{"large.md", "binary.md"} {
if _, err := Read(root, path); err == nil {
t.Fatalf("invalid note remains unreadable: %s", path)
}
}
}