From 23c9d1edaede3d107fab840551222eb69fc90034 Mon Sep 17 00:00:00 2001 From: Jared Rickert Date: Sat, 8 Aug 2026 14:39:02 -0500 Subject: [PATCH] feat(integrations): re-discover knowledge and audit orphans at review The review gate trusted the plan's original knowledge cover and let artifacts outlive the behavior they described. Recompute discovery against the final tree before assigning a verdict, so a contract found late expands the gating cover, and audit retained comments, tests, docs, config, fixtures, telemetry, and generated files for a surviving subject or consumer. --- .../tapper-dev/skills/tapper-dev/SKILL.md | 21 +++++++++++++++++++ .../tapper-dev/skills/tapper-dev/SKILL.md | 21 +++++++++++++++++++ pkg/integrations/adapters/claude_test.go | 16 ++++++++++++++ pkg/integrations/adapters/codex_test.go | 16 ++++++++++++++ .../renderdata/developer/workflow.md | 21 +++++++++++++++++++ 5 files changed, 95 insertions(+) diff --git a/integrations/rendered/claude/tapper-dev/skills/tapper-dev/SKILL.md b/integrations/rendered/claude/tapper-dev/skills/tapper-dev/SKILL.md index b2af464..09e25f7 100644 --- a/integrations/rendered/claude/tapper-dev/skills/tapper-dev/SKILL.md +++ b/integrations/rendered/claude/tapper-dev/skills/tapper-dev/SKILL.md @@ -37,6 +37,27 @@ applicable invariants agree. A failed or incomplete gate returns work to the earliest stage that can correct it. Do not turn `checking` or `conflict` into success through prose. +Before assigning a verdict, recompute knowledge discovery against the final +tree rather than trusting only the plan's original cover. Start from the +touched KEG subjects and the vocabulary and behavior changed by the diff. Use +targeted `mcp__tapper__backlinks`, `mcp__tapper__links`, and +`mcp__tapper__grep` calls in the active flight's covered KEGs to find plausible +decisions, patterns, research, incidents, interfaces, and verifications, then +read only the relevant notes. Informative knowledge guides interpretation; +only applicable active or stale interfaces and verifications enter gating +cover. A relevant contract discovered late expands the cover and sends the +work back through any newly required gates. + +Audit every retained comment, test, document, configuration value, fixture, +telemetry hook, and generated artifact that refers to removed, deprecated, or +legacy behavior. Each needs a surviving subject or consumer such as current +observable behavior, an accepted decision, a compatibility or migration +boundary, a security or protocol prohibition, or an active invariant. If its +only owner is the removal or obsolete implementation, treat it as orphaned +noise and return the work for correction. Rewrite artifacts around a broader +surviving invariant when that is the real contract; do not reject an artifact +merely because it uses the word `legacy`. + ## Commit Commit only the reviewed tree and follow the repository's commit convention. diff --git a/integrations/rendered/codex/tapper-dev/skills/tapper-dev/SKILL.md b/integrations/rendered/codex/tapper-dev/skills/tapper-dev/SKILL.md index b2af464..09e25f7 100644 --- a/integrations/rendered/codex/tapper-dev/skills/tapper-dev/SKILL.md +++ b/integrations/rendered/codex/tapper-dev/skills/tapper-dev/SKILL.md @@ -37,6 +37,27 @@ applicable invariants agree. A failed or incomplete gate returns work to the earliest stage that can correct it. Do not turn `checking` or `conflict` into success through prose. +Before assigning a verdict, recompute knowledge discovery against the final +tree rather than trusting only the plan's original cover. Start from the +touched KEG subjects and the vocabulary and behavior changed by the diff. Use +targeted `mcp__tapper__backlinks`, `mcp__tapper__links`, and +`mcp__tapper__grep` calls in the active flight's covered KEGs to find plausible +decisions, patterns, research, incidents, interfaces, and verifications, then +read only the relevant notes. Informative knowledge guides interpretation; +only applicable active or stale interfaces and verifications enter gating +cover. A relevant contract discovered late expands the cover and sends the +work back through any newly required gates. + +Audit every retained comment, test, document, configuration value, fixture, +telemetry hook, and generated artifact that refers to removed, deprecated, or +legacy behavior. Each needs a surviving subject or consumer such as current +observable behavior, an accepted decision, a compatibility or migration +boundary, a security or protocol prohibition, or an active invariant. If its +only owner is the removal or obsolete implementation, treat it as orphaned +noise and return the work for correction. Rewrite artifacts around a broader +surviving invariant when that is the real contract; do not reject an artifact +merely because it uses the word `legacy`. + ## Commit Commit only the reviewed tree and follow the repository's commit convention. diff --git a/pkg/integrations/adapters/claude_test.go b/pkg/integrations/adapters/claude_test.go index d8e58b9..7d0234d 100644 --- a/pkg/integrations/adapters/claude_test.go +++ b/pkg/integrations/adapters/claude_test.go @@ -96,6 +96,22 @@ func TestClaudeAdapter_BaselineExcludesDeveloperLifecycle(t *testing.T) { t.Errorf("developer workflow missing %s", heading) } } + for _, want := range []string{ + "recompute knowledge discovery", + "`mcp__tapper__backlinks`", + "`mcp__tapper__links`", + "`mcp__tapper__grep`", + "active or stale interfaces and verifications", + "Each needs a surviving subject or consumer", + "word `legacy`", + } { + if !strings.Contains(dev, want) { + t.Errorf("developer review workflow missing %q", want) + } + } + if strings.Contains(dev, "@foldwise/dev") { + t.Error("developer review workflow must not hardcode a project-specific KEG") + } } func TestStripLeadingH1(t *testing.T) { diff --git a/pkg/integrations/adapters/codex_test.go b/pkg/integrations/adapters/codex_test.go index c2154bc..dce5cf8 100644 --- a/pkg/integrations/adapters/codex_test.go +++ b/pkg/integrations/adapters/codex_test.go @@ -223,6 +223,22 @@ func TestCodexAdapter_SeparatesBaselineAndDeveloperWorkflow(t *testing.T) { if !strings.Contains(dev, "baseline `tapper` plugin is required") || strings.Contains(string(mem.Files()["codex/tapper-dev/.codex-plugin/plugin.json"]), "mcpServers") { t.Errorf("Codex prerequisite/MCP separation is wrong") } + for _, want := range []string{ + "recompute knowledge discovery", + "`mcp__tapper__backlinks`", + "`mcp__tapper__links`", + "`mcp__tapper__grep`", + "active or stale interfaces and verifications", + "Each needs a surviving subject or consumer", + "word `legacy`", + } { + if !strings.Contains(dev, want) { + t.Errorf("developer review workflow missing %q", want) + } + } + if strings.Contains(dev, "@foldwise/dev") { + t.Error("developer review workflow must not hardcode a project-specific KEG") + } } func TestPluginVersionNormalizesReleaseTag(t *testing.T) { diff --git a/pkg/integrations/renderdata/developer/workflow.md b/pkg/integrations/renderdata/developer/workflow.md index 7ece88d..43ab6cc 100644 --- a/pkg/integrations/renderdata/developer/workflow.md +++ b/pkg/integrations/renderdata/developer/workflow.md @@ -32,6 +32,27 @@ applicable invariants agree. A failed or incomplete gate returns work to the earliest stage that can correct it. Do not turn `checking` or `conflict` into success through prose. +Before assigning a verdict, recompute knowledge discovery against the final +tree rather than trusting only the plan's original cover. Start from the +touched KEG subjects and the vocabulary and behavior changed by the diff. Use +targeted `mcp__tapper__backlinks`, `mcp__tapper__links`, and +`mcp__tapper__grep` calls in the active flight's covered KEGs to find plausible +decisions, patterns, research, incidents, interfaces, and verifications, then +read only the relevant notes. Informative knowledge guides interpretation; +only applicable active or stale interfaces and verifications enter gating +cover. A relevant contract discovered late expands the cover and sends the +work back through any newly required gates. + +Audit every retained comment, test, document, configuration value, fixture, +telemetry hook, and generated artifact that refers to removed, deprecated, or +legacy behavior. Each needs a surviving subject or consumer such as current +observable behavior, an accepted decision, a compatibility or migration +boundary, a security or protocol prohibition, or an active invariant. If its +only owner is the removal or obsolete implementation, treat it as orphaned +noise and return the work for correction. Rewrite artifacts around a broader +surviving invariant when that is the real contract; do not reject an artifact +merely because it uses the word `legacy`. + ## Commit Commit only the reviewed tree and follow the repository's commit convention.