Remove markdown test docs and document tests inline

This commit is contained in:
2026-03-24 02:30:38 +08:00
parent fb2b2dc8be
commit fd2b57feaf
257 changed files with 174 additions and 10431 deletions
+1
View File
@@ -10,6 +10,7 @@ import (
dbpkg "ai-workflow-skill/packages/coord-core/db"
)
// TestClaimThreadReturnsLeaseConflictAfterBusyWrite verifies claim returns a lease conflict after a concurrent write wins.
func TestClaimThreadReturnsLeaseConflictAfterBusyWrite(t *testing.T) {
t.Parallel()
+1
View File
@@ -8,6 +8,7 @@ import (
dbpkg "ai-workflow-skill/packages/coord-core/db"
)
// TestRecordCheckRefreshesDependentReadyStateWhenGatePasses verifies the final passing check unlocks dependent work.
func TestRecordCheckRefreshesDependentReadyStateWhenGatePasses(t *testing.T) {
t.Parallel()
@@ -6,6 +6,7 @@ import (
"testing"
)
// TestCancelMarksThreadCancelled verifies cancel marks thread cancelled.
func TestCancelMarksThreadCancelled(t *testing.T) {
t.Parallel()
@@ -47,6 +48,7 @@ func TestCancelMarksThreadCancelled(t *testing.T) {
}
}
// TestCancelPersistsReasonAndArtifact verifies cancel persists reason and artifact.
func TestCancelPersistsReasonAndArtifact(t *testing.T) {
t.Parallel()
@@ -127,6 +129,7 @@ func TestCancelPersistsReasonAndArtifact(t *testing.T) {
}
}
// TestCancelRejectsWhenThreadMissing verifies cancel rejects when thread missing.
func TestCancelRejectsWhenThreadMissing(t *testing.T) {
t.Parallel()
@@ -145,4 +148,3 @@ func TestCancelRejectsWhenThreadMissing(t *testing.T) {
}
assertErrorJSON(t, stdout, "not_found")
}
@@ -2,6 +2,7 @@ package inbox
import "testing"
// TestClaimAcquiresThreadLease verifies claim acquires thread lease.
func TestClaimAcquiresThreadLease(t *testing.T) {
t.Parallel()
@@ -34,6 +35,7 @@ func TestClaimAcquiresThreadLease(t *testing.T) {
}
}
// TestClaimRejectsWhenThreadMissing verifies claim rejects when thread missing.
func TestClaimRejectsWhenThreadMissing(t *testing.T) {
t.Parallel()
@@ -51,6 +53,7 @@ func TestClaimRejectsWhenThreadMissing(t *testing.T) {
assertErrorJSON(t, stdout, "not_found")
}
// TestClaimRejectsWhenThreadAlreadyClaimed verifies claim rejects when thread already claimed.
func TestClaimRejectsWhenThreadAlreadyClaimed(t *testing.T) {
t.Parallel()
@@ -79,6 +82,7 @@ func TestClaimRejectsWhenThreadAlreadyClaimed(t *testing.T) {
assertErrorJSON(t, stdout, "lease_conflict")
}
// TestClaimRecordsRequestedLeaseDuration verifies claim records requested lease duration.
func TestClaimRecordsRequestedLeaseDuration(t *testing.T) {
t.Parallel()
@@ -6,6 +6,7 @@ import (
"testing"
)
// TestDoneMarksThreadTerminal verifies done marks thread terminal.
func TestDoneMarksThreadTerminal(t *testing.T) {
t.Parallel()
@@ -33,6 +34,7 @@ func TestDoneMarksThreadTerminal(t *testing.T) {
}
}
// TestDonePersistsResultBodyAndArtifact verifies done persists result body and artifact.
func TestDonePersistsResultBodyAndArtifact(t *testing.T) {
t.Parallel()
@@ -89,6 +91,7 @@ func TestDonePersistsResultBodyAndArtifact(t *testing.T) {
}
}
// TestDoneRejectsNonOwner verifies done rejects non owner.
func TestDoneRejectsNonOwner(t *testing.T) {
t.Parallel()
@@ -109,6 +112,7 @@ func TestDoneRejectsNonOwner(t *testing.T) {
assertErrorJSON(t, stdout, "lease_conflict")
}
// TestDoneRejectsOnTerminalThread verifies done rejects on terminal thread.
func TestDoneRejectsOnTerminalThread(t *testing.T) {
t.Parallel()
@@ -6,6 +6,7 @@ import (
"testing"
)
// TestFailMarksThreadFailed verifies fail marks thread failed.
func TestFailMarksThreadFailed(t *testing.T) {
t.Parallel()
@@ -36,6 +37,7 @@ func TestFailMarksThreadFailed(t *testing.T) {
}
}
// TestFailPersistsFailureBodyAndArtifact verifies fail persists failure body and artifact.
func TestFailPersistsFailureBodyAndArtifact(t *testing.T) {
t.Parallel()
@@ -92,6 +94,7 @@ func TestFailPersistsFailureBodyAndArtifact(t *testing.T) {
}
}
// TestFailRejectsNonOwner verifies fail rejects non owner.
func TestFailRejectsNonOwner(t *testing.T) {
t.Parallel()
@@ -112,6 +115,7 @@ func TestFailRejectsNonOwner(t *testing.T) {
assertErrorJSON(t, stdout, "lease_conflict")
}
// TestFailRejectsOnTerminalThread verifies fail rejects on terminal thread.
func TestFailRejectsOnTerminalThread(t *testing.T) {
t.Parallel()
@@ -2,6 +2,7 @@ package inbox
import "testing"
// TestFetchReturnsPendingThreadForTargetAgent verifies fetch returns pending thread for target agent.
func TestFetchReturnsPendingThreadForTargetAgent(t *testing.T) {
t.Parallel()
@@ -35,6 +36,7 @@ func TestFetchReturnsPendingThreadForTargetAgent(t *testing.T) {
}
}
// TestFetchRespectsStatusAndLimitFilters verifies fetch respects status and limit filters.
func TestFetchRespectsStatusAndLimitFilters(t *testing.T) {
t.Parallel()
@@ -94,6 +96,7 @@ func TestFetchRespectsStatusAndLimitFilters(t *testing.T) {
}
}
// TestFetchUnreadUsesReadCursor verifies fetch unread uses read cursor.
func TestFetchUnreadUsesReadCursor(t *testing.T) {
t.Parallel()
@@ -169,6 +172,7 @@ func TestFetchUnreadUsesReadCursor(t *testing.T) {
}
}
// TestFetchReturnsNoMatchingWorkWhenEmpty verifies fetch returns no matching work when empty.
func TestFetchReturnsNoMatchingWorkWhenEmpty(t *testing.T) {
t.Parallel()
@@ -5,6 +5,7 @@ import (
"testing"
)
// TestInboxRootHelpExplainsWorkerLoop verifies inbox root help explains worker loop.
func TestInboxRootHelpExplainsWorkerLoop(t *testing.T) {
t.Parallel()
@@ -25,6 +26,7 @@ func TestInboxRootHelpExplainsWorkerLoop(t *testing.T) {
}
}
// TestInboxUpdateHelpExplainsBlockedQuestions verifies inbox update help explains blocked questions.
func TestInboxUpdateHelpExplainsBlockedQuestions(t *testing.T) {
t.Parallel()
@@ -45,6 +47,7 @@ func TestInboxUpdateHelpExplainsBlockedQuestions(t *testing.T) {
}
}
// TestInboxWaitReplyHelpExplainsBlockingPrimitive verifies inbox wait reply help explains blocking primitive.
func TestInboxWaitReplyHelpExplainsBlockingPrimitive(t *testing.T) {
t.Parallel()
@@ -62,6 +65,7 @@ func TestInboxWaitReplyHelpExplainsBlockingPrimitive(t *testing.T) {
}
}
// TestInboxListHelpExplainsDifferenceFromFetch verifies inbox list help explains difference from fetch.
func TestInboxListHelpExplainsDifferenceFromFetch(t *testing.T) {
t.Parallel()
@@ -5,6 +5,7 @@ import (
"testing"
)
// TestInitCreatesSchemaOnEmptyDB verifies init creates schema on empty DB.
func TestInitCreatesSchemaOnEmptyDB(t *testing.T) {
t.Parallel()
@@ -28,6 +29,7 @@ func TestInitCreatesSchemaOnEmptyDB(t *testing.T) {
}
}
// TestInitIsIdempotentOnExistingDB verifies init is idempotent on existing DB.
func TestInitIsIdempotentOnExistingDB(t *testing.T) {
t.Parallel()
@@ -7,6 +7,7 @@ import (
"time"
)
// TestInboxLifecycle verifies inbox lifecycle.
func TestInboxLifecycle(t *testing.T) {
t.Parallel()
@@ -171,6 +172,7 @@ func TestInboxLifecycle(t *testing.T) {
}
}
// TestInboxFailLifecycle verifies inbox fail lifecycle.
func TestInboxFailLifecycle(t *testing.T) {
t.Parallel()
@@ -238,6 +240,7 @@ func TestInboxFailLifecycle(t *testing.T) {
}
}
// TestInboxRenewWaitReplyAndCancel verifies inbox renew wait reply and cancel.
func TestInboxRenewWaitReplyAndCancel(t *testing.T) {
t.Parallel()
@@ -387,6 +390,7 @@ func TestInboxRenewWaitReplyAndCancel(t *testing.T) {
}
}
// TestInboxWatchListUnreadAndAppend verifies inbox watch list unread and append.
func TestInboxWatchListUnreadAndAppend(t *testing.T) {
t.Parallel()
@@ -544,6 +548,7 @@ func TestInboxWatchListUnreadAndAppend(t *testing.T) {
}
}
// TestInboxUnreadReadCursor verifies inbox unread read cursor.
func TestInboxUnreadReadCursor(t *testing.T) {
t.Parallel()
@@ -634,6 +639,7 @@ func TestInboxUnreadReadCursor(t *testing.T) {
}
}
// TestInboxJSONErrorsAndExitCodes verifies inbox JSON errors and exit codes.
func TestInboxJSONErrorsAndExitCodes(t *testing.T) {
t.Parallel()
@@ -6,6 +6,7 @@ import (
"time"
)
// TestListFiltersByStatus verifies list returns only threads matching the requested statuses.
func TestListFiltersByStatus(t *testing.T) {
t.Parallel()
@@ -53,6 +54,7 @@ func TestListFiltersByStatus(t *testing.T) {
}
}
// TestListFiltersByCreatedBy verifies list filters threads by creator.
func TestListFiltersByCreatedBy(t *testing.T) {
t.Parallel()
@@ -88,6 +90,7 @@ func TestListFiltersByCreatedBy(t *testing.T) {
}
}
// TestListFiltersByAssignedTo verifies list filters threads by assignee.
func TestListFiltersByAssignedTo(t *testing.T) {
t.Parallel()
@@ -126,6 +129,7 @@ func TestListFiltersByAssignedTo(t *testing.T) {
}
}
// TestListRespectsLimit verifies list returns only the most recent rows up to the requested limit.
func TestListRespectsLimit(t *testing.T) {
t.Parallel()
@@ -180,4 +184,3 @@ func createThreadForList(t *testing.T, dbPath, from, to, subject, summary string
mustDecodeJSON(t, sendOut, &sendResp)
return nestedString(t, sendResp, "data", "thread", "thread_id")
}
@@ -2,6 +2,7 @@ package inbox
import "testing"
// TestRenewExtendsActiveLease verifies renew extends active lease.
func TestRenewExtendsActiveLease(t *testing.T) {
t.Parallel()
@@ -53,6 +54,7 @@ func TestRenewExtendsActiveLease(t *testing.T) {
}
}
// TestRenewRejectsNonOwner verifies renew rejects non owner.
func TestRenewRejectsNonOwner(t *testing.T) {
t.Parallel()
@@ -82,6 +84,7 @@ func TestRenewRejectsNonOwner(t *testing.T) {
assertErrorJSON(t, stdout, "lease_conflict")
}
// TestRenewRejectsWithoutActiveLease verifies renew rejects without active lease.
func TestRenewRejectsWithoutActiveLease(t *testing.T) {
t.Parallel()
@@ -6,6 +6,7 @@ import (
"testing"
)
// TestReplyAddsAnswerMessage verifies reply appends an answer message to the thread.
func TestReplyAddsAnswerMessage(t *testing.T) {
t.Parallel()
@@ -37,6 +38,7 @@ func TestReplyAddsAnswerMessage(t *testing.T) {
}
}
// TestReplySupportsControlKind verifies reply accepts control messages in addition to answers.
func TestReplySupportsControlKind(t *testing.T) {
t.Parallel()
@@ -63,6 +65,7 @@ func TestReplySupportsControlKind(t *testing.T) {
}
}
// TestReplyAttachesArtifact verifies reply persists an attached artifact on the reply message.
func TestReplyAttachesArtifact(t *testing.T) {
t.Parallel()
@@ -115,6 +118,7 @@ func TestReplyAttachesArtifact(t *testing.T) {
}
}
// TestReplyRejectsInvalidPayloadJSON verifies reply returns invalid_input for malformed payload JSON.
func TestReplyRejectsInvalidPayloadJSON(t *testing.T) {
t.Parallel()
@@ -6,6 +6,7 @@ import (
"testing"
)
// TestSendCreatesNewThread verifies send creates a pending thread with the initial task message.
func TestSendCreatesNewThread(t *testing.T) {
t.Parallel()
@@ -45,6 +46,7 @@ func TestSendCreatesNewThread(t *testing.T) {
}
}
// TestSendAppendsMessageToExistingThread verifies send appends a message without creating a new thread.
func TestSendAppendsMessageToExistingThread(t *testing.T) {
t.Parallel()
@@ -88,6 +90,7 @@ func TestSendAppendsMessageToExistingThread(t *testing.T) {
}
}
// TestSendReadsBodyFromBodyFile verifies send loads the message body from a body file.
func TestSendReadsBodyFromBodyFile(t *testing.T) {
t.Parallel()
@@ -139,6 +142,7 @@ func TestSendReadsBodyFromBodyFile(t *testing.T) {
}
}
// TestSendAttachesArtifactWithMetadata verifies send persists an artifact and its metadata on the message.
func TestSendAttachesArtifactWithMetadata(t *testing.T) {
t.Parallel()
@@ -190,6 +194,7 @@ func TestSendAttachesArtifactWithMetadata(t *testing.T) {
}
}
// TestSendRejectsInvalidPayloadJSON verifies send returns invalid_input for malformed payload JSON.
func TestSendRejectsInvalidPayloadJSON(t *testing.T) {
t.Parallel()
@@ -209,6 +214,7 @@ func TestSendRejectsInvalidPayloadJSON(t *testing.T) {
assertErrorJSON(t, stdout, "invalid_input")
}
// TestSendRejectsInvalidArtifactMetadataJSON verifies send returns invalid_input for malformed artifact metadata JSON.
func TestSendRejectsInvalidArtifactMetadataJSON(t *testing.T) {
t.Parallel()
@@ -6,6 +6,7 @@ import (
"testing"
)
// TestShowReturnsThreadAndMessageHistory verifies show returns the thread with ordered message history.
func TestShowReturnsThreadAndMessageHistory(t *testing.T) {
t.Parallel()
@@ -65,6 +66,7 @@ func TestShowReturnsThreadAndMessageHistory(t *testing.T) {
}
}
// TestShowIncludesArtifactsPerMessage verifies show includes message artifacts in the thread payload.
func TestShowIncludesArtifactsPerMessage(t *testing.T) {
t.Parallel()
@@ -122,6 +124,7 @@ func TestShowIncludesArtifactsPerMessage(t *testing.T) {
}
}
// TestShowMarkReadAdvancesReadCursor verifies show --mark-read clears the thread from unread fetch results.
func TestShowMarkReadAdvancesReadCursor(t *testing.T) {
t.Parallel()
@@ -176,6 +179,7 @@ func TestShowMarkReadAdvancesReadCursor(t *testing.T) {
assertErrorJSON(t, stdout, "no_matching_work")
}
// TestShowRejectsWhenThreadMissing verifies show returns not_found for an unknown thread.
func TestShowRejectsWhenThreadMissing(t *testing.T) {
t.Parallel()
@@ -193,4 +197,3 @@ func TestShowRejectsWhenThreadMissing(t *testing.T) {
}
assertErrorJSON(t, stdout, "not_found")
}
@@ -59,6 +59,7 @@ func lastThreadMessageFromShow(t *testing.T, showResp map[string]any) map[string
return lastMessage
}
// TestUpdateMovesThreadToInProgress verifies update moves thread to in progress.
func TestUpdateMovesThreadToInProgress(t *testing.T) {
t.Parallel()
@@ -90,6 +91,7 @@ func TestUpdateMovesThreadToInProgress(t *testing.T) {
}
}
// TestUpdateMovesThreadToBlockedWithPayload verifies update moves thread to blocked with payload.
func TestUpdateMovesThreadToBlockedWithPayload(t *testing.T) {
t.Parallel()
@@ -125,6 +127,7 @@ func TestUpdateMovesThreadToBlockedWithPayload(t *testing.T) {
}
}
// TestUpdateAcceptsBodyFileAndArtifact verifies update accepts body file and artifact.
func TestUpdateAcceptsBodyFileAndArtifact(t *testing.T) {
t.Parallel()
@@ -182,6 +185,7 @@ func TestUpdateAcceptsBodyFileAndArtifact(t *testing.T) {
}
}
// TestUpdateRejectsInvalidPayloadJSON verifies update rejects invalid payload JSON.
func TestUpdateRejectsInvalidPayloadJSON(t *testing.T) {
t.Parallel()
@@ -204,6 +208,7 @@ func TestUpdateRejectsInvalidPayloadJSON(t *testing.T) {
assertErrorJSON(t, stdout, "invalid_input")
}
// TestUpdateRejectsNonOwner verifies update rejects non owner.
func TestUpdateRejectsNonOwner(t *testing.T) {
t.Parallel()
@@ -13,6 +13,7 @@ type waitReplyCommandResult struct {
exit int
}
// TestWaitReplyWakesOnAnswerAfterMessage verifies wait reply wakes on answer after message.
func TestWaitReplyWakesOnAnswerAfterMessage(t *testing.T) {
t.Parallel()
@@ -67,6 +68,7 @@ func TestWaitReplyWakesOnAnswerAfterMessage(t *testing.T) {
}
}
// TestWaitReplyCanStartFromAfterEvent verifies wait reply can start from after event.
func TestWaitReplyCanStartFromAfterEvent(t *testing.T) {
t.Parallel()
@@ -155,6 +157,7 @@ func TestWaitReplyCanStartFromAfterEvent(t *testing.T) {
}
}
// TestWaitReplyTimesOutWhenNoReply verifies wait reply times out when no reply.
func TestWaitReplyTimesOutWhenNoReply(t *testing.T) {
t.Parallel()
@@ -218,4 +221,3 @@ func seedBlockedThreadForWaitReply(t *testing.T, dbPath string) (threadID string
blockedMessageID = nestedString(t, blockedResp, "data", "message", "message_id")
return threadID, blockedMessageID
}
@@ -12,6 +12,7 @@ type watchCommandResult struct {
exit int
}
// TestWatchWakesOnMatchingThread verifies watch wakes on matching thread.
func TestWatchWakesOnMatchingThread(t *testing.T) {
t.Parallel()
@@ -78,6 +79,7 @@ func TestWatchWakesOnMatchingThread(t *testing.T) {
}
}
// TestWatchRespectsStatusFilter verifies watch respects status filter.
func TestWatchRespectsStatusFilter(t *testing.T) {
t.Parallel()
@@ -149,6 +151,7 @@ func TestWatchRespectsStatusFilter(t *testing.T) {
}
}
// TestWatchTimesOutWithNoActivity verifies watch times out with no activity.
func TestWatchTimesOutWithNoActivity(t *testing.T) {
t.Parallel()
@@ -168,4 +171,3 @@ func TestWatchTimesOutWithNoActivity(t *testing.T) {
}
assertErrorJSON(t, stdout, "no_matching_work")
}
@@ -9,11 +9,12 @@ import (
"testing"
"time"
"ai-workflow-skill/packages/operator-api/internal/app"
dbpkg "ai-workflow-skill/packages/coord-core/db"
"ai-workflow-skill/packages/coord-core/store"
"ai-workflow-skill/packages/operator-api/internal/app"
)
// TestRouterExposesReadOnlyWebEndpoints verifies the read-only web endpoints return seeded coordination data.
func TestRouterExposesReadOnlyWebEndpoints(t *testing.T) {
t.Parallel()
@@ -107,6 +108,7 @@ func TestRouterExposesReadOnlyWebEndpoints(t *testing.T) {
assertStatusAndJSONField(t, handler, "/api/threads/"+dispatch.Attempt.ThreadID, http.StatusOK, []string{"thread", "thread", "thread_id"}, dispatch.Attempt.ThreadID)
}
// TestRouterMapsNotFoundErrors verifies missing resources map to a not_found API error.
func TestRouterMapsNotFoundErrors(t *testing.T) {
t.Parallel()
@@ -7,6 +7,7 @@ import (
"testing"
)
// TestOrchRunShowReturnsRunSummaryAndTaskCounts verifies orch run show returns run summary and task counts.
func TestOrchRunShowReturnsRunSummaryAndTaskCounts(t *testing.T) {
t.Parallel()
@@ -67,6 +68,7 @@ func TestOrchRunShowReturnsRunSummaryAndTaskCounts(t *testing.T) {
}
}
// TestOrchRunShowRejectsMissingRun verifies orch run show rejects missing run.
func TestOrchRunShowRejectsMissingRun(t *testing.T) {
t.Parallel()
@@ -84,6 +86,7 @@ func TestOrchRunShowRejectsMissingRun(t *testing.T) {
assertErrorJSON(t, stdout, "not_found")
}
// TestOrchTaskAddRejectsInvalidAcceptanceJSON verifies orch task add rejects invalid acceptance JSON.
func TestOrchTaskAddRejectsInvalidAcceptanceJSON(t *testing.T) {
t.Parallel()
@@ -114,6 +117,7 @@ func TestOrchTaskAddRejectsInvalidAcceptanceJSON(t *testing.T) {
assertErrorMessageContains(t, stdout, "acceptance-json must be valid JSON")
}
// TestOrchTaskAddRejectsInvalidPriority verifies orch task add rejects invalid priority.
func TestOrchTaskAddRejectsInvalidPriority(t *testing.T) {
t.Parallel()
@@ -144,6 +148,7 @@ func TestOrchTaskAddRejectsInvalidPriority(t *testing.T) {
assertErrorMessageContains(t, stdout, "priority must be one of low, normal, high")
}
// TestOrchTaskAddSnapshotsSpecAndVerificationPolicy verifies orch task add snapshots spec and verification policy.
func TestOrchTaskAddSnapshotsSpecAndVerificationPolicy(t *testing.T) {
t.Parallel()
@@ -200,6 +205,7 @@ func TestOrchTaskAddSnapshotsSpecAndVerificationPolicy(t *testing.T) {
}
}
// TestOrchTaskAddRejectsSpecSHAMismatch verifies orch task add rejects spec SHA mismatch.
func TestOrchTaskAddRejectsSpecSHAMismatch(t *testing.T) {
t.Parallel()
@@ -236,6 +242,7 @@ func TestOrchTaskAddRejectsSpecSHAMismatch(t *testing.T) {
assertErrorMessageContains(t, stdout, "spec-sha does not match spec-file contents")
}
// TestOrchReadyOrdersByPriorityAndRespectsLimit verifies orch ready orders by priority and respects limit.
func TestOrchReadyOrdersByPriorityAndRespectsLimit(t *testing.T) {
t.Parallel()
@@ -5,6 +5,7 @@ import (
"testing"
)
// TestOrchAnswerAcceptsPayloadJSONWithoutBody verifies orch answer accepts payload JSON without body.
func TestOrchAnswerAcceptsPayloadJSONWithoutBody(t *testing.T) {
t.Parallel()
@@ -71,6 +72,7 @@ func TestOrchAnswerAcceptsPayloadJSONWithoutBody(t *testing.T) {
}
}
// TestOrchAnswerRejectsEmptyBodyAndPayload verifies orch answer rejects empty body and payload.
func TestOrchAnswerRejectsEmptyBodyAndPayload(t *testing.T) {
t.Parallel()
@@ -90,6 +92,7 @@ func TestOrchAnswerRejectsEmptyBodyAndPayload(t *testing.T) {
assertErrorJSON(t, stdout, "invalid_input")
}
// TestOrchCleanupRejectsAttemptWithoutTask verifies orch cleanup rejects attempt without task.
func TestOrchCleanupRejectsAttemptWithoutTask(t *testing.T) {
t.Parallel()
@@ -117,6 +120,7 @@ func TestOrchCleanupRejectsAttemptWithoutTask(t *testing.T) {
assertErrorJSON(t, stdout, "invalid_input")
}
// TestOrchCleanupReturnsNoMatchingWorkWhenFiltersMiss verifies orch cleanup returns no matching work when filters miss.
func TestOrchCleanupReturnsNoMatchingWorkWhenFiltersMiss(t *testing.T) {
t.Parallel()
@@ -6,6 +6,7 @@ import (
"testing"
)
// TestOrchRunInitCreatesNewRun verifies `run init` persists a new run that `run show` can read back.
func TestOrchRunInitCreatesNewRun(t *testing.T) {
t.Parallel()
@@ -56,6 +57,7 @@ func TestOrchRunInitCreatesNewRun(t *testing.T) {
}
}
// TestOrchDispatchCreatesAttemptAndThreadForReadyTask verifies `dispatch` creates the first attempt, thread, and task message for a ready task.
func TestOrchDispatchCreatesAttemptAndThreadForReadyTask(t *testing.T) {
t.Parallel()
@@ -116,6 +118,7 @@ func TestOrchDispatchCreatesAttemptAndThreadForReadyTask(t *testing.T) {
}
}
// TestOrchBlockedListsLatestQuestionForBlockedTask verifies `blocked` returns the latest blocked question for a task after reconcile.
func TestOrchBlockedListsLatestQuestionForBlockedTask(t *testing.T) {
t.Parallel()
@@ -277,6 +280,7 @@ func TestOrchBlockedListsLatestQuestionForBlockedTask(t *testing.T) {
}
}
// TestOrchStatusReturnsRunSummaryAndTaskList verifies `status` returns the run summary together with the current task list.
func TestOrchStatusReturnsRunSummaryAndTaskList(t *testing.T) {
t.Parallel()
@@ -393,6 +397,7 @@ func TestOrchStatusReturnsRunSummaryAndTaskList(t *testing.T) {
}
}
// TestOrchStatusAutoReconcilesAndIncludesBlockedContext verifies `status` reconciles inbox state first and includes blocked context.
func TestOrchStatusAutoReconcilesAndIncludesBlockedContext(t *testing.T) {
t.Parallel()
@@ -496,6 +501,7 @@ func TestOrchStatusAutoReconcilesAndIncludesBlockedContext(t *testing.T) {
}
}
// TestOrchReconcileMapsFailedThreadToTerminalTaskState verifies `reconcile` maps a failed inbox thread into the terminal task state.
func TestOrchReconcileMapsFailedThreadToTerminalTaskState(t *testing.T) {
t.Parallel()
@@ -601,6 +607,7 @@ func TestOrchReconcileMapsFailedThreadToTerminalTaskState(t *testing.T) {
}
}
// TestOrchWorkflowCodeModeDispatchToCleanup verifies the code-mode workflow runs from dispatch through cleanup.
func TestOrchWorkflowCodeModeDispatchToCleanup(t *testing.T) {
t.Parallel()
@@ -703,6 +710,7 @@ func TestOrchWorkflowCodeModeDispatchToCleanup(t *testing.T) {
}
}
// TestOrchWorkflowCouncilReviewEndToEnd verifies the council review workflow completes end to end.
func TestOrchWorkflowCouncilReviewEndToEnd(t *testing.T) {
t.Parallel()
@@ -7,6 +7,7 @@ import (
"testing"
)
// TestOrchCouncilReportRejectsBeforeTally verifies orch council report rejects before tally.
func TestOrchCouncilReportRejectsBeforeTally(t *testing.T) {
t.Parallel()
@@ -38,6 +39,7 @@ func TestOrchCouncilReportRejectsBeforeTally(t *testing.T) {
}
}
// TestOrchCouncilReportRejectsInvalidShow verifies orch council report rejects invalid show.
func TestOrchCouncilReportRejectsInvalidShow(t *testing.T) {
t.Parallel()
@@ -65,6 +67,7 @@ func TestOrchCouncilReportRejectsInvalidShow(t *testing.T) {
}
}
// TestOrchCouncilReportDefaultsToConsensusForOnlyUnanimousRun verifies orch council report defaults to consensus for only unanimous run.
func TestOrchCouncilReportDefaultsToConsensusForOnlyUnanimousRun(t *testing.T) {
t.Parallel()
@@ -5,6 +5,7 @@ import (
"testing"
)
// TestOrchRootHelpExplainsLeaderWorkflow verifies orch root help explains leader workflow.
func TestOrchRootHelpExplainsLeaderWorkflow(t *testing.T) {
t.Parallel()
@@ -25,6 +26,7 @@ func TestOrchRootHelpExplainsLeaderWorkflow(t *testing.T) {
}
}
// TestOrchDispatchHelpExplainsExecutionModes verifies orch dispatch help explains execution modes.
func TestOrchDispatchHelpExplainsExecutionModes(t *testing.T) {
t.Parallel()
@@ -45,6 +47,7 @@ func TestOrchDispatchHelpExplainsExecutionModes(t *testing.T) {
}
}
// TestOrchCouncilStartHelpExplainsWorkflow verifies orch council start help explains workflow.
func TestOrchCouncilStartHelpExplainsWorkflow(t *testing.T) {
t.Parallel()
@@ -62,6 +65,7 @@ func TestOrchCouncilStartHelpExplainsWorkflow(t *testing.T) {
}
}
// TestOrchStatusHelpExplainsDashboardRole verifies orch status help explains dashboard role.
func TestOrchStatusHelpExplainsDashboardRole(t *testing.T) {
t.Parallel()
@@ -79,6 +83,7 @@ func TestOrchStatusHelpExplainsDashboardRole(t *testing.T) {
}
}
// TestOrchCleanupHelpExplainsScopeFlags verifies orch cleanup help explains scope flags.
func TestOrchCleanupHelpExplainsScopeFlags(t *testing.T) {
t.Parallel()
@@ -99,6 +104,7 @@ func TestOrchCleanupHelpExplainsScopeFlags(t *testing.T) {
}
}
// TestOrchVerifyHelpExplainsGateWorkflow verifies orch verify help explains gate workflow.
func TestOrchVerifyHelpExplainsGateWorkflow(t *testing.T) {
t.Parallel()
@@ -10,6 +10,7 @@ import (
"time"
)
// TestOrchRunDispatchReconcileLifecycle verifies a task moves from ready to done through dispatch and reconcile.
func TestOrchRunDispatchReconcileLifecycle(t *testing.T) {
t.Parallel()
@@ -183,6 +184,7 @@ func TestOrchRunDispatchReconcileLifecycle(t *testing.T) {
}
}
// TestOrchVerificationGateLifecycle verifies required checks keep a task gated until every required result passes.
func TestOrchVerificationGateLifecycle(t *testing.T) {
t.Parallel()
@@ -360,6 +362,7 @@ func TestOrchVerificationGateLifecycle(t *testing.T) {
}
}
// TestOrchDependencyBlockedAndAnswerFlow verifies blocked dependency work resumes after the leader answers the worker question.
func TestOrchDependencyBlockedAndAnswerFlow(t *testing.T) {
t.Parallel()
@@ -636,6 +639,7 @@ func TestOrchDependencyBlockedAndAnswerFlow(t *testing.T) {
}
}
// TestOrchDispatchRejectsNonReadyTask verifies `dispatch` refuses tasks that are not ready to run.
func TestOrchDispatchRejectsNonReadyTask(t *testing.T) {
t.Parallel()
@@ -691,6 +695,7 @@ func TestOrchDispatchRejectsNonReadyTask(t *testing.T) {
assertErrorJSON(t, stdout, "invalid_state")
}
// TestOrchDispatchCodeModeCreatesWorktree verifies code-mode dispatch allocates and records a worktree for the attempt.
func TestOrchDispatchCodeModeCreatesWorktree(t *testing.T) {
t.Parallel()
@@ -810,6 +815,7 @@ func TestOrchDispatchCodeModeCreatesWorktree(t *testing.T) {
}
}
// TestOrchDispatchCodeModeRejectsDirtyRepoWithoutBaseRef verifies code-mode dispatch rejects a dirty repo when no base ref is provided.
func TestOrchDispatchCodeModeRejectsDirtyRepoWithoutBaseRef(t *testing.T) {
t.Parallel()
@@ -859,6 +865,7 @@ func TestOrchDispatchCodeModeRejectsDirtyRepoWithoutBaseRef(t *testing.T) {
}
}
// TestOrchDispatchCodeModeAllowsExplicitBaseRefOnDirtyRepo verifies code-mode dispatch accepts a dirty repo when an explicit base ref is set.
func TestOrchDispatchCodeModeAllowsExplicitBaseRefOnDirtyRepo(t *testing.T) {
t.Parallel()
@@ -912,6 +919,7 @@ func TestOrchDispatchCodeModeAllowsExplicitBaseRefOnDirtyRepo(t *testing.T) {
}
}
// TestOrchDispatchRequiresExplicitExecutionMode verifies `dispatch` requires an explicit execution mode.
func TestOrchDispatchRequiresExplicitExecutionMode(t *testing.T) {
dbPath := filepath.Join(t.TempDir(), "coord.db")
@@ -947,6 +955,7 @@ func TestOrchDispatchRequiresExplicitExecutionMode(t *testing.T) {
assertErrorJSON(t, stdout, "invalid_input")
}
// TestOrchDispatchAnalysisModeSkipsWorktree verifies analysis-mode dispatch skips worktree creation.
func TestOrchDispatchAnalysisModeSkipsWorktree(t *testing.T) {
t.Parallel()
@@ -999,6 +1008,7 @@ func TestOrchDispatchAnalysisModeSkipsWorktree(t *testing.T) {
}
}
// TestOrchWaitWakesOnBlockedEvent verifies `wait` wakes when a blocked event is emitted for the run.
func TestOrchWaitWakesOnBlockedEvent(t *testing.T) {
t.Parallel()
@@ -1115,6 +1125,7 @@ func TestOrchWaitWakesOnBlockedEvent(t *testing.T) {
}
}
// TestOrchWaitTimesOutWithoutMatchingEvent verifies `wait` times out when no matching run event arrives.
func TestOrchWaitTimesOutWithoutMatchingEvent(t *testing.T) {
t.Parallel()
@@ -1152,6 +1163,7 @@ func TestOrchWaitTimesOutWithoutMatchingEvent(t *testing.T) {
}
}
// TestOrchWaitDefaultsWakeOnVerifyingEvent verifies `wait` wakes on verifying events when no explicit event filter is set.
func TestOrchWaitDefaultsWakeOnVerifyingEvent(t *testing.T) {
t.Parallel()
@@ -1277,6 +1289,7 @@ func TestOrchWaitDefaultsWakeOnVerifyingEvent(t *testing.T) {
}
}
// TestOrchRetryCreatesNewAttempt verifies `retry` creates a new attempt after a failed task.
func TestOrchRetryCreatesNewAttempt(t *testing.T) {
t.Parallel()
@@ -1375,6 +1388,7 @@ func TestOrchRetryCreatesNewAttempt(t *testing.T) {
}
}
// TestOrchReassignCancelsOldThreadAndDispatchesNewAttempt verifies `reassign` cancels the old thread and dispatches a replacement attempt.
func TestOrchReassignCancelsOldThreadAndDispatchesNewAttempt(t *testing.T) {
t.Parallel()
@@ -1482,6 +1496,7 @@ func TestOrchReassignCancelsOldThreadAndDispatchesNewAttempt(t *testing.T) {
}
}
// TestOrchCancelTaskAndRun verifies `cancel` can stop both a single task and the whole run.
func TestOrchCancelTaskAndRun(t *testing.T) {
t.Parallel()
@@ -1612,6 +1627,7 @@ func TestOrchCancelTaskAndRun(t *testing.T) {
}
}
// TestOrchCleanupRemovesCompletedWorktree verifies `cleanup` removes the worktree for a completed attempt.
func TestOrchCleanupRemovesCompletedWorktree(t *testing.T) {
t.Parallel()
@@ -1699,6 +1715,7 @@ func TestOrchCleanupRemovesCompletedWorktree(t *testing.T) {
}
}
// TestOrchCouncilStartDispatchesThreeReviewers verifies `council start` dispatches three reviewer tasks.
func TestOrchCouncilStartDispatchesThreeReviewers(t *testing.T) {
t.Parallel()
@@ -1842,6 +1859,7 @@ func TestOrchCouncilStartDispatchesThreeReviewers(t *testing.T) {
}
}
// TestOrchCouncilWaitWakesWhenAllReviewersComplete verifies `council wait` wakes once all reviewers finish.
func TestOrchCouncilWaitWakesWhenAllReviewersComplete(t *testing.T) {
t.Parallel()
@@ -1975,6 +1993,7 @@ func TestOrchCouncilWaitWakesWhenAllReviewersComplete(t *testing.T) {
}
}
// TestOrchCouncilWaitTimesOutWhenReviewersIncomplete verifies `council wait` times out while reviewers are still incomplete.
func TestOrchCouncilWaitTimesOutWhenReviewersIncomplete(t *testing.T) {
t.Parallel()
@@ -2012,6 +2031,7 @@ func TestOrchCouncilWaitTimesOutWhenReviewersIncomplete(t *testing.T) {
}
}
// TestOrchCouncilTallyGroupsReviewerFindingsNormal verifies normal council tally groups compatible reviewer findings.
func TestOrchCouncilTallyGroupsReviewerFindingsNormal(t *testing.T) {
t.Parallel()
@@ -2110,6 +2130,7 @@ func TestOrchCouncilTallyGroupsReviewerFindingsNormal(t *testing.T) {
}
}
// TestOrchCouncilTallyStrictKeepsDistinctProposals verifies strict council tally keeps distinct proposals separate.
func TestOrchCouncilTallyStrictKeepsDistinctProposals(t *testing.T) {
t.Parallel()
@@ -2170,6 +2191,7 @@ func TestOrchCouncilTallyStrictKeepsDistinctProposals(t *testing.T) {
}
}
// TestOrchCouncilReportDefaultShowsConsensusAndMajority verifies the default council report shows consensus and majority sections.
func TestOrchCouncilReportDefaultShowsConsensusAndMajority(t *testing.T) {
t.Parallel()
@@ -2247,6 +2269,7 @@ func TestOrchCouncilReportDefaultShowsConsensusAndMajority(t *testing.T) {
}
}
// TestOrchCouncilReportShowAllIncludesMinority verifies `council report --show all` includes minority findings.
func TestOrchCouncilReportShowAllIncludesMinority(t *testing.T) {
t.Parallel()
@@ -2276,6 +2299,7 @@ func TestOrchCouncilReportShowAllIncludesMinority(t *testing.T) {
}
}
// TestOrchCouncilReportJSONShape verifies `council report` keeps its JSON response shape stable.
func TestOrchCouncilReportJSONShape(t *testing.T) {
t.Parallel()
@@ -5,6 +5,7 @@ import (
"testing"
)
// TestAddRegistersRepoAndEntry verifies add persists a new entry and registers its repo.
func TestAddRegistersRepoAndEntry(t *testing.T) {
fixture := newRepoMemoryFixture(t)
initGitRepo(t, fixture.RepoPath)
@@ -42,6 +43,7 @@ func TestAddRegistersRepoAndEntry(t *testing.T) {
assertContains(t, listOut, "Plan 内嵌任务结构,不是独立表")
}
// TestAddUpdatesExistingEntryOnSameKindAndKey verifies add upserts an existing entry when kind and key match.
func TestAddUpdatesExistingEntryOnSameKindAndKey(t *testing.T) {
fixture := newRepoMemoryFixture(t)
runRepoMemoryCommand(t, "init", "--db", fixture.DBPath)
@@ -92,6 +94,7 @@ func TestAddUpdatesExistingEntryOnSameKindAndKey(t *testing.T) {
assertContains(t, listOut, "修订后的摘要")
}
// TestAddFailedValidationStillRegistersRepo verifies add still records the repo when validation fails.
func TestAddFailedValidationStillRegistersRepo(t *testing.T) {
fixture := newRepoMemoryFixture(t)
initGitRepo(t, fixture.RepoPath)
@@ -5,6 +5,7 @@ import (
"testing"
)
// TestEventsReadsHistoryByID verifies events returns newest-first history for an entry ID.
func TestEventsReadsHistoryByID(t *testing.T) {
fixture := newRepoMemoryFixture(t)
runRepoMemoryCommand(t, "init", "--db", fixture.DBPath)
@@ -43,6 +44,7 @@ func TestEventsReadsHistoryByID(t *testing.T) {
}
}
// TestEventsResolvesEntryByRepoKindKey verifies events resolves an entry from the repo-kind-key selector.
func TestEventsResolvesEntryByRepoKindKey(t *testing.T) {
fixture := newRepoMemoryFixture(t)
runRepoMemoryCommand(t, "init", "--db", fixture.DBPath)
@@ -70,6 +72,7 @@ func TestEventsResolvesEntryByRepoKindKey(t *testing.T) {
assertContains(t, eventsOut, "created (- -> confirmed)")
}
// TestEventsRejectsMissingEntrySelector verifies events requires either an ID or repo-kind-key selector.
func TestEventsRejectsMissingEntrySelector(t *testing.T) {
fixture := newRepoMemoryFixture(t)
runRepoMemoryCommand(t, "init", "--db", fixture.DBPath)
@@ -5,6 +5,7 @@ import (
"testing"
)
// TestRepoMemoryRootHelpShowsWorkflowAndCommands verifies root help describes the workflow and available commands.
func TestRepoMemoryRootHelpShowsWorkflowAndCommands(t *testing.T) {
t.Parallel()
@@ -25,6 +26,7 @@ func TestRepoMemoryRootHelpShowsWorkflowAndCommands(t *testing.T) {
}
}
// TestRepoMemoryCommandHelpWorksThroughHelpSubcommand verifies the help subcommand renders command-specific help.
func TestRepoMemoryCommandHelpWorksThroughHelpSubcommand(t *testing.T) {
t.Parallel()
@@ -45,6 +47,7 @@ func TestRepoMemoryCommandHelpWorksThroughHelpSubcommand(t *testing.T) {
}
}
// TestRepoMemoryCommandHelpWorksWithDashHelp verifies --help renders command-specific help.
func TestRepoMemoryCommandHelpWorksWithDashHelp(t *testing.T) {
t.Parallel()
@@ -6,6 +6,7 @@ import (
"testing"
)
// TestIngestImportsDocsAIMarkdown verifies ingest imports docs ai markdown.
func TestIngestImportsDocsAIMarkdown(t *testing.T) {
fixture := newRepoMemoryFixture(t)
runRepoMemoryCommand(t, "init", "--db", fixture.DBPath)
@@ -31,6 +32,7 @@ func TestIngestImportsDocsAIMarkdown(t *testing.T) {
mustContain(t, listOut, "danger:repo-memory:danger-zones [confirmed]")
}
// TestIngestRejectsWhenNoMarkdownFound verifies ingest rejects when no markdown found.
func TestIngestRejectsWhenNoMarkdownFound(t *testing.T) {
fixture := newRepoMemoryFixture(t)
runRepoMemoryCommand(t, "init", "--db", fixture.DBPath)
@@ -52,6 +54,7 @@ func TestIngestRejectsWhenNoMarkdownFound(t *testing.T) {
mustContain(t, stderr, "no markdown files found under "+filepath.Join(fixture.RepoPath, "docs", "ai"))
}
// TestIngestImportsHeadinglessMarkdownAsSingleEntry verifies ingest imports headingless markdown as single entry.
func TestIngestImportsHeadinglessMarkdownAsSingleEntry(t *testing.T) {
fixture := newRepoMemoryFixture(t)
runRepoMemoryCommand(t, "init", "--db", fixture.DBPath)
@@ -6,6 +6,7 @@ import (
"testing"
)
// TestInitCreatesSchemaOnEmptyDB verifies init creates a new database schema.
func TestInitCreatesSchemaOnEmptyDB(t *testing.T) {
dbPath := filepath.Join(t.TempDir(), "repo-memory.db")
@@ -19,6 +20,7 @@ func TestInitCreatesSchemaOnEmptyDB(t *testing.T) {
}
}
// TestInitIsIdempotentOnExistingDB verifies init can be rerun on an existing database.
func TestInitIsIdempotentOnExistingDB(t *testing.T) {
dbPath := filepath.Join(t.TempDir(), "repo-memory.db")
@@ -4,6 +4,7 @@ import (
"testing"
)
// TestLinkCreatesRelationBetweenEntries verifies link creates relation between entries.
func TestLinkCreatesRelationBetweenEntries(t *testing.T) {
fixture := newRepoMemoryFixture(t)
runRepoMemoryCommand(t, "init", "--db", fixture.DBPath)
@@ -43,6 +44,7 @@ func TestLinkCreatesRelationBetweenEntries(t *testing.T) {
}
}
// TestLinkRejectsMissingRelation verifies link rejects missing relation.
func TestLinkRejectsMissingRelation(t *testing.T) {
fixture := newRepoMemoryFixture(t)
runRepoMemoryCommand(t, "init", "--db", fixture.DBPath)
@@ -79,6 +81,7 @@ func TestLinkRejectsMissingRelation(t *testing.T) {
assertContains(t, stderr, "relation is required")
}
// TestLinkRejectsWhenEntryIDMissing verifies link rejects when entry ID missing.
func TestLinkRejectsWhenEntryIDMissing(t *testing.T) {
fixture := newRepoMemoryFixture(t)
runRepoMemoryCommand(t, "init", "--db", fixture.DBPath)
@@ -5,6 +5,7 @@ import (
"testing"
)
// TestListFiltersByKindAndStatus verifies list filters by kind and status.
func TestListFiltersByKindAndStatus(t *testing.T) {
fixture := newRepoMemoryFixture(t)
runRepoMemoryCommand(t, "init", "--db", fixture.DBPath)
@@ -57,6 +58,7 @@ func TestListFiltersByKindAndStatus(t *testing.T) {
mustNotContain(t, listOut, "chain:ai-insight.get")
}
// TestListReturnsNoEntriesWhenEmpty verifies list returns no entries when empty.
func TestListReturnsNoEntriesWhenEmpty(t *testing.T) {
fixture := initRepoMemoryTestDB(t)
@@ -9,6 +9,7 @@ import (
"ai-workflow-skill/packages/repo-memory-runtime/internal/store"
)
// TestVerifyCandidateDetectsFileChange verifies verify candidate detects file change.
func TestVerifyCandidateDetectsFileChange(t *testing.T) {
t.Parallel()
@@ -47,6 +48,7 @@ func TestVerifyCandidateDetectsFileChange(t *testing.T) {
}
}
// TestVerifyCandidateMarksMissingDependencyStale verifies verify candidate marks missing dependency stale.
func TestVerifyCandidateMarksMissingDependencyStale(t *testing.T) {
t.Parallel()
@@ -5,6 +5,7 @@ import (
"testing"
)
// TestReposListsTrackedRepositories verifies repos lists tracked repositories.
func TestReposListsTrackedRepositories(t *testing.T) {
fixture := newRepoMemoryFixture(t)
runRepoMemoryCommand(t, "init", "--db", fixture.DBPath)
@@ -40,6 +41,7 @@ func TestReposListsTrackedRepositories(t *testing.T) {
assertContains(t, reposOut, marsRepo+" (1 entries, updated ")
}
// TestReposPrintsNoReposWhenEmpty verifies repos prints no repos when empty.
func TestReposPrintsNoReposWhenEmpty(t *testing.T) {
fixture := newRepoMemoryFixture(t)
runRepoMemoryCommand(t, "init", "--db", fixture.DBPath)
@@ -5,6 +5,7 @@ import (
"testing"
)
// TestSearchReturnsMatchingEntrySnippet verifies search returns matching entry snippet.
func TestSearchReturnsMatchingEntrySnippet(t *testing.T) {
fixture := newRepoMemoryFixture(t)
runRepoMemoryCommand(t, "init", "--db", fixture.DBPath)
@@ -35,6 +36,7 @@ func TestSearchReturnsMatchingEntrySnippet(t *testing.T) {
mustContain(t, searchOut, "gateway")
}
// TestSearchMatchesAliasWithRepoFilter verifies search matches alias with repo filter.
func TestSearchMatchesAliasWithRepoFilter(t *testing.T) {
fixture := newRepoMemoryFixture(t)
runRepoMemoryCommand(t, "init", "--db", fixture.DBPath)
@@ -83,6 +85,7 @@ func TestSearchMatchesAliasWithRepoFilter(t *testing.T) {
mustNotContain(t, searchOut, "[mars-service]")
}
// TestSearchReturnsNoResultsWhenEmpty verifies search returns no results when empty.
func TestSearchReturnsNoResultsWhenEmpty(t *testing.T) {
fixture := initRepoMemoryTestDB(t)
@@ -98,6 +101,7 @@ func TestSearchReturnsNoResultsWhenEmpty(t *testing.T) {
}
}
// TestSearchRejectsMissingQuery verifies search rejects missing query.
func TestSearchRejectsMissingQuery(t *testing.T) {
fixture := initRepoMemoryTestDB(t)
@@ -6,6 +6,7 @@ import (
"testing"
)
// TestVerifyDowngradesChangedFileDependency verifies verify downgrades changed file dependency.
func TestVerifyDowngradesChangedFileDependency(t *testing.T) {
fixture := newRepoMemoryFixture(t)
runRepoMemoryCommand(t, "init", "--db", fixture.DBPath)
@@ -51,6 +52,7 @@ func TestVerifyDowngradesChangedFileDependency(t *testing.T) {
assertContains(t, eventsOut, "downgraded (confirmed -> needs_review)")
}
// TestVerifyMarksMissingHardDependencyStale verifies verify marks missing hard dependency stale.
func TestVerifyMarksMissingHardDependencyStale(t *testing.T) {
fixture := newRepoMemoryFixture(t)
runRepoMemoryCommand(t, "init", "--db", fixture.DBPath)
@@ -92,6 +94,7 @@ func TestVerifyMarksMissingHardDependencyStale(t *testing.T) {
assertContains(t, eventsOut, "marked_stale (confirmed -> stale)")
}
// TestVerifyPrintsNoReposWhenEmpty verifies verify prints no repos when empty.
func TestVerifyPrintsNoReposWhenEmpty(t *testing.T) {
fixture := newRepoMemoryFixture(t)
runRepoMemoryCommand(t, "init", "--db", fixture.DBPath)
@@ -105,6 +108,7 @@ func TestVerifyPrintsNoReposWhenEmpty(t *testing.T) {
}
}
// TestVerifySkipsExplicitRepoWithoutGitHead verifies verify skips explicit repo without Git head.
func TestVerifySkipsExplicitRepoWithoutGitHead(t *testing.T) {
fixture := newRepoMemoryFixture(t)
runRepoMemoryCommand(t, "init", "--db", fixture.DBPath)
@@ -127,6 +131,7 @@ func TestVerifySkipsExplicitRepoWithoutGitHead(t *testing.T) {
}
}
// TestVerifyDowngradesEntryMissingVerifiedOnCommit verifies verify downgrades entry missing verified on commit.
func TestVerifyDowngradesEntryMissingVerifiedOnCommit(t *testing.T) {
fixture := newRepoMemoryFixture(t)
runRepoMemoryCommand(t, "init", "--db", fixture.DBPath)
@@ -6,6 +6,7 @@ import (
"testing"
)
// TestWorkflowAddSearchEventsRoundtrip verifies workflow add search events roundtrip.
func TestWorkflowAddSearchEventsRoundtrip(t *testing.T) {
fixture := newRepoMemoryFixture(t)
evidencePath := filepath.Join(fixture.RepoPath, "app", "app", "src", "main", "java", "foo", "AITask.java")
@@ -48,6 +49,7 @@ func TestWorkflowAddSearchEventsRoundtrip(t *testing.T) {
assertContains(t, eventsOut, "created")
}
// TestWorkflowIngestSearchListAcrossSections verifies workflow ingest search list across sections.
func TestWorkflowIngestSearchListAcrossSections(t *testing.T) {
fixture := newRepoMemoryFixture(t)
docPath := filepath.Join(fixture.RepoPath, "docs", "ai", "repo-memory.md")
@@ -92,6 +94,7 @@ func TestWorkflowIngestSearchListAcrossSections(t *testing.T) {
assertContains(t, listOut, "danger:repo-memory:danger-zones [confirmed]")
}
// TestWorkflowAddLinkAndResolveRelatedEntry verifies workflow add link and resolve related entry.
func TestWorkflowAddLinkAndResolveRelatedEntry(t *testing.T) {
fixture := newRepoMemoryFixture(t)
evidencePath := filepath.Join(fixture.RepoPath, "docs", "term.md")
@@ -148,6 +151,7 @@ func TestWorkflowAddLinkAndResolveRelatedEntry(t *testing.T) {
assertContains(t, eventsTwo, "chain:ai-insight.get [confirmed] #2")
}
// TestWorkflowVerifyDowngradesAfterRepoChange verifies workflow verify downgrades after repo change.
func TestWorkflowVerifyDowngradesAfterRepoChange(t *testing.T) {
fixture := newRepoMemoryFixture(t)
evidencePath := filepath.Join(fixture.RepoPath, "foo.txt")
@@ -7,6 +7,7 @@ import (
"testing"
)
// TestParseFile verifies ParseFile loads front matter and markdown sections.
func TestParseFile(t *testing.T) {
t.Parallel()
@@ -8,6 +8,7 @@ import (
"ai-workflow-skill/packages/repo-memory-runtime/internal/documents"
)
// TestImportDocumentAndSearch verifies imported document sections are searchable.
func TestImportDocumentAndSearch(t *testing.T) {
t.Parallel()
@@ -64,6 +65,7 @@ func TestImportDocumentAndSearch(t *testing.T) {
}
}
// TestUpsertEntryWithAliasesAndDependencies verifies upsert stores aliases, dependencies, events, and links.
func TestUpsertEntryWithAliasesAndDependencies(t *testing.T) {
t.Parallel()
@@ -175,6 +177,7 @@ func TestUpsertEntryWithAliasesAndDependencies(t *testing.T) {
}
}
// TestApplyVerificationResult verifies verification can downgrade an entry and record the downgrade event.
func TestApplyVerificationResult(t *testing.T) {
t.Parallel()