@amistio/cli 0.1.58 → 0.1.59

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.
Files changed (2) hide show
  1. package/dist/index.js +174 -1
  2. package/package.json +1 -1
package/dist/index.js CHANGED
@@ -7788,12 +7788,92 @@ var canonicalTestCommandKinds = /* @__PURE__ */ new Map([
7788
7788
  ]);
7789
7789
  var canonicalProjectContextCitationSources = /* @__PURE__ */ new Map([
7790
7790
  ["projectbrain", "projectBrain"],
7791
+ ["brain", "projectBrain"],
7792
+ ["docs", "projectBrain"],
7793
+ ["document", "projectBrain"],
7794
+ ["documents", "projectBrain"],
7795
+ ["decision", "projectBrain"],
7796
+ ["decisions", "projectBrain"],
7797
+ ["plan", "projectBrain"],
7798
+ ["plans", "projectBrain"],
7799
+ ["prompt", "projectBrain"],
7800
+ ["prompts", "projectBrain"],
7801
+ ["feature", "projectBrain"],
7802
+ ["features", "projectBrain"],
7791
7803
  ["approvedbrain", "projectBrain"],
7792
7804
  ["approvedprojectbrain", "projectBrain"],
7805
+ ["approvedcontext", "projectBrain"],
7793
7806
  ["localsource", "localSource"],
7807
+ ["source", "localSource"],
7808
+ ["repository", "localSource"],
7809
+ ["repo", "localSource"],
7810
+ ["file", "localSource"],
7811
+ ["files", "localSource"],
7812
+ ["code", "localSource"],
7813
+ ["workspace", "localSource"],
7814
+ ["local", "localSource"],
7794
7815
  ["runnerstate", "runnerState"],
7816
+ ["runner", "runnerState"],
7817
+ ["workitem", "runnerState"],
7818
+ ["work", "runnerState"],
7819
+ ["claim", "runnerState"],
7820
+ ["heartbeat", "runnerState"],
7821
+ ["status", "runnerState"],
7822
+ ["log", "runnerState"],
7823
+ ["logs", "runnerState"],
7824
+ ["execution", "runnerState"],
7795
7825
  ["mixed", "mixed"]
7796
7826
  ]);
7827
+ var canonicalImplementationVerificationEvidenceStatuses = /* @__PURE__ */ new Map([
7828
+ ["satisfied", "satisfied"],
7829
+ ["implemented", "satisfied"],
7830
+ ["verified", "satisfied"],
7831
+ ["complete", "satisfied"],
7832
+ ["completed", "satisfied"],
7833
+ ["passed", "satisfied"],
7834
+ ["passing", "satisfied"],
7835
+ ["present", "satisfied"],
7836
+ ["done", "satisfied"],
7837
+ ["met", "satisfied"],
7838
+ ["fulfilled", "satisfied"],
7839
+ ["success", "satisfied"],
7840
+ ["successful", "satisfied"],
7841
+ ["partial", "partial"],
7842
+ ["partiallyimplemented", "partial"],
7843
+ ["partlyimplemented", "partial"],
7844
+ ["partiallymet", "partial"],
7845
+ ["incomplete", "partial"],
7846
+ ["mixed", "partial"],
7847
+ ["warning", "partial"],
7848
+ ["warnings", "partial"],
7849
+ ["needswork", "partial"],
7850
+ ["needsreview", "partial"],
7851
+ ["repairneeded", "partial"],
7852
+ ["followupneeded", "partial"],
7853
+ ["missing", "missing"],
7854
+ ["absent", "missing"],
7855
+ ["failed", "missing"],
7856
+ ["failing", "missing"],
7857
+ ["failure", "missing"],
7858
+ ["notimplemented", "missing"],
7859
+ ["noimplementation", "missing"],
7860
+ ["notpresent", "missing"],
7861
+ ["unmet", "missing"],
7862
+ ["gap", "missing"],
7863
+ ["gaps", "missing"],
7864
+ ["notfound", "missing"],
7865
+ ["unknown", "unknown"],
7866
+ ["uncertain", "unknown"],
7867
+ ["inconclusive", "unknown"],
7868
+ ["unverified", "unknown"],
7869
+ ["notchecked", "unknown"],
7870
+ ["unchecked", "unknown"],
7871
+ ["unavailable", "unknown"],
7872
+ ["skipped", "unknown"],
7873
+ ["blocked", "unknown"],
7874
+ ["blockedenvironment", "unknown"],
7875
+ ["verificationblocked", "unknown"]
7876
+ ]);
7797
7877
  var canonicalProjectContextFreshnessValues = /* @__PURE__ */ new Map([
7798
7878
  ["fresh", "fresh"],
7799
7879
  ["current", "fresh"],
@@ -7917,7 +7997,11 @@ function createImplementationVerificationPrompt(workItem) {
7917
7997
  "",
7918
7998
  "Print exactly one JSON object between the markers below. The CLI will submit only this structured verification result back to Amistio.",
7919
7999
  "Accepted outcome values: verifiedImplemented, partiallyImplemented, notImplemented, inconclusive, verificationBlocked.",
8000
+ "Accepted evidence status values: satisfied, partial, missing, unknown.",
8001
+ "Accepted check status values: passed, failed, blocked, skipped.",
8002
+ "Accepted citation source values: projectBrain, localSource, runnerState, mixed.",
7920
8003
  "Accepted recommendation values: none, requeue, createFollowUpPlan, requestHumanReview, markBlocked.",
8004
+ "Omit optional fields when unavailable; do not invent non-canonical enum values.",
7921
8005
  "",
7922
8006
  implementationVerificationStart,
7923
8007
  '{"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 +8888,96 @@ function parseImplementationVerificationResult(output) {
8804
8888
  }
8805
8889
  const payload = output.slice(start + implementationVerificationStart.length, end).trim();
8806
8890
  const parsed = JSON.parse(stripJsonFence(payload));
8807
- return implementationVerificationResultSchema.parse(parsed);
8891
+ return implementationVerificationResultSchema.parse(normalizeImplementationVerificationResult(parsed));
8892
+ }
8893
+ function normalizeImplementationVerificationResult(value) {
8894
+ if (!isObjectRecord(value)) {
8895
+ return value;
8896
+ }
8897
+ const normalized = { ...value };
8898
+ if (Array.isArray(normalized.evidence)) {
8899
+ normalized.evidence = normalized.evidence.map((evidence) => {
8900
+ if (!isObjectRecord(evidence)) {
8901
+ return evidence;
8902
+ }
8903
+ const normalizedEvidence = {
8904
+ ...evidence,
8905
+ status: normalizeImplementationVerificationEvidenceStatus(evidence.status)
8906
+ };
8907
+ if (Array.isArray(normalizedEvidence.citations)) {
8908
+ normalizedEvidence.citations = normalizedEvidence.citations.map(normalizeImplementationVerificationCitation);
8909
+ }
8910
+ return normalizedEvidence;
8911
+ });
8912
+ }
8913
+ return normalized;
8914
+ }
8915
+ function normalizeImplementationVerificationEvidenceStatus(value) {
8916
+ if (typeof value !== "string") {
8917
+ return value;
8918
+ }
8919
+ const key = normalizeEnumKey(value);
8920
+ if (!key) {
8921
+ return "unknown";
8922
+ }
8923
+ const direct = canonicalImplementationVerificationEvidenceStatuses.get(key);
8924
+ if (direct) {
8925
+ return direct;
8926
+ }
8927
+ for (const segment of value.split(/[\/,|]+/)) {
8928
+ const segmentStatus = canonicalImplementationVerificationEvidenceStatuses.get(normalizeEnumKey(segment));
8929
+ if (segmentStatus) {
8930
+ return segmentStatus;
8931
+ }
8932
+ }
8933
+ 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")) {
8934
+ return "missing";
8935
+ }
8936
+ if (key.includes("partial") || key.includes("incomplete") || key.includes("mixed") || key.includes("needs") || key.includes("followup") || key.includes("repair")) {
8937
+ return "partial";
8938
+ }
8939
+ if (key.includes("implemented") || key.includes("verified") || key.includes("passed") || key.includes("passing") || key.includes("satisfied") || key.includes("complete") || key.includes("present")) {
8940
+ return "satisfied";
8941
+ }
8942
+ return "unknown";
8943
+ }
8944
+ function normalizeImplementationVerificationCitation(value) {
8945
+ if (!isObjectRecord(value)) {
8946
+ return value;
8947
+ }
8948
+ return {
8949
+ ...value,
8950
+ source: normalizeImplementationVerificationCitationSource(value.source)
8951
+ };
8952
+ }
8953
+ function normalizeImplementationVerificationCitationSource(value) {
8954
+ if (typeof value !== "string") {
8955
+ return value;
8956
+ }
8957
+ const key = normalizeEnumKey(value);
8958
+ if (!key) {
8959
+ return "mixed";
8960
+ }
8961
+ const direct = canonicalProjectContextCitationSources.get(key);
8962
+ if (direct) {
8963
+ return direct;
8964
+ }
8965
+ for (const segment of value.split(/[\/,|]+/)) {
8966
+ const segmentSource = canonicalProjectContextCitationSources.get(normalizeEnumKey(segment));
8967
+ if (segmentSource) {
8968
+ return segmentSource;
8969
+ }
8970
+ }
8971
+ 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")) {
8972
+ return "projectBrain";
8973
+ }
8974
+ if (key.includes("localsource") || key.includes("source") || key.includes("repository") || key.includes("repo") || key.includes("file") || key.includes("code") || key.includes("workspace")) {
8975
+ return "localSource";
8976
+ }
8977
+ if (key.includes("runnerstate") || key.includes("runner") || key.includes("workitem") || key.includes("claim") || key.includes("heartbeat") || key.includes("execution") || key.includes("log")) {
8978
+ return "runnerState";
8979
+ }
8980
+ return "mixed";
8808
8981
  }
8809
8982
  function parseTestQualityScanResult(output) {
8810
8983
  const start = output.indexOf(testQualityStart);
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@amistio/cli",
3
- "version": "0.1.58",
3
+ "version": "0.1.59",
4
4
  "type": "module",
5
5
  "repository": {
6
6
  "type": "git",