Compare commits

..

4 commits

3 changed files with 59 additions and 6 deletions

View file

@ -39,9 +39,17 @@ which matters on a small local model.
5. On a real contradiction with an existing claim, follow `AGENTS.md` §Conflict: create
`wiki/queries/conflict-<concept>-<YYYY-MM-DD>.md`. Never overwrite the existing page.
Name files in kebab-case and pick stable names. Read `wiki/index.md` (and the specific
pages it points to) to decide create-vs-update and to spot contradictions. Do not scan
whole directories.
**Naming — you are the sole author of these names; nothing renames your files.** Use
minimal kebab-case: lowercase letters, digits and hyphens only — no spaces, no underscores,
no capitals. Pick stable names so the same entity is never created twice (always `acme`,
never also `acme-corp`). The path you write a file to MUST be byte-for-byte the path you
list in the manifest.
**Deciding create-vs-update and spotting contradictions — mind the context budget.** Use
`wiki/index.md` to locate existing pages, then read **only** the handful that _this source
actually names_ — the entities and concepts in the source's title and opening paragraphs —
not everything the index lists. When in doubt, read fewer: a missed cross-link is far
cheaper than a saturated context. Never scan whole directories.
## Finish: write the manifest, then STOP
@ -52,7 +60,6 @@ append to the log/index, or open anything.
```json
{
"raw_source": "raw/articles/foo.md",
"model": "<the model you are running as>",
"reasoning": "One sentence for the log: what changed and why.",
"pr_summary": "One or two sentences describing this ingest for the PR.",
"contradictions": "None (or: 1 conflict file created — <concept>)",
@ -66,7 +73,6 @@ append to the log/index, or open anything.
{
"path": "wiki/entities/acme.md",
"summary": "Acme — vendor.",
"maturity": "draft",
"status": "modified"
}
]
@ -78,6 +84,10 @@ Manifest rules:
- List every page you created or modified, with `status` `created` or `modified`.
- `summary` is the one-line index description (≈12 words max). For conflict pages the
summary is ignored — the index lists conflicts by slug only.
- `maturity` is required only on `created` pages (it seeds the new index entry). It is
ignored for `modified` pages, so omit it there.
- Do NOT add a `model` field — the orchestrator records which model produced this run; you
cannot know your own model name reliably, so do not guess one.
- Do not invent a `run_id`, branch, commit, or PR — those belong to the post-processor.
One source per session. After writing the manifest, stop.

View file

@ -27,7 +27,9 @@ command -v python3 >/dev/null 2>&1 || fail "deps" "python3 missing (needed by in
# --- read manifest scalars ---
raw_source="$(jq -r '.raw_source' "$manifest")"
model="$(jq -r '.model // "unknown"' "$manifest")"
# model name comes from the orchestrator/wrapper (INGEST_MODEL); the agent cannot know its
# own tag, so we do not trust a self-reported manifest field. Fall back only if unset.
model="${INGEST_MODEL:-$(jq -r '.model // "unknown"' "$manifest")}"
reasoning="$(jq -r '.reasoning // "Ingest."' "$manifest")"
pr_summary="$(jq -r '.pr_summary // "Ingest."' "$manifest")"
contradictions="$(jq -r '.contradictions // "None"' "$manifest")"

View file

@ -91,3 +91,44 @@ EOF
# listed by slug under the Conflicts section
grep -q 'queries/conflict-pricing-2026-06-03' wiki/index.md
}
@test "run-ingest: records INGEST_MODEL in the log (manifest carries no model field)" {
command -v jq >/dev/null 2>&1 || skip "jq not installed"
G="$(make_fixture_genome)"; cd "$G"
cat > wiki/sources/test-source.md <<'EOF'
---
title: "Test Source"
type: source
domain: genome-test
tags: [t]
maturity: draft
last_updated: 2026-06-04
private: false
---
body
EOF
# New contract: NO "model" field — the orchestrator supplies it via INGEST_MODEL.
cat > .ingest-manifest.json <<'EOF'
{
"raw_source": "raw/articles/test.md",
"reasoning": "Ingested the test source.",
"pr_summary": "Ingest of test: 1 source page.",
"contradictions": "None",
"pages": [
{"path": "wiki/sources/test-source.md", "summary": "A smoke-test source.", "maturity": "draft", "status": "created"}
]
}
EOF
export KG_LIB_DIR="$LIB_DIR"
export FORGEJO_URL="http://forgejo.local" FORGEJO_USER="u" FORGEJO_TOKEN="t" DRY_RUN=1
export INGEST_MODEL="qwen-test-tag"
run bash "$SKILL_SCRIPTS/run-ingest.sh" genome-test
[ "$status" -eq 0 ]
[[ "$output" == *'"status":"ok"'* ]]
grep -q 'qwen-test-tag' wiki/log.md
}