@amistio/cli 0.1.58 → 0.1.60
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +2 -0
- package/dist/index.js +202 -6
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -107,6 +107,8 @@ Current runners recover abandoned server claims without impersonating the old ow
|
|
|
107
107
|
|
|
108
108
|
Watch mode prints a completed-work success once per work item, keeps fresh completion visible briefly, and returns old completed work to the ready state when no queued, running, blocked, failed, review, or runner-readiness action needs attention. Unchanged idle-ready status is printed once and then stays quiet until the next action changes.
|
|
109
109
|
|
|
110
|
+
If no work is claimed but a retryable project-status read fails, watch mode prints `Status unavailable` and retries on the next poll. This status is about the idle next-action summary, not the claimed work or finalization path.
|
|
111
|
+
|
|
110
112
|
Known validation failures such as `unsafe_context_path` are printed with attention-needed next steps. For project-context refresh path-safety failures, deploy the latest web/API fix, update and restart the runner when applicable, retry the refresh, and capture only bounded non-secret output if it repeats.
|
|
111
113
|
|
|
112
114
|
If watch mode reports that the runner was forgotten by the server, run `amistio runner repair` from the paired checkout, then start `amistio run --watch` again. The repair command stores a fresh local runner ID because the default ID for a machine/project/repository is stable and can remain tombstoned. Use `--clear-credential` only when the Runner panel tells you to create a fresh pairing code.
|
package/dist/index.js
CHANGED
|
@@ -5857,6 +5857,18 @@ function formatWatchStartupContext(input) {
|
|
|
5857
5857
|
function formatWatchIdleLine(action, intervalSeconds) {
|
|
5858
5858
|
return `${formatProjectNextAction(action)} Checking again in ${intervalSeconds}s.`;
|
|
5859
5859
|
}
|
|
5860
|
+
function projectStatusUnavailableActionForError(error) {
|
|
5861
|
+
if (!isRetryableApiError(error)) {
|
|
5862
|
+
return void 0;
|
|
5863
|
+
}
|
|
5864
|
+
return {
|
|
5865
|
+
kind: "idle",
|
|
5866
|
+
actor: "system",
|
|
5867
|
+
tone: "warning",
|
|
5868
|
+
title: "Status unavailable",
|
|
5869
|
+
message: "No work was claimed, but Amistio could not load the latest project status. The runner will retry on the next poll."
|
|
5870
|
+
};
|
|
5871
|
+
}
|
|
5860
5872
|
function shouldPrintWatchState(action, previous, nowMs, reminderMs = watchStateReminderMs) {
|
|
5861
5873
|
const key = watchStateKey(action);
|
|
5862
5874
|
if (!previous || previous.key !== key) {
|
|
@@ -7788,12 +7800,92 @@ var canonicalTestCommandKinds = /* @__PURE__ */ new Map([
|
|
|
7788
7800
|
]);
|
|
7789
7801
|
var canonicalProjectContextCitationSources = /* @__PURE__ */ new Map([
|
|
7790
7802
|
["projectbrain", "projectBrain"],
|
|
7803
|
+
["brain", "projectBrain"],
|
|
7804
|
+
["docs", "projectBrain"],
|
|
7805
|
+
["document", "projectBrain"],
|
|
7806
|
+
["documents", "projectBrain"],
|
|
7807
|
+
["decision", "projectBrain"],
|
|
7808
|
+
["decisions", "projectBrain"],
|
|
7809
|
+
["plan", "projectBrain"],
|
|
7810
|
+
["plans", "projectBrain"],
|
|
7811
|
+
["prompt", "projectBrain"],
|
|
7812
|
+
["prompts", "projectBrain"],
|
|
7813
|
+
["feature", "projectBrain"],
|
|
7814
|
+
["features", "projectBrain"],
|
|
7791
7815
|
["approvedbrain", "projectBrain"],
|
|
7792
7816
|
["approvedprojectbrain", "projectBrain"],
|
|
7817
|
+
["approvedcontext", "projectBrain"],
|
|
7793
7818
|
["localsource", "localSource"],
|
|
7819
|
+
["source", "localSource"],
|
|
7820
|
+
["repository", "localSource"],
|
|
7821
|
+
["repo", "localSource"],
|
|
7822
|
+
["file", "localSource"],
|
|
7823
|
+
["files", "localSource"],
|
|
7824
|
+
["code", "localSource"],
|
|
7825
|
+
["workspace", "localSource"],
|
|
7826
|
+
["local", "localSource"],
|
|
7794
7827
|
["runnerstate", "runnerState"],
|
|
7828
|
+
["runner", "runnerState"],
|
|
7829
|
+
["workitem", "runnerState"],
|
|
7830
|
+
["work", "runnerState"],
|
|
7831
|
+
["claim", "runnerState"],
|
|
7832
|
+
["heartbeat", "runnerState"],
|
|
7833
|
+
["status", "runnerState"],
|
|
7834
|
+
["log", "runnerState"],
|
|
7835
|
+
["logs", "runnerState"],
|
|
7836
|
+
["execution", "runnerState"],
|
|
7795
7837
|
["mixed", "mixed"]
|
|
7796
7838
|
]);
|
|
7839
|
+
var canonicalImplementationVerificationEvidenceStatuses = /* @__PURE__ */ new Map([
|
|
7840
|
+
["satisfied", "satisfied"],
|
|
7841
|
+
["implemented", "satisfied"],
|
|
7842
|
+
["verified", "satisfied"],
|
|
7843
|
+
["complete", "satisfied"],
|
|
7844
|
+
["completed", "satisfied"],
|
|
7845
|
+
["passed", "satisfied"],
|
|
7846
|
+
["passing", "satisfied"],
|
|
7847
|
+
["present", "satisfied"],
|
|
7848
|
+
["done", "satisfied"],
|
|
7849
|
+
["met", "satisfied"],
|
|
7850
|
+
["fulfilled", "satisfied"],
|
|
7851
|
+
["success", "satisfied"],
|
|
7852
|
+
["successful", "satisfied"],
|
|
7853
|
+
["partial", "partial"],
|
|
7854
|
+
["partiallyimplemented", "partial"],
|
|
7855
|
+
["partlyimplemented", "partial"],
|
|
7856
|
+
["partiallymet", "partial"],
|
|
7857
|
+
["incomplete", "partial"],
|
|
7858
|
+
["mixed", "partial"],
|
|
7859
|
+
["warning", "partial"],
|
|
7860
|
+
["warnings", "partial"],
|
|
7861
|
+
["needswork", "partial"],
|
|
7862
|
+
["needsreview", "partial"],
|
|
7863
|
+
["repairneeded", "partial"],
|
|
7864
|
+
["followupneeded", "partial"],
|
|
7865
|
+
["missing", "missing"],
|
|
7866
|
+
["absent", "missing"],
|
|
7867
|
+
["failed", "missing"],
|
|
7868
|
+
["failing", "missing"],
|
|
7869
|
+
["failure", "missing"],
|
|
7870
|
+
["notimplemented", "missing"],
|
|
7871
|
+
["noimplementation", "missing"],
|
|
7872
|
+
["notpresent", "missing"],
|
|
7873
|
+
["unmet", "missing"],
|
|
7874
|
+
["gap", "missing"],
|
|
7875
|
+
["gaps", "missing"],
|
|
7876
|
+
["notfound", "missing"],
|
|
7877
|
+
["unknown", "unknown"],
|
|
7878
|
+
["uncertain", "unknown"],
|
|
7879
|
+
["inconclusive", "unknown"],
|
|
7880
|
+
["unverified", "unknown"],
|
|
7881
|
+
["notchecked", "unknown"],
|
|
7882
|
+
["unchecked", "unknown"],
|
|
7883
|
+
["unavailable", "unknown"],
|
|
7884
|
+
["skipped", "unknown"],
|
|
7885
|
+
["blocked", "unknown"],
|
|
7886
|
+
["blockedenvironment", "unknown"],
|
|
7887
|
+
["verificationblocked", "unknown"]
|
|
7888
|
+
]);
|
|
7797
7889
|
var canonicalProjectContextFreshnessValues = /* @__PURE__ */ new Map([
|
|
7798
7890
|
["fresh", "fresh"],
|
|
7799
7891
|
["current", "fresh"],
|
|
@@ -7917,7 +8009,11 @@ function createImplementationVerificationPrompt(workItem) {
|
|
|
7917
8009
|
"",
|
|
7918
8010
|
"Print exactly one JSON object between the markers below. The CLI will submit only this structured verification result back to Amistio.",
|
|
7919
8011
|
"Accepted outcome values: verifiedImplemented, partiallyImplemented, notImplemented, inconclusive, verificationBlocked.",
|
|
8012
|
+
"Accepted evidence status values: satisfied, partial, missing, unknown.",
|
|
8013
|
+
"Accepted check status values: passed, failed, blocked, skipped.",
|
|
8014
|
+
"Accepted citation source values: projectBrain, localSource, runnerState, mixed.",
|
|
7920
8015
|
"Accepted recommendation values: none, requeue, createFollowUpPlan, requestHumanReview, markBlocked.",
|
|
8016
|
+
"Omit optional fields when unavailable; do not invent non-canonical enum values.",
|
|
7921
8017
|
"",
|
|
7922
8018
|
implementationVerificationStart,
|
|
7923
8019
|
'{"outcome":"partiallyImplemented","summary":"The implementation is present in the workspace, but one acceptance check could not be confirmed.","evidence":[{"acceptanceCriterion":"The requested behavior is wired through the runner lifecycle.","status":"partial","summary":"The route and UI wiring exist, but the runner result submission still needs validation.","citations":[{"source":"localSource","repoPath":"src/apps/web/components/workspace-client.tsx","excerpt":"Implementation verification queued for the local runner."}]}],"checks":[{"name":"Focused typecheck","status":"passed","summary":"The touched package typechecked successfully.","safePaths":["src/apps/web"]}],"gaps":["Runner result submission was not exercised end to end."],"recommendation":"requestHumanReview","verificationPlan":["Run focused CLI tests","Review the verification evidence in Amistio"],"warnings":[]}',
|
|
@@ -8804,7 +8900,96 @@ function parseImplementationVerificationResult(output) {
|
|
|
8804
8900
|
}
|
|
8805
8901
|
const payload = output.slice(start + implementationVerificationStart.length, end).trim();
|
|
8806
8902
|
const parsed = JSON.parse(stripJsonFence(payload));
|
|
8807
|
-
return implementationVerificationResultSchema.parse(parsed);
|
|
8903
|
+
return implementationVerificationResultSchema.parse(normalizeImplementationVerificationResult(parsed));
|
|
8904
|
+
}
|
|
8905
|
+
function normalizeImplementationVerificationResult(value) {
|
|
8906
|
+
if (!isObjectRecord(value)) {
|
|
8907
|
+
return value;
|
|
8908
|
+
}
|
|
8909
|
+
const normalized = { ...value };
|
|
8910
|
+
if (Array.isArray(normalized.evidence)) {
|
|
8911
|
+
normalized.evidence = normalized.evidence.map((evidence) => {
|
|
8912
|
+
if (!isObjectRecord(evidence)) {
|
|
8913
|
+
return evidence;
|
|
8914
|
+
}
|
|
8915
|
+
const normalizedEvidence = {
|
|
8916
|
+
...evidence,
|
|
8917
|
+
status: normalizeImplementationVerificationEvidenceStatus(evidence.status)
|
|
8918
|
+
};
|
|
8919
|
+
if (Array.isArray(normalizedEvidence.citations)) {
|
|
8920
|
+
normalizedEvidence.citations = normalizedEvidence.citations.map(normalizeImplementationVerificationCitation);
|
|
8921
|
+
}
|
|
8922
|
+
return normalizedEvidence;
|
|
8923
|
+
});
|
|
8924
|
+
}
|
|
8925
|
+
return normalized;
|
|
8926
|
+
}
|
|
8927
|
+
function normalizeImplementationVerificationEvidenceStatus(value) {
|
|
8928
|
+
if (typeof value !== "string") {
|
|
8929
|
+
return value;
|
|
8930
|
+
}
|
|
8931
|
+
const key = normalizeEnumKey(value);
|
|
8932
|
+
if (!key) {
|
|
8933
|
+
return "unknown";
|
|
8934
|
+
}
|
|
8935
|
+
const direct = canonicalImplementationVerificationEvidenceStatuses.get(key);
|
|
8936
|
+
if (direct) {
|
|
8937
|
+
return direct;
|
|
8938
|
+
}
|
|
8939
|
+
for (const segment of value.split(/[\/,|]+/)) {
|
|
8940
|
+
const segmentStatus = canonicalImplementationVerificationEvidenceStatuses.get(normalizeEnumKey(segment));
|
|
8941
|
+
if (segmentStatus) {
|
|
8942
|
+
return segmentStatus;
|
|
8943
|
+
}
|
|
8944
|
+
}
|
|
8945
|
+
if (key.includes("notimplemented") || key.includes("noimplementation") || key.includes("notpresent") || key.includes("notfound") || key.includes("missing") || key.includes("absent") || key.includes("failed") || key.includes("failing") || key.includes("unmet")) {
|
|
8946
|
+
return "missing";
|
|
8947
|
+
}
|
|
8948
|
+
if (key.includes("partial") || key.includes("incomplete") || key.includes("mixed") || key.includes("needs") || key.includes("followup") || key.includes("repair")) {
|
|
8949
|
+
return "partial";
|
|
8950
|
+
}
|
|
8951
|
+
if (key.includes("implemented") || key.includes("verified") || key.includes("passed") || key.includes("passing") || key.includes("satisfied") || key.includes("complete") || key.includes("present")) {
|
|
8952
|
+
return "satisfied";
|
|
8953
|
+
}
|
|
8954
|
+
return "unknown";
|
|
8955
|
+
}
|
|
8956
|
+
function normalizeImplementationVerificationCitation(value) {
|
|
8957
|
+
if (!isObjectRecord(value)) {
|
|
8958
|
+
return value;
|
|
8959
|
+
}
|
|
8960
|
+
return {
|
|
8961
|
+
...value,
|
|
8962
|
+
source: normalizeImplementationVerificationCitationSource(value.source)
|
|
8963
|
+
};
|
|
8964
|
+
}
|
|
8965
|
+
function normalizeImplementationVerificationCitationSource(value) {
|
|
8966
|
+
if (typeof value !== "string") {
|
|
8967
|
+
return value;
|
|
8968
|
+
}
|
|
8969
|
+
const key = normalizeEnumKey(value);
|
|
8970
|
+
if (!key) {
|
|
8971
|
+
return "mixed";
|
|
8972
|
+
}
|
|
8973
|
+
const direct = canonicalProjectContextCitationSources.get(key);
|
|
8974
|
+
if (direct) {
|
|
8975
|
+
return direct;
|
|
8976
|
+
}
|
|
8977
|
+
for (const segment of value.split(/[\/,|]+/)) {
|
|
8978
|
+
const segmentSource = canonicalProjectContextCitationSources.get(normalizeEnumKey(segment));
|
|
8979
|
+
if (segmentSource) {
|
|
8980
|
+
return segmentSource;
|
|
8981
|
+
}
|
|
8982
|
+
}
|
|
8983
|
+
if (key.includes("projectbrain") || key.includes("brain") || key.includes("approvedcontext") || key.includes("document") || key.includes("docs") || key.includes("decision") || key.includes("plan") || key.includes("prompt") || key.includes("feature")) {
|
|
8984
|
+
return "projectBrain";
|
|
8985
|
+
}
|
|
8986
|
+
if (key.includes("localsource") || key.includes("source") || key.includes("repository") || key.includes("repo") || key.includes("file") || key.includes("code") || key.includes("workspace")) {
|
|
8987
|
+
return "localSource";
|
|
8988
|
+
}
|
|
8989
|
+
if (key.includes("runnerstate") || key.includes("runner") || key.includes("workitem") || key.includes("claim") || key.includes("heartbeat") || key.includes("execution") || key.includes("log")) {
|
|
8990
|
+
return "runnerState";
|
|
8991
|
+
}
|
|
8992
|
+
return "mixed";
|
|
8808
8993
|
}
|
|
8809
8994
|
function parseTestQualityScanResult(output) {
|
|
8810
8995
|
const start = output.indexOf(testQualityStart);
|
|
@@ -14983,11 +15168,22 @@ function runnerIdentityScope(metadata) {
|
|
|
14983
15168
|
};
|
|
14984
15169
|
}
|
|
14985
15170
|
async function loadProjectNextAction(apiClient, projectId, repositoryLinkId, root) {
|
|
14986
|
-
|
|
14987
|
-
|
|
14988
|
-
|
|
14989
|
-
|
|
14990
|
-
|
|
15171
|
+
let workItems;
|
|
15172
|
+
let documents;
|
|
15173
|
+
let runners;
|
|
15174
|
+
try {
|
|
15175
|
+
[{ workItems }, { documents }, { runners }] = await Promise.all([
|
|
15176
|
+
apiClient.listWorkItems(projectId),
|
|
15177
|
+
apiClient.listBrainDocuments(projectId),
|
|
15178
|
+
apiClient.listRunners(projectId).catch(() => ({ runners: [] }))
|
|
15179
|
+
]);
|
|
15180
|
+
} catch (error) {
|
|
15181
|
+
const fallback = projectStatusUnavailableActionForError(error);
|
|
15182
|
+
if (fallback) {
|
|
15183
|
+
return fallback;
|
|
15184
|
+
}
|
|
15185
|
+
throw error;
|
|
15186
|
+
}
|
|
14991
15187
|
return computeProjectNextAction({
|
|
14992
15188
|
projectId,
|
|
14993
15189
|
repositoryLinks: [createCliRepositoryLink({ amistioAccountId: "local_runner", amistioProjectId: projectId, repositoryLinkId, defaultBranch: "main", lastSyncedRevision: 0 }, root)],
|