@skitterbyte/skitterspec-azure-boards 1.3.0 → 2.0.0
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/MIGRATION.md +141 -1
- package/README.md +8 -7
- package/assets/core/SETUP.md +8 -45
- package/assets/core/azure-boards.config.md +53 -6
- package/assets/rules/spec-planning.md +13 -3
- package/assets/skills/spec-azure-setup/SKILL.md +2 -1
- package/assets/skills/spec-list/SKILL.md +28 -5
- package/assets/skills/spec-status/SKILL.md +28 -26
- package/assets/skills/spec-sync/SKILL.md +11 -14
- package/package.json +1 -1
- package/src/vendor/azure-boards/api.js +18 -184
- package/src/vendor/azure-boards/cli-sync.js +73 -68
- package/src/vendor/azure-boards/config.js +9 -52
- package/src/vendor/provider-kit/src/config.js +101 -48
- package/src/vendor/provider-kit/src/list-assignee.js +71 -0
- package/src/vendor/provider-kit/src/list-rows.js +35 -0
- package/src/vendor/provider-kit/src/released.js +27 -77
- package/src/vendor/provider-kit/src/specs.js +89 -7
- package/src/vendor/sync-core/index.js +3 -4
- package/src/vendor/sync-core/src/compare.js +6 -6
- package/src/vendor/sync-core/src/normalize.js +30 -57
- package/src/vendor/provider-kit/src/releases.js +0 -595
|
@@ -751,39 +751,27 @@ function phasesWithheld(snapshotDir, config) {
|
|
|
751
751
|
|
|
752
752
|
// --- remote projection ------------------------------------------------------
|
|
753
753
|
|
|
754
|
-
//
|
|
755
|
-
//
|
|
756
|
-
//
|
|
757
|
-
//
|
|
758
|
-
|
|
759
|
-
|
|
760
|
-
|
|
761
|
-
|
|
762
|
-
if (state == null) return null
|
|
763
|
-
const want = String(state).toLowerCase().trim()
|
|
764
|
-
const stages = (config && config.release && config.release.stages) || []
|
|
765
|
-
if (!Array.isArray(stages)) return null
|
|
766
|
-
return stages.find((s) => s && typeof s.state === 'string' && s.state.toLowerCase().trim() === want) || null
|
|
754
|
+
// Every tracker state NAME that means this bucket: the one push writes
|
|
755
|
+
// (`states[bucket]`) first, then its read-only aliases (`stateAliases[bucket]`,
|
|
756
|
+
// from the array form of `states`). Readers use the whole list; writers only
|
|
757
|
+
// ever use `states[bucket]`, so an alias can never be written.
|
|
758
|
+
function stateNamesFor(bucket, config) {
|
|
759
|
+
const primary = config && config.states && config.states[bucket]
|
|
760
|
+
const aliases = (config && config.stateAliases && config.stateAliases[bucket]) || []
|
|
761
|
+
return [primary, ...(Array.isArray(aliases) ? aliases : [])].filter((n) => typeof n === 'string' && n)
|
|
767
762
|
}
|
|
768
763
|
|
|
769
764
|
// Map a remote workflow-state name back to the local lifecycle bucket (the
|
|
770
765
|
// vocabulary `spec_status` uses) via config.states, so local and remote
|
|
771
766
|
// workflowState hash equal when semantically equal. Falls back to a lowercased
|
|
772
767
|
// raw value when the state isn't one of the configured names.
|
|
773
|
-
//
|
|
774
|
-
// A DECLARED DEPLOYMENT STAGE reads as `complete`, deliberately. Without this
|
|
775
|
-
// the fallback lowercases it — "On Test" becomes "on test", which equals no
|
|
776
|
-
// bucket — and every deployed spec reports as drifted forever, for the whole
|
|
777
|
-
// time it sits in the pipeline. The project told us these states are downstream
|
|
778
|
-
// of a finished spec, so they are not a disagreement about where the spec is.
|
|
779
768
|
function bucketForState(state, config) {
|
|
780
769
|
if (state == null) return null
|
|
781
770
|
const states = (config && config.states) || {}
|
|
782
771
|
const want = String(state).toLowerCase().trim()
|
|
783
|
-
for (const
|
|
784
|
-
if (
|
|
772
|
+
for (const bucket of Object.keys(states)) {
|
|
773
|
+
if (stateNamesFor(bucket, config).some((name) => name.toLowerCase().trim() === want)) return bucket
|
|
785
774
|
}
|
|
786
|
-
if (stageForState(state, config)) return LADDER_ORIGIN_BUCKET
|
|
787
775
|
return want
|
|
788
776
|
}
|
|
789
777
|
|
|
@@ -818,11 +806,20 @@ function remoteWorkflowState(issue, config) {
|
|
|
818
806
|
return name != null ? bucketForState(name, config) : null
|
|
819
807
|
}
|
|
820
808
|
|
|
821
|
-
//
|
|
822
|
-
//
|
|
823
|
-
//
|
|
824
|
-
|
|
825
|
-
|
|
809
|
+
// What the drift report needs to know about a remote issue's state: its name,
|
|
810
|
+
// the bucket it maps to, and whether it maps to one at all. Null when the
|
|
811
|
+
// payload carried no state — a cannot-tell, never an answer.
|
|
812
|
+
//
|
|
813
|
+
// AN UNMAPPED STATE IS NOT A DISAGREEMENT. A tracker grows states skitterspec
|
|
814
|
+
// never names ("Blocked", "Next Sprint"), and a ticket a person moved into one
|
|
815
|
+
// is not wrong about the spec — it is somewhere push does not manage, and push
|
|
816
|
+
// will not move it until the spec itself moves. `mapped` is what lets a report
|
|
817
|
+
// say that rather than accuse it.
|
|
818
|
+
function remoteStateReading(issue, config) {
|
|
819
|
+
const name = remoteStateName(issue || {}, config)
|
|
820
|
+
if (name == null) return null
|
|
821
|
+
const bucket = bucketForState(name, config)
|
|
822
|
+
return { name: String(name), bucket, mapped: LIFECYCLE_BUCKETS.includes(bucket) }
|
|
826
823
|
}
|
|
827
824
|
|
|
828
825
|
// A Linear issue title is plain text, so markdown emphasis is noise there — and
|
|
@@ -897,24 +894,16 @@ function titleFromText(text, max = 100) {
|
|
|
897
894
|
return stripTitleMarkup(title)
|
|
898
895
|
}
|
|
899
896
|
|
|
900
|
-
// Every state NAME the config points at: the lifecycle bucket map
|
|
901
|
-
// project's deployment ladder when it declares one. Both reach Linear the same
|
|
902
|
-
// way and fail the same way, so both are checked by the same lookup.
|
|
897
|
+
// Every state NAME the config points at: the lifecycle bucket map.
|
|
903
898
|
function configuredStateNames(config) {
|
|
904
|
-
|
|
905
|
-
|
|
906
|
-
|
|
907
|
-
if (stage && typeof stage.state === 'string') names.push(stage.state)
|
|
908
|
-
}
|
|
909
|
-
return names
|
|
899
|
+
// The WRITTEN names only. An alias is never written, so one the workspace
|
|
900
|
+
// lacks cannot strand a push; `stateSuggestions` still names it in reports.
|
|
901
|
+
return Object.values((config && config.states) || {}).filter((v) => typeof v === 'string')
|
|
910
902
|
}
|
|
911
903
|
|
|
912
904
|
// Which configured state NAMES are absent from the live workspace. The skill
|
|
913
905
|
// fetches the workspace's project-status names over MCP and passes them here;
|
|
914
906
|
// a non-empty result means a typo/rename that Linear would silently no-op.
|
|
915
|
-
//
|
|
916
|
-
// A project with no `release.stages` contributes nothing here, so the ladder
|
|
917
|
-
// cannot make this accuse a config that was fine before it existed.
|
|
918
907
|
function validateStates(config, workspaceStates) {
|
|
919
908
|
const configured = configuredStateNames(config)
|
|
920
909
|
const have = new Set((workspaceStates || []).map((s) => String(s).toLowerCase().trim()))
|
|
@@ -953,21 +942,6 @@ function stateSuggestions(config, workspaceStates) {
|
|
|
953
942
|
const suggestion = names.find((n) => words.includes(n.toLowerCase().trim())) || null
|
|
954
943
|
out.push({ bucket, configured, suggestion, label: `states.${bucket}` })
|
|
955
944
|
}
|
|
956
|
-
// Deployment-ladder rungs, reported the same way. No suggestion is offered:
|
|
957
|
-
// BUCKET_WORDS describes lifecycle vocabulary, and a stage name is the
|
|
958
|
-
// project's own — guessing "On Test" meant "In Progress" would be worse than
|
|
959
|
-
// saying nothing.
|
|
960
|
-
const stages = (config && config.release && config.release.stages) || []
|
|
961
|
-
for (const stage of Array.isArray(stages) ? stages : []) {
|
|
962
|
-
if (!stage || typeof stage.state !== 'string') continue
|
|
963
|
-
if (have.has(stage.state.toLowerCase().trim())) continue
|
|
964
|
-
out.push({
|
|
965
|
-
bucket: null,
|
|
966
|
-
configured: stage.state,
|
|
967
|
-
suggestion: null,
|
|
968
|
-
label: `release.stages[${stage.key}]`,
|
|
969
|
-
})
|
|
970
|
-
}
|
|
971
945
|
return out
|
|
972
946
|
}
|
|
973
947
|
|
|
@@ -991,8 +965,7 @@ module.exports = {
|
|
|
991
965
|
canonicalRemoteStatus,
|
|
992
966
|
bucketForState,
|
|
993
967
|
LIFECYCLE_BUCKETS,
|
|
994
|
-
stageForState,
|
|
995
|
-
remoteStage,
|
|
996
968
|
remoteWorkflowState,
|
|
997
|
-
|
|
969
|
+
remoteStateReading,
|
|
970
|
+
stateNamesFor,
|
|
998
971
|
}
|