docs: add Contract sections + tag tests to contract items (Tier 2 — 10 files)
Some checks failed
Deploy (Gitea) / deploy (push) Failing after 2s

This commit is contained in:
2026-05-05 12:19:25 -04:00
parent ea1150f38e
commit dcb5a1f1a6
20 changed files with 168 additions and 52 deletions

View File

@@ -24,6 +24,15 @@ A naive implementation that serializes every ~org-object~ to text would produce
The semantic threshold is configurable via ~CONTEXT_SEMANTIC_THRESHOLD~ env var (default 0.75). Lower values include more peripherally related content; higher values restrict to tightly related content.
** Contract
1. (context-awareness-assemble &optional signal): produces a skeletal
outline of current Memory for the LLM. If ~:foveal-focus~ is set,
the foveal node gets inline rendering; peripheral nodes get title-only.
Privacy-filtered objects are excluded.
2. (context-assemble-global-awareness): zero-arg wrapper — calls
~context-awareness-assemble~ without foveal focus.
* Implementation
** Package Context
@@ -300,6 +309,7 @@ Verifies that the Foveal-Peripheral rendering correctly distinguishes between fo
(in-suite vision-suite)
(test test-foveal-rendering
"Contract 1: foveal content inline, peripheral content title-only."
(clrhash passepartout::*memory-store*)
(let* ((ast '(:type :HEADLINE :properties (:ID "proj-root" :TITLE "Project" :TAGS ("project"))
:contents ((:type :HEADLINE :properties (:ID "node-foveal" :TITLE "Foveal Node")
@@ -313,6 +323,7 @@ Verifies that the Foveal-Peripheral rendering correctly distinguishes between fo
(is (not (search "PERIPHERAL CONTENT" output))))))
(test test-awareness-budget
"Contract 1: all active projects appear in awareness output."
(clrhash passepartout::*memory-store*)
(ingest-ast '(:type :HEADLINE :properties (:ID "p1" :TITLE "Project 1" :TAGS ("project")) :contents nil))
(ingest-ast '(:type :HEADLINE :properties (:ID "p2" :TITLE "Project 2" :TAGS ("project")) :contents nil))
@@ -321,14 +332,14 @@ Verifies that the Foveal-Peripheral rendering correctly distinguishes between fo
(is (search "Project 2" output))))
(test test-context-empty-memory
"An empty memory should produce a clean awareness output without errors."
"Contract 1: empty memory produces clean output without error."
(clrhash passepartout::*memory-store*)
(let ((output (context-awareness-assemble)))
(is (stringp output))
(is (search "MEMEX" output :test #'char-equal))))
(test test-context-no-foveal-focus
"Without a foveal focus, all content should be peripheral (no inline content)."
"Contract 2: without foveal focus, no inline content appears."
(clrhash passepartout::*memory-store*)
(let* ((ast '(:type :HEADLINE :properties (:ID "root" :TITLE "Root" :TAGS ("project"))
:contents ((:type :HEADLINE :properties (:ID "child" :TITLE "Child Node")