fix(agents): relocate provenance sources.md outside agents/ dir

`claude plugin validate --strict` auto-discovers every .md under a
plugin's agents/ directory as an agent requiring frontmatter, so the
provenance file there always needs fake agent frontmatter to pass
validation. Confirmed empirically that an explicit `agents` manifest
array can't suppress this discovery. Move the file to <plugin-root>/
sources.md instead, and update agent-author/agent-audit accordingly.

Adds ADR-0010, partially superseding ADR-0005's `agents/sources.md`
convention. Fixes #63.

Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
This commit is contained in:
2026-07-05 09:01:06 +00:00
parent 5deed07a95
commit 996d9be428
16 changed files with 125 additions and 68 deletions

View File

@@ -85,13 +85,13 @@ You are a test agent.
EOF
}
# Helper: create a valid agents/sources.md with one entry
# Helper: create a valid sources.md with one entry
make_sources_md() {
local root="$1"
local slug="${2:-my-source}"
local contrib="${3:-agents/my-agent.md, agents/my-agent.agent.md}"
local research="${4:-(none)}"
cat > "$root/agents/sources.md" <<EOF
cat > "$root/sources.md" <<EOF
# Sources
## ${slug}
@@ -155,10 +155,10 @@ EOF
}
# ---------------------------------------------------------------------------
# Check 0: source_keys present but agents/sources.md absent → FAIL
# Check 0: source_keys present but sources.md absent → FAIL
# ---------------------------------------------------------------------------
@test "FAIL: source_keys in CC file but agents/sources.md absent" {
@test "FAIL: source_keys in CC file but sources.md absent" {
local root="$TMPDIR/plugin"
make_plugin "$root"
make_cc_with_source_keys "$root"
@@ -168,7 +168,7 @@ EOF
assert_output --partial "FAIL"
}
@test "FAIL: source_keys in Copilot file but agents/sources.md absent" {
@test "FAIL: source_keys in Copilot file but sources.md absent" {
local root="$TMPDIR/plugin"
make_plugin "$root"
make_clean_pair "$root"
@@ -179,15 +179,15 @@ EOF
}
# ---------------------------------------------------------------------------
# Check 1: FILL IN: placeholder in agents/sources.md → FAIL
# Check 1: FILL IN: placeholder in sources.md → FAIL
# ---------------------------------------------------------------------------
@test "FAIL: FILL IN: placeholder in agents/sources.md" {
@test "FAIL: FILL IN: placeholder in sources.md" {
local root="$TMPDIR/plugin"
make_plugin "$root"
make_cc_with_source_keys "$root"
make_copilot_with_source_keys "$root"
cat > "$root/agents/sources.md" <<EOF
cat > "$root/sources.md" <<EOF
# Sources
## my-source
@@ -203,22 +203,22 @@ EOF
assert_output --partial "FAIL"
}
@test "FILL IN: inside backticks in agents/sources.md does not fail" {
@test "FILL IN: inside backticks in sources.md does not fail" {
local root="$TMPDIR/plugin"
make_plugin "$root"
make_cc_with_source_keys "$root"
make_copilot_with_source_keys "$root"
make_sources_md "$root"
echo "Use \`FILL IN: value\` as example." >> "$root/agents/sources.md"
echo "Use \`FILL IN: value\` as example." >> "$root/sources.md"
run bash "$SCRIPT" "$root/agents/my-agent.md"
assert_success
}
# ---------------------------------------------------------------------------
# Check 2: source_keys slug missing from agents/sources.md → FAIL
# Check 2: source_keys slug missing from sources.md → FAIL
# ---------------------------------------------------------------------------
@test "FAIL: source_keys slug in CC file not present as H2 in agents/sources.md" {
@test "FAIL: source_keys slug in CC file not present as H2 in sources.md" {
local root="$TMPDIR/plugin"
make_plugin "$root"
make_cc_with_source_keys "$root" "my-agent" "my-source"
@@ -229,7 +229,7 @@ EOF
assert_output --partial "FAIL"
}
@test "FAIL: source_keys slug in Copilot file not present as H2 in agents/sources.md" {
@test "FAIL: source_keys slug in Copilot file not present as H2 in sources.md" {
local root="$TMPDIR/plugin"
make_plugin "$root"
make_clean_pair "$root"
@@ -244,7 +244,7 @@ EOF
# Check 4: Contributing file path doesn't exist → FAIL
# ---------------------------------------------------------------------------
@test "FAIL: Contributing file listed in agents/sources.md does not exist" {
@test "FAIL: Contributing file listed in sources.md does not exist" {
local root="$TMPDIR/plugin"
make_plugin "$root"
make_cc_with_source_keys "$root"
@@ -269,12 +269,12 @@ EOF
# Check 6: Research doc field missing or placeholder → FAIL
# ---------------------------------------------------------------------------
@test "FAIL: Research doc field missing from agents/sources.md entry" {
@test "FAIL: Research doc field missing from sources.md entry" {
local root="$TMPDIR/plugin"
make_plugin "$root"
make_cc_with_source_keys "$root"
make_copilot_with_source_keys "$root"
cat > "$root/agents/sources.md" <<EOF
cat > "$root/sources.md" <<EOF
# Sources
## my-source
@@ -294,7 +294,7 @@ EOF
make_plugin "$root"
make_cc_with_source_keys "$root"
make_copilot_with_source_keys "$root"
cat > "$root/agents/sources.md" <<EOF
cat > "$root/sources.md" <<EOF
# Sources
## my-source
@@ -330,7 +330,7 @@ You are a test agent.
EOF
make_copilot_clean "$root"
# sources.md says my-agent.md contributed to my-source, but my-agent.md doesn't list my-source
cat > "$root/agents/sources.md" <<EOF
cat > "$root/sources.md" <<EOF
# Sources
## other-source