Skip to content

Commit b5397f8

Browse files
authored
Merge pull request #281 from morluto/agent/remove-implementation-tests
test: remove implementation-coupled checks
2 parents cbbaacd + 3a716b3 commit b5397f8

19 files changed

Lines changed: 141 additions & 650 deletions

internal/app/dependency_direction_test.go

Lines changed: 0 additions & 52 deletions
This file was deleted.

internal/app/mcp_portfolio_test.go

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -73,7 +73,6 @@ func TestPullRequestPortfolioDerivesConflictAndPreservesUnknownCoverage(t *testi
7373
if len(conciseJSON) >= len(detailedJSON) {
7474
t.Fatalf("concise portfolio is not smaller: concise=%d detailed=%d", len(conciseJSON), len(detailedJSON))
7575
}
76-
t.Logf("portfolio response bytes: concise=%d detailed=%d", len(conciseJSON), len(detailedJSON))
7776
}
7877

7978
func TestPullRequestPortfolioClassifiesClosedUnmerged(t *testing.T) {

internal/app/mcp_stdio_e2e_test.go

Lines changed: 0 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -83,16 +83,6 @@ func TestMCPStdioScalableResearchFlow(t *testing.T) {
8383
if initialized == nil || initialized.ServerInfo == nil || initialized.ServerInfo.Name != "gitcontribute" {
8484
t.Fatalf("initialize result = %+v", initialized)
8585
}
86-
for _, phrase := range []string{
87-
"corpus.* tools are offline reads", "never refresh implicitly", "explicit bounded network reads",
88-
"polling through jobs.get", "observations are unknown rather than negative evidence",
89-
"Only advertised tools are available", "never mutates GitHub",
90-
} {
91-
if !strings.Contains(initialized.Instructions, phrase) {
92-
t.Errorf("instructions missing %q: %s", phrase, initialized.Instructions)
93-
}
94-
}
95-
9686
tools := make(map[string]*mcp.Tool)
9787
for tool, err := range session.Tools(ctx, nil) {
9888
if err != nil {

internal/app/runtime_contract.go

Lines changed: 0 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,6 @@
11
package app
22

33
import (
4-
"context"
54
"errors"
65
"strings"
76

@@ -27,11 +26,3 @@ func NewRuntimeContract(version string) (*contracts.RuntimeContractResult, error
2726
SupportedSchemaVersion: schema,
2827
}, nil
2928
}
30-
31-
// RuntimeContract reports immutable executable compatibility metadata.
32-
func (s *Service) RuntimeContract(ctx context.Context) (*contracts.RuntimeContractResult, error) {
33-
if err := ctx.Err(); err != nil {
34-
return nil, err
35-
}
36-
return NewRuntimeContract(s.version)
37-
}

internal/cli/cli.go

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -77,7 +77,6 @@ type rootCmd struct {
7777
Setup setupCmd `cmd:"" help:"Set up GitContribute for MCP, CLI, or both"`
7878
Remove removeCmd `cmd:"" help:"Remove GitContribute coding-agent integrations"`
7979
Upgrade upgradeCmd `cmd:"" help:"Check for or install the latest release"`
80-
Contract contractCmd `cmd:"" name:"runtime-contract" help:"Print the executable runtime compatibility contract"`
8180
Init initCmd `cmd:"" help:"Initialize the local corpus"`
8281
Corpus corpusCmd `cmd:"" help:"Inspect, back up, or migrate the local corpus"`
8382
Configure configureCmd `cmd:"" help:"Inspect or update typed configuration"`
@@ -154,8 +153,6 @@ type upgradeCmd struct {
154153
JSON bool `name:"json" help:"Print the result as JSON"`
155154
}
156155

157-
type contractCmd struct{}
158-
159156
type configureCmd struct {
160157
Database *string `name:"database" help:"Corpus database path"`
161158
TokenSource *string `name:"token-source" help:"GitHub token source (none, env, gh-cli, or keyring)"`

internal/cli/dispatch.go

Lines changed: 47 additions & 48 deletions
Original file line numberDiff line numberDiff line change
@@ -11,54 +11,53 @@ import (
1111
// group owns its own behavior.
1212
func (c *CLI) dispatchCommand(ctx context.Context, cmd, command string, parsed *rootCmd) error {
1313
handlers := map[string]func() error{
14-
"setup": func() error { return c.runSetupCommand(ctx, &parsed.Setup) },
15-
"remove": func() error { return c.runRemoveCommand(ctx, &parsed.Remove) },
16-
"upgrade": func() error { return c.runUpgrade(ctx, &parsed.Upgrade) },
17-
"runtime-contract": func() error { return c.runRuntimeContract(ctx) },
18-
"init": func() error { return c.runInit(ctx, &parsed.Init) },
19-
"corpus": func() error { return c.runCorpus(ctx, command, &parsed.Corpus) },
20-
"configure": func() error { return c.runConfigure(ctx, &parsed.Configure) },
21-
"metadata": func() error { return c.runMetadata(ctx, &parsed.Metadata) },
22-
"status": func() error { return c.runStatus(ctx, &parsed.Status) },
23-
"doctor": func() error { return c.runDoctor(ctx, &parsed.Doctor) },
24-
"health": func() error { return c.runHealth(ctx, &parsed.Health) },
25-
"radar": func() error { return c.runRadar(ctx, &parsed.Radar) },
26-
"search": func() error { return c.runSearch(ctx, command, &parsed.Search) },
27-
"dossier": func() error { return c.runDossier(ctx, command, &parsed.Dossier) },
28-
"research": func() error { return c.runResearch(ctx, command, &parsed.Research) },
29-
"seeds": func() error { return c.runSeeds(ctx, &parsed.Seeds) },
30-
"index": func() error { return c.runIndex(ctx, &parsed.Index) },
31-
"acquire": func() error { return c.runAcquire(ctx, &parsed.Acquire) },
32-
"source": func() error { return c.runSource(ctx, command, &parsed.Source) },
33-
"crawl": func() error { return c.runCrawl(ctx, &parsed.Crawl) },
34-
"tail": func() error { return c.runTail(ctx, &parsed.Tail) },
35-
"investigation": func() error { return c.runInvestigation(ctx, command, &parsed.Investigation) },
36-
"hypothesis": func() error { return c.runHypothesis(ctx, command, &parsed.Hypothesis) },
37-
"duplicates": func() error { return c.runCheck(ctx, command, "duplicates", &parsed.Duplicates) },
38-
"collisions": func() error { return c.runCheck(ctx, command, "collisions", &parsed.Collisions) },
39-
"opportunity": func() error { return c.runOpportunity(ctx, command, &parsed.Opportunity) },
40-
"concern": func() error { return c.runConcern(ctx, command, &parsed.Concern) },
41-
"workspace": func() error { return c.runWorkspace(ctx, command, &parsed.Workspace) },
42-
"diff": func() error { return c.runDiff(ctx, &parsed.Diff) },
43-
"validation": func() error { return c.runValidation(ctx, command, &parsed.Validation) },
44-
"evidence": func() error { return c.runEvidence(ctx, command, &parsed.Evidence) },
45-
"readiness": func() error { return c.runReadiness(ctx, command, &parsed.Readiness) },
46-
"prepare": func() error { return c.runPrepare(ctx, command, &parsed.Prepare) },
47-
"archive": func() error { return c.runArchive(ctx, command, &parsed.Archive) },
48-
"coverage": func() error { return c.runCoverage(ctx, &parsed.Coverage) },
49-
"runs": func() error { return c.runRuns(ctx, &parsed.Runs) },
50-
"jobs": func() error { return c.runJobs(ctx, command, &parsed.Jobs) },
51-
"neighbors": func() error { return c.runNeighbors(ctx, &parsed.Neighbors) },
52-
"export": func() error { return c.runExport(ctx, command, &parsed.Export) },
53-
"clusters": func() error { return c.runClusters(ctx, command, &parsed.Clusters) },
54-
"cluster": func() error { return c.runCluster(ctx, command, &parsed.Cluster) },
55-
"lens": func() error { return c.runLens(ctx, command, &parsed.Lens) },
56-
"collection": func() error { return c.runCollection(ctx, command, &parsed.Collection) },
57-
"triage": func() error { return c.runTriage(ctx, command, &parsed.Triage) },
58-
"contribution": func() error { return c.runContribution(ctx, command, &parsed.Contribution) },
59-
"tracking": func() error { return c.runTracking(ctx, command, &parsed.Tracking) },
60-
"mcp": func() error { return c.runMCP(ctx, &parsed.MCP) },
61-
"tui": func() error { return c.runTUI(ctx, &parsed.TUI) },
14+
"setup": func() error { return c.runSetupCommand(ctx, &parsed.Setup) },
15+
"remove": func() error { return c.runRemoveCommand(ctx, &parsed.Remove) },
16+
"upgrade": func() error { return c.runUpgrade(ctx, &parsed.Upgrade) },
17+
"init": func() error { return c.runInit(ctx, &parsed.Init) },
18+
"corpus": func() error { return c.runCorpus(ctx, command, &parsed.Corpus) },
19+
"configure": func() error { return c.runConfigure(ctx, &parsed.Configure) },
20+
"metadata": func() error { return c.runMetadata(ctx, &parsed.Metadata) },
21+
"status": func() error { return c.runStatus(ctx, &parsed.Status) },
22+
"doctor": func() error { return c.runDoctor(ctx, &parsed.Doctor) },
23+
"health": func() error { return c.runHealth(ctx, &parsed.Health) },
24+
"radar": func() error { return c.runRadar(ctx, &parsed.Radar) },
25+
"search": func() error { return c.runSearch(ctx, command, &parsed.Search) },
26+
"dossier": func() error { return c.runDossier(ctx, command, &parsed.Dossier) },
27+
"research": func() error { return c.runResearch(ctx, command, &parsed.Research) },
28+
"seeds": func() error { return c.runSeeds(ctx, &parsed.Seeds) },
29+
"index": func() error { return c.runIndex(ctx, &parsed.Index) },
30+
"acquire": func() error { return c.runAcquire(ctx, &parsed.Acquire) },
31+
"source": func() error { return c.runSource(ctx, command, &parsed.Source) },
32+
"crawl": func() error { return c.runCrawl(ctx, &parsed.Crawl) },
33+
"tail": func() error { return c.runTail(ctx, &parsed.Tail) },
34+
"investigation": func() error { return c.runInvestigation(ctx, command, &parsed.Investigation) },
35+
"hypothesis": func() error { return c.runHypothesis(ctx, command, &parsed.Hypothesis) },
36+
"duplicates": func() error { return c.runCheck(ctx, command, "duplicates", &parsed.Duplicates) },
37+
"collisions": func() error { return c.runCheck(ctx, command, "collisions", &parsed.Collisions) },
38+
"opportunity": func() error { return c.runOpportunity(ctx, command, &parsed.Opportunity) },
39+
"concern": func() error { return c.runConcern(ctx, command, &parsed.Concern) },
40+
"workspace": func() error { return c.runWorkspace(ctx, command, &parsed.Workspace) },
41+
"diff": func() error { return c.runDiff(ctx, &parsed.Diff) },
42+
"validation": func() error { return c.runValidation(ctx, command, &parsed.Validation) },
43+
"evidence": func() error { return c.runEvidence(ctx, command, &parsed.Evidence) },
44+
"readiness": func() error { return c.runReadiness(ctx, command, &parsed.Readiness) },
45+
"prepare": func() error { return c.runPrepare(ctx, command, &parsed.Prepare) },
46+
"archive": func() error { return c.runArchive(ctx, command, &parsed.Archive) },
47+
"coverage": func() error { return c.runCoverage(ctx, &parsed.Coverage) },
48+
"runs": func() error { return c.runRuns(ctx, &parsed.Runs) },
49+
"jobs": func() error { return c.runJobs(ctx, command, &parsed.Jobs) },
50+
"neighbors": func() error { return c.runNeighbors(ctx, &parsed.Neighbors) },
51+
"export": func() error { return c.runExport(ctx, command, &parsed.Export) },
52+
"clusters": func() error { return c.runClusters(ctx, command, &parsed.Clusters) },
53+
"cluster": func() error { return c.runCluster(ctx, command, &parsed.Cluster) },
54+
"lens": func() error { return c.runLens(ctx, command, &parsed.Lens) },
55+
"collection": func() error { return c.runCollection(ctx, command, &parsed.Collection) },
56+
"triage": func() error { return c.runTriage(ctx, command, &parsed.Triage) },
57+
"contribution": func() error { return c.runContribution(ctx, command, &parsed.Contribution) },
58+
"tracking": func() error { return c.runTracking(ctx, command, &parsed.Tracking) },
59+
"mcp": func() error { return c.runMCP(ctx, &parsed.MCP) },
60+
"tui": func() error { return c.runTUI(ctx, &parsed.TUI) },
6261
}
6362
if handler, ok := handlers[cmd]; ok {
6463
return handler()

internal/cli/runtime_contract.go

Lines changed: 0 additions & 21 deletions
This file was deleted.

internal/cli/runtime_contract_test.go

Lines changed: 0 additions & 29 deletions
This file was deleted.

internal/contracts/workflow_contracts.go

Lines changed: 0 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -209,12 +209,6 @@ type ReadinessCheck struct {
209209
EvaluatedAt string `json:"evaluated_at"`
210210
}
211211

212-
// RuntimeContractService reports only immutable executable compatibility
213-
// metadata. Implementations must not inspect configuration or the corpus.
214-
type RuntimeContractService interface {
215-
RuntimeContract(ctx context.Context) (*RuntimeContractResult, error)
216-
}
217-
218212
// RuntimeContractResult is immutable executable compatibility metadata.
219213
type RuntimeContractResult struct {
220214
Name string `json:"name"`

internal/corpus/corpus_fixture_test.go

Lines changed: 0 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -81,22 +81,3 @@ func copyTestDatabase(source, destination string) error {
8181
}
8282
return out.Close()
8383
}
84-
85-
func TestTestCorpusTemplateIsCurrentAndStandalone(t *testing.T) {
86-
t.Parallel()
87-
c, path := openTestCorpus(t)
88-
if _, err := os.Stat(testCorpusTemplate(t) + "-wal"); !errors.Is(err, os.ErrNotExist) {
89-
t.Fatalf("template retained a WAL sidecar: %v", err)
90-
}
91-
_, target, err := c.SchemaVersions(context.Background())
92-
if err != nil {
93-
t.Fatalf("schema versions: %v", err)
94-
}
95-
current, exists, err := InspectSchemaVersion(context.Background(), path)
96-
if err != nil {
97-
t.Fatalf("inspect copied schema: %v", err)
98-
}
99-
if !exists || current != target {
100-
t.Fatalf("copied schema version = %d (exists=%t), want current %d", current, exists, target)
101-
}
102-
}

0 commit comments

Comments
 (0)