@codyswann/lisa 4.97.2 → 4.97.4
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/dist/core/nightly-e2e-guard-behavior-certificate.js +2 -2
- package/dist/core/upstream-evidence-manifest.d.ts.map +1 -1
- package/dist/core/upstream-evidence-manifest.js +28 -13
- package/dist/core/upstream-evidence-manifest.js.map +1 -1
- package/package.json +4 -4
- package/plugins/lisa/.claude-plugin/plugin.json +1 -1
- package/plugins/lisa/.codex-plugin/plugin.json +1 -1
- package/plugins/lisa/.codex-plugin/skills/lisa-secrets-access/scripts/validate-config.mjs +115 -6
- package/plugins/lisa/.codex-plugin/skills/lisa-session-manager/SKILL.md +28 -9
- package/plugins/lisa/.codex-plugin/skills/lisa-session-manager/references/runbook-template.md +4 -2
- package/plugins/lisa/.codex-plugin/skills/lisa-session-manager/scripts/cli-cycle.mjs +7 -2
- package/plugins/lisa/.codex-plugin/skills/lisa-session-manager/scripts/cli-manager.mjs +9 -2
- package/plugins/lisa/.codex-plugin/skills/lisa-session-manager/scripts/cli-runtime.mjs +9 -4
- package/plugins/lisa/.codex-plugin/skills/lisa-session-manager/scripts/cli-usage.mjs +11 -5
- package/plugins/lisa/.codex-plugin/skills/lisa-session-manager/scripts/config.mjs +2 -1
- package/plugins/lisa/.codex-plugin/skills/lisa-session-manager/scripts/human-answer.mjs +38 -9
- package/plugins/lisa/.codex-plugin/skills/lisa-setup-session-manager/SKILL.md +15 -2
- package/plugins/lisa/rules/reference/config-resolution.md +8 -5
- package/plugins/lisa/scripts/operator-id-kinds.mjs +120 -0
- package/plugins/lisa/scripts/ready-queue-order.mjs +89 -15
- package/plugins/lisa/skills/lisa-secrets-access/scripts/validate-config.mjs +115 -6
- package/plugins/lisa/skills/lisa-session-manager/SKILL.md +28 -9
- package/plugins/lisa/skills/lisa-session-manager/references/runbook-template.md +4 -2
- package/plugins/lisa/skills/lisa-session-manager/scripts/cli-cycle.mjs +7 -2
- package/plugins/lisa/skills/lisa-session-manager/scripts/cli-manager.mjs +9 -2
- package/plugins/lisa/skills/lisa-session-manager/scripts/cli-runtime.mjs +9 -4
- package/plugins/lisa/skills/lisa-session-manager/scripts/cli-usage.mjs +11 -5
- package/plugins/lisa/skills/lisa-session-manager/scripts/config.mjs +2 -1
- package/plugins/lisa/skills/lisa-session-manager/scripts/human-answer.mjs +38 -9
- package/plugins/lisa/skills/lisa-setup-session-manager/SKILL.md +15 -2
- package/plugins/lisa-agy/plugin.json +1 -1
- package/plugins/lisa-agy/scripts/operator-id-kinds.mjs +120 -0
- package/plugins/lisa-agy/scripts/ready-queue-order.mjs +89 -15
- package/plugins/lisa-agy/skills/lisa-secrets-access/scripts/validate-config.mjs +115 -6
- package/plugins/lisa-agy/skills/lisa-session-manager/SKILL.md +28 -9
- package/plugins/lisa-agy/skills/lisa-session-manager/references/runbook-template.md +4 -2
- package/plugins/lisa-agy/skills/lisa-session-manager/scripts/cli-cycle.mjs +7 -2
- package/plugins/lisa-agy/skills/lisa-session-manager/scripts/cli-manager.mjs +9 -2
- package/plugins/lisa-agy/skills/lisa-session-manager/scripts/cli-runtime.mjs +9 -4
- package/plugins/lisa-agy/skills/lisa-session-manager/scripts/cli-usage.mjs +11 -5
- package/plugins/lisa-agy/skills/lisa-session-manager/scripts/config.mjs +2 -1
- package/plugins/lisa-agy/skills/lisa-session-manager/scripts/human-answer.mjs +38 -9
- package/plugins/lisa-agy/skills/lisa-setup-session-manager/SKILL.md +15 -2
- package/plugins/lisa-cdk/.claude-plugin/plugin.json +1 -1
- package/plugins/lisa-cdk/.codex-plugin/plugin.json +1 -1
- package/plugins/lisa-cdk-agy/plugin.json +1 -1
- package/plugins/lisa-cdk-copilot/.claude-plugin/plugin.json +1 -1
- package/plugins/lisa-cdk-cursor/.claude-plugin/plugin.json +1 -1
- package/plugins/lisa-cdk-devin/.claude-plugin/plugin.json +1 -1
- package/plugins/lisa-cdk-devin/.devin-plugin/plugin.json +1 -1
- package/plugins/lisa-copilot/.claude-plugin/plugin.json +1 -1
- package/plugins/lisa-copilot/rules/reference/config-resolution.md +8 -5
- package/plugins/lisa-copilot/scripts/operator-id-kinds.mjs +120 -0
- package/plugins/lisa-copilot/scripts/ready-queue-order.mjs +89 -15
- package/plugins/lisa-copilot/skills/lisa-secrets-access/scripts/validate-config.mjs +115 -6
- package/plugins/lisa-copilot/skills/lisa-session-manager/SKILL.md +28 -9
- package/plugins/lisa-copilot/skills/lisa-session-manager/references/runbook-template.md +4 -2
- package/plugins/lisa-copilot/skills/lisa-session-manager/scripts/cli-cycle.mjs +7 -2
- package/plugins/lisa-copilot/skills/lisa-session-manager/scripts/cli-manager.mjs +9 -2
- package/plugins/lisa-copilot/skills/lisa-session-manager/scripts/cli-runtime.mjs +9 -4
- package/plugins/lisa-copilot/skills/lisa-session-manager/scripts/cli-usage.mjs +11 -5
- package/plugins/lisa-copilot/skills/lisa-session-manager/scripts/config.mjs +2 -1
- package/plugins/lisa-copilot/skills/lisa-session-manager/scripts/human-answer.mjs +38 -9
- package/plugins/lisa-copilot/skills/lisa-setup-session-manager/SKILL.md +15 -2
- package/plugins/lisa-cursor/.claude-plugin/plugin.json +1 -1
- package/plugins/lisa-cursor/rules/config-resolution-reference.mdc +8 -5
- package/plugins/lisa-cursor/scripts/operator-id-kinds.mjs +120 -0
- package/plugins/lisa-cursor/scripts/ready-queue-order.mjs +89 -15
- package/plugins/lisa-cursor/skills/lisa-secrets-access/scripts/validate-config.mjs +115 -6
- package/plugins/lisa-cursor/skills/lisa-session-manager/SKILL.md +28 -9
- package/plugins/lisa-cursor/skills/lisa-session-manager/references/runbook-template.md +4 -2
- package/plugins/lisa-cursor/skills/lisa-session-manager/scripts/cli-cycle.mjs +7 -2
- package/plugins/lisa-cursor/skills/lisa-session-manager/scripts/cli-manager.mjs +9 -2
- package/plugins/lisa-cursor/skills/lisa-session-manager/scripts/cli-runtime.mjs +9 -4
- package/plugins/lisa-cursor/skills/lisa-session-manager/scripts/cli-usage.mjs +11 -5
- package/plugins/lisa-cursor/skills/lisa-session-manager/scripts/config.mjs +2 -1
- package/plugins/lisa-cursor/skills/lisa-session-manager/scripts/human-answer.mjs +38 -9
- package/plugins/lisa-cursor/skills/lisa-setup-session-manager/SKILL.md +15 -2
- package/plugins/lisa-devin/.claude-plugin/plugin.json +1 -1
- package/plugins/lisa-devin/.devin-plugin/plugin.json +1 -1
- package/plugins/lisa-devin/rules/reference/config-resolution.md +8 -5
- package/plugins/lisa-devin/scripts/operator-id-kinds.mjs +120 -0
- package/plugins/lisa-devin/scripts/ready-queue-order.mjs +89 -15
- package/plugins/lisa-devin/skills/lisa-secrets-access/scripts/validate-config.mjs +115 -6
- package/plugins/lisa-devin/skills/lisa-session-manager/SKILL.md +28 -9
- package/plugins/lisa-devin/skills/lisa-session-manager/references/runbook-template.md +4 -2
- package/plugins/lisa-devin/skills/lisa-session-manager/scripts/cli-cycle.mjs +7 -2
- package/plugins/lisa-devin/skills/lisa-session-manager/scripts/cli-manager.mjs +9 -2
- package/plugins/lisa-devin/skills/lisa-session-manager/scripts/cli-runtime.mjs +9 -4
- package/plugins/lisa-devin/skills/lisa-session-manager/scripts/cli-usage.mjs +11 -5
- package/plugins/lisa-devin/skills/lisa-session-manager/scripts/config.mjs +2 -1
- package/plugins/lisa-devin/skills/lisa-session-manager/scripts/human-answer.mjs +38 -9
- package/plugins/lisa-devin/skills/lisa-setup-session-manager/SKILL.md +15 -2
- package/plugins/lisa-expo/.claude-plugin/plugin.json +1 -1
- package/plugins/lisa-expo/.codex-plugin/plugin.json +1 -1
- package/plugins/lisa-expo-agy/plugin.json +1 -1
- package/plugins/lisa-expo-copilot/.claude-plugin/plugin.json +1 -1
- package/plugins/lisa-expo-cursor/.claude-plugin/plugin.json +1 -1
- package/plugins/lisa-expo-devin/.claude-plugin/plugin.json +1 -1
- package/plugins/lisa-expo-devin/.devin-plugin/plugin.json +1 -1
- package/plugins/lisa-harper-fabric/.claude-plugin/plugin.json +1 -1
- package/plugins/lisa-harper-fabric/.codex-plugin/plugin.json +1 -1
- package/plugins/lisa-harper-fabric-agy/plugin.json +1 -1
- package/plugins/lisa-harper-fabric-copilot/.claude-plugin/plugin.json +1 -1
- package/plugins/lisa-harper-fabric-cursor/.claude-plugin/plugin.json +1 -1
- package/plugins/lisa-harper-fabric-devin/.claude-plugin/plugin.json +1 -1
- package/plugins/lisa-harper-fabric-devin/.devin-plugin/plugin.json +1 -1
- package/plugins/lisa-nestjs/.claude-plugin/plugin.json +1 -1
- package/plugins/lisa-nestjs/.codex-plugin/plugin.json +1 -1
- package/plugins/lisa-nestjs-agy/plugin.json +1 -1
- package/plugins/lisa-nestjs-copilot/.claude-plugin/plugin.json +1 -1
- package/plugins/lisa-nestjs-cursor/.claude-plugin/plugin.json +1 -1
- package/plugins/lisa-nestjs-devin/.claude-plugin/plugin.json +1 -1
- package/plugins/lisa-nestjs-devin/.devin-plugin/plugin.json +1 -1
- package/plugins/lisa-openclaw/.claude-plugin/plugin.json +1 -1
- package/plugins/lisa-openclaw/.codex-plugin/plugin.json +1 -1
- package/plugins/lisa-openclaw-agy/plugin.json +1 -1
- package/plugins/lisa-openclaw-copilot/.claude-plugin/plugin.json +1 -1
- package/plugins/lisa-openclaw-cursor/.claude-plugin/plugin.json +1 -1
- package/plugins/lisa-openclaw-devin/.claude-plugin/plugin.json +1 -1
- package/plugins/lisa-openclaw-devin/.devin-plugin/plugin.json +1 -1
- package/plugins/lisa-phaser/.claude-plugin/plugin.json +1 -1
- package/plugins/lisa-phaser/.codex-plugin/plugin.json +1 -1
- package/plugins/lisa-phaser-agy/plugin.json +1 -1
- package/plugins/lisa-phaser-copilot/.claude-plugin/plugin.json +1 -1
- package/plugins/lisa-phaser-cursor/.claude-plugin/plugin.json +1 -1
- package/plugins/lisa-phaser-devin/.claude-plugin/plugin.json +1 -1
- package/plugins/lisa-phaser-devin/.devin-plugin/plugin.json +1 -1
- package/plugins/lisa-rails/.claude-plugin/plugin.json +1 -1
- package/plugins/lisa-rails/.codex-plugin/plugin.json +1 -1
- package/plugins/lisa-rails-agy/plugin.json +1 -1
- package/plugins/lisa-rails-copilot/.claude-plugin/plugin.json +1 -1
- package/plugins/lisa-rails-cursor/.claude-plugin/plugin.json +1 -1
- package/plugins/lisa-rails-devin/.claude-plugin/plugin.json +1 -1
- package/plugins/lisa-rails-devin/.devin-plugin/plugin.json +1 -1
- package/plugins/lisa-typescript/.claude-plugin/plugin.json +1 -1
- package/plugins/lisa-typescript/.codex-plugin/plugin.json +1 -1
- package/plugins/lisa-typescript-agy/plugin.json +1 -1
- package/plugins/lisa-typescript-copilot/.claude-plugin/plugin.json +1 -1
- package/plugins/lisa-typescript-cursor/.claude-plugin/plugin.json +1 -1
- package/plugins/lisa-typescript-devin/.claude-plugin/plugin.json +1 -1
- package/plugins/lisa-typescript-devin/.devin-plugin/plugin.json +1 -1
- package/plugins/lisa-wiki/.claude-plugin/plugin.json +1 -1
- package/plugins/lisa-wiki/.codex-plugin/plugin.json +1 -1
- package/plugins/lisa-wiki-agy/plugin.json +1 -1
- package/plugins/lisa-wiki-copilot/.claude-plugin/plugin.json +1 -1
- package/plugins/lisa-wiki-cursor/.claude-plugin/plugin.json +1 -1
- package/plugins/lisa-wiki-devin/.claude-plugin/plugin.json +1 -1
- package/plugins/lisa-wiki-devin/.devin-plugin/plugin.json +1 -1
- package/plugins/src/base/rules/reference/config-resolution.md +8 -5
- package/plugins/src/base/scripts/operator-id-kinds.mjs +120 -0
- package/plugins/src/base/scripts/ready-queue-order.mjs +89 -15
- package/plugins/src/base/skills/lisa-secrets-access/scripts/validate-config.mjs +115 -6
- package/plugins/src/base/skills/lisa-session-manager/SKILL.md +28 -9
- package/plugins/src/base/skills/lisa-session-manager/references/runbook-template.md +4 -2
- package/plugins/src/base/skills/lisa-session-manager/scripts/cli-cycle.mjs +7 -2
- package/plugins/src/base/skills/lisa-session-manager/scripts/cli-manager.mjs +9 -2
- package/plugins/src/base/skills/lisa-session-manager/scripts/cli-runtime.mjs +9 -4
- package/plugins/src/base/skills/lisa-session-manager/scripts/cli-usage.mjs +11 -5
- package/plugins/src/base/skills/lisa-session-manager/scripts/config.mjs +2 -1
- package/plugins/src/base/skills/lisa-session-manager/scripts/human-answer.mjs +38 -9
- package/plugins/src/base/skills/lisa-setup-session-manager/SKILL.md +15 -2
- package/typescript/package-lisa/package.lisa.json +2 -2
|
@@ -785,12 +785,113 @@ function findCredentials(value, path, segments = []) {
|
|
|
785
785
|
);
|
|
786
786
|
}
|
|
787
787
|
|
|
788
|
+
/** A letters-only prefix at the start of an id entry. */
|
|
789
|
+
const ID_ENTRY_PREFIX = /^([A-Za-z]+):/;
|
|
790
|
+
|
|
791
|
+
/** The kinds an id entry's prefix may name. */
|
|
792
|
+
const ID_ENTRY_KINDS = new Set(["login", "id"]);
|
|
793
|
+
|
|
794
|
+
/** Letters-and-colon starts of real tracker ids (JSM customers' `qm:`). */
|
|
795
|
+
const PLAIN_ID_STARTS = new Set(["qm"]);
|
|
796
|
+
|
|
797
|
+
/** An all-digit plain entry: a login to the queue, an id to the answers. */
|
|
798
|
+
const ALL_DIGIT_ENTRY = /^\d+$/;
|
|
799
|
+
|
|
800
|
+
/**
|
|
801
|
+
* Classify one `operatorIds` / `trustedAuthorIds` entry (CodySwannGT/lisa#4623).
|
|
802
|
+
*
|
|
803
|
+
* A local copy of the grammar in `scripts/operator-id-kinds.mjs`, because
|
|
804
|
+
* plugin payload scripts ship standalone; `operator-id-kinds.test.ts` pins
|
|
805
|
+
* the two together. `login:<v>` is a GitHub login, `id:<v>` an account id,
|
|
806
|
+
* and an entry with no letters-only prefix is plain (a Jira accountId such as
|
|
807
|
+
* `557058:<uuid>` or `qm:<id>` included).
|
|
808
|
+
* @param {string} entry One entry.
|
|
809
|
+
* @returns {"login" | "id" | "plain" | "unknown-prefix" | "empty-value"} Kind.
|
|
810
|
+
*/
|
|
811
|
+
export function classifyIdEntry(entry) {
|
|
812
|
+
const prefix = ID_ENTRY_PREFIX.exec(entry)?.[1];
|
|
813
|
+
if (prefix === undefined || PLAIN_ID_STARTS.has(prefix)) return "plain";
|
|
814
|
+
if (!ID_ENTRY_KINDS.has(prefix)) return "unknown-prefix";
|
|
815
|
+
return entry.slice(prefix.length + 1).trim() === "" ? "empty-value" : prefix;
|
|
816
|
+
}
|
|
817
|
+
|
|
818
|
+
/**
|
|
819
|
+
* Refuse each malformed kind-keyed entry, naming it. A reader matches such an
|
|
820
|
+
* entry against nobody, so accepting it would silently drop a person.
|
|
821
|
+
* @param {string} key `operatorIds` or `trustedAuthorIds`.
|
|
822
|
+
* @param {readonly string[]} ids Entries, already known to be strings.
|
|
823
|
+
* @returns {string[]} Problems found.
|
|
824
|
+
*/
|
|
825
|
+
function idEntryProblems(key, ids) {
|
|
826
|
+
const prefixOf = entry => `${ID_ENTRY_PREFIX.exec(entry)[1]}:`;
|
|
827
|
+
return ids.flatMap(entry => {
|
|
828
|
+
const kind = classifyIdEntry(entry);
|
|
829
|
+
if (kind === "unknown-prefix") {
|
|
830
|
+
const prefix = prefixOf(entry);
|
|
831
|
+
return [
|
|
832
|
+
`sessionManager.${key} entry ${JSON.stringify(entry)} has an ` +
|
|
833
|
+
`unknown prefix ${JSON.stringify(prefix)}. Use login:<GitHub ` +
|
|
834
|
+
`login>, id:<numeric or tracker account id>, or a plain id; write ` +
|
|
835
|
+
`a tracker id that itself starts with letters and a colon as ` +
|
|
836
|
+
`id:<that id>.`,
|
|
837
|
+
];
|
|
838
|
+
}
|
|
839
|
+
return kind === "empty-value"
|
|
840
|
+
? [
|
|
841
|
+
`sessionManager.${key} entry ${JSON.stringify(entry)} has an ` +
|
|
842
|
+
`empty value after ${JSON.stringify(prefixOf(entry))}: name the ` +
|
|
843
|
+
`login or id after the prefix.`,
|
|
844
|
+
]
|
|
845
|
+
: [];
|
|
846
|
+
});
|
|
847
|
+
}
|
|
848
|
+
|
|
849
|
+
/**
|
|
850
|
+
* Warnings for a `sessionManager` block: things that work today but are
|
|
851
|
+
* ambiguous, never problems. They are printed, never fatal.
|
|
852
|
+
*
|
|
853
|
+
* A plain all-digit `operatorIds` entry is read two ways (CodySwannGT/lisa#4623):
|
|
854
|
+
* the answer matcher takes it as a numeric account id (an all-digit login can
|
|
855
|
+
* be registered by anyone, #4571) while the queue and the claim take it as
|
|
856
|
+
* the GitHub assignee login. A `trustedAuthorIds` entry is an id to every
|
|
857
|
+
* reader, so digits there are not ambiguous and draw no warning.
|
|
858
|
+
* @param {unknown} block The merged block, if present.
|
|
859
|
+
* @returns {string[]} Warnings.
|
|
860
|
+
*/
|
|
861
|
+
export function sessionManagerWarnings(block) {
|
|
862
|
+
if (!isPlainObject(block) || !Array.isArray(block.operatorIds)) return [];
|
|
863
|
+
// Tested trimmed: the queue trims a plain entry before comparing it.
|
|
864
|
+
return block.operatorIds
|
|
865
|
+
.filter(entry => typeof entry === "string")
|
|
866
|
+
.map(entry => ({ entry, value: entry.trim() }))
|
|
867
|
+
.filter(({ value }) => ALL_DIGIT_ENTRY.test(value))
|
|
868
|
+
.map(({ entry, value }) => {
|
|
869
|
+
// The answer matcher compares a plain entry untrimmed (#4623): padded,
|
|
870
|
+
// it equals no author field, so it never admits anyone.
|
|
871
|
+
const answerReading =
|
|
872
|
+
entry === value
|
|
873
|
+
? `the answer matcher reads it as a numeric account id (only a ` +
|
|
874
|
+
`comment whose author's numeric id is ${value} counts as an answer)`
|
|
875
|
+
: `the answer matcher does not trim it, so it matches no comment ` +
|
|
876
|
+
`author`;
|
|
877
|
+
return (
|
|
878
|
+
`sessionManager.operatorIds entry ${JSON.stringify(entry)} is all ` +
|
|
879
|
+
`digits, so it is read two ways: ${answerReading}, while the queue ` +
|
|
880
|
+
`and the claim read it as a GitHub login. Write ` +
|
|
881
|
+
`${JSON.stringify(`login:${value}`)} if ${value} is the GitHub ` +
|
|
882
|
+
`login, or ${JSON.stringify(`id:${value}`)} if it is the numeric ` +
|
|
883
|
+
`account id.`
|
|
884
|
+
);
|
|
885
|
+
});
|
|
886
|
+
}
|
|
887
|
+
|
|
788
888
|
/**
|
|
789
889
|
* Validate `sessionManager.operatorIds`: the people the manager works for,
|
|
790
|
-
* whose assigned items it dispatches first.
|
|
791
|
-
* way "me" is, so
|
|
792
|
-
* `trustedAuthorIds` takes
|
|
793
|
-
* one, so it is
|
|
890
|
+
* whose assigned items it dispatches first. A plain entry is matched against
|
|
891
|
+
* the assignee the way "me" is, so a plain GitHub entry is a login, not the
|
|
892
|
+
* numeric id `trustedAuthorIds` takes; `login:` and `id:` entries name their
|
|
893
|
+
* kind outright. An empty list reads as configured but names no one, so it is
|
|
894
|
+
* refused like an empty `trustedAuthorIds`.
|
|
794
895
|
* @param {unknown} ids The value, if present.
|
|
795
896
|
* @returns {string[]} Problems found.
|
|
796
897
|
*/
|
|
@@ -803,7 +904,8 @@ function validateOperatorIds(ids) {
|
|
|
803
904
|
return [
|
|
804
905
|
`sessionManager.operatorIds must be an array of tracker user ids as ` +
|
|
805
906
|
`strings, matched against the assignee: the GitHub login, the Jira ` +
|
|
806
|
-
`accountId or the Linear user id
|
|
907
|
+
`accountId or the Linear user id (login:<v> or id:<v> to name the ` +
|
|
908
|
+
`kind).`,
|
|
807
909
|
];
|
|
808
910
|
}
|
|
809
911
|
return ids.length === 0
|
|
@@ -811,7 +913,7 @@ function validateOperatorIds(ids) {
|
|
|
811
913
|
`sessionManager.operatorIds must name at least one person. Remove ` +
|
|
812
914
|
`the key instead if the manager works only for its own identity.`,
|
|
813
915
|
]
|
|
814
|
-
:
|
|
916
|
+
: idEntryProblems("operatorIds", ids);
|
|
815
917
|
}
|
|
816
918
|
|
|
817
919
|
/**
|
|
@@ -862,6 +964,9 @@ export function validateSessionManager(block) {
|
|
|
862
964
|
`tracker user ids (GitHub numeric user id, Jira accountId, ` +
|
|
863
965
|
`Linear user id), not logins or display names.`,
|
|
864
966
|
]),
|
|
967
|
+
...(trustedOk && Array.isArray(block.trustedAuthorIds)
|
|
968
|
+
? idEntryProblems("trustedAuthorIds", block.trustedAuthorIds)
|
|
969
|
+
: []),
|
|
865
970
|
// An empty list reads as "set" but filters no author at all, so on a
|
|
866
971
|
// public repo it would dispatch anyone's item while looking configured.
|
|
867
972
|
...(trustedOk &&
|
|
@@ -996,6 +1101,10 @@ function main() {
|
|
|
996
1101
|
return;
|
|
997
1102
|
}
|
|
998
1103
|
const problems = validateConfig(cfg);
|
|
1104
|
+
// Warnings never fail the run: the config works, it is only ambiguous.
|
|
1105
|
+
for (const warning of sessionManagerWarnings(cfg.sessionManager)) {
|
|
1106
|
+
console.error(` warning: ${warning}`);
|
|
1107
|
+
}
|
|
999
1108
|
if (!problems.length) {
|
|
1000
1109
|
console.log(
|
|
1001
1110
|
"config: secrets, remoteEnv, automations and sessionManager blocks are well-formed"
|
|
@@ -72,7 +72,15 @@ the manager.
|
|
|
72
72
|
- **Operators.** `sessionManager.operatorIds` names the people the manager works for (the same
|
|
73
73
|
kind of id as "me": GitHub login, Jira accountId, Linear user id). Their assigned items come
|
|
74
74
|
first, then items assigned to "me", then unassigned. Items assigned to anyone else are never
|
|
75
|
-
dispatched. Never treat an operator's item as someone else's.
|
|
75
|
+
dispatched. Never treat an operator's item as someone else's. An entry may name its kind:
|
|
76
|
+
`login:<v>` is a GitHub login and `id:<v>` an account id (GitHub numeric id, Jira accountId,
|
|
77
|
+
Linear user id). Whether an assignee **is an operator**: compare a GitHub assignee's `login`
|
|
78
|
+
with each `login:` entry's value, the assignee's account id (GitHub numeric `id` from the REST
|
|
79
|
+
issue's `.assignees[].id`, Jira `accountId`, Linear `id`) with each `id:` entry's value, and
|
|
80
|
+
the assignee as "me" is compared (GitHub login, Jira accountId, Linear user id) with each plain
|
|
81
|
+
entry, exactly as before. A plain all-digit entry is a login here but a numeric id to
|
|
82
|
+
`item-answer`, so `validate` warns about it; write `login:<v>` or `id:<v>` instead. The `queue`
|
|
83
|
+
output echoes the entries as `operators`.
|
|
76
84
|
- **Workers** start only through `spawn`. The worker prompt is exactly
|
|
77
85
|
`/lisa:implement <REF> managedBy=<manager-name>`; `lisa-implement` owns what `managedBy=` means.
|
|
78
86
|
Never start a worker another way, and never reuse a worker for another item or a new attempt.
|
|
@@ -111,7 +119,10 @@ the manager.
|
|
|
111
119
|
enforces it. It does not vet the comments, later body edits or attachments on a dispatched item:
|
|
112
120
|
a worker under `managedBy=` treats text from anyone other than the item's author or a trusted
|
|
113
121
|
author as untrusted data (`lisa-implement`). The same list is the only source of who may release
|
|
114
|
-
a human hold in `blocked-plan`. Without it, any author's Ready item is dispatched.
|
|
122
|
+
a human hold in `blocked-plan`. Without it, any author's Ready item is dispatched. A plain
|
|
123
|
+
entry is the author's stable id (GitHub numeric user id, Jira accountId, Linear user id);
|
|
124
|
+
`id:<v>` says so outright, and `login:<v>` names a GitHub login, which the queue and
|
|
125
|
+
`item-answer` match but `blocked-plan` (ids only) never does.
|
|
115
126
|
|
|
116
127
|
## Questions and notifications
|
|
117
128
|
|
|
@@ -319,9 +330,11 @@ shows them.
|
|
|
319
330
|
- Otherwise read the item's comments, in order, with each author's **stable id** (answerers are
|
|
320
331
|
matched on stable ids only, never a name, display name or email, which anyone can set): GitHub
|
|
321
332
|
`gh api --paginate repos/<owner>/<repo>/issues/<n>/comments` (each row carries `user.login` and
|
|
322
|
-
the numeric `user.id`, so a numeric `trustedAuthorIds` entry matches too;
|
|
323
|
-
always read as a numeric id and never matched against a login, because anyone can pick
|
|
324
|
-
all-digit login
|
|
333
|
+
the numeric `user.id`, so a numeric `trustedAuthorIds` entry matches too; a plain all-digit
|
|
334
|
+
entry is always read as a numeric id and never matched against a login, because anyone can pick
|
|
335
|
+
an all-digit login; a `login:<v>` entry matches only `user.login` and an `id:<v>` entry only the
|
|
336
|
+
numeric `user.id`, so an operator whose login is all digits writes `login:<login>`); Jira the
|
|
337
|
+
comment
|
|
325
338
|
`author.accountId` through `lisa-atlassian-access`; Linear the comment `user.id` through
|
|
326
339
|
`lisa-linear-access`. Pipe `{"comments":[{"id":…,"user":…|"author":…,"body":…,"createdAt":…}]}`
|
|
327
340
|
(keep each comment's own `id`) to `item-answer <ref>`. It queues the first reply after the
|
|
@@ -456,8 +469,13 @@ Skip while `capacity` reports `paused`. Otherwise:
|
|
|
456
469
|
`cd "$(node "$SM/session-manager.mjs" repo-dir --repo <key> --raw --project-root "$ROOT")"`
|
|
457
470
|
(omit `--repo` on a single-repo project), invoke `lisa-tracker-claim <ref>`, then
|
|
458
471
|
`cd "$ROOT" && pwd` and confirm the path. Continue only on `claimed` or `reused` with the
|
|
459
|
-
assignee equal to "me" or to one of `sessionManager.operatorIds` (
|
|
460
|
-
|
|
472
|
+
assignee equal to "me" or to one of `sessionManager.operatorIds` (compared as "Operators"
|
|
473
|
+
says: a GitHub assignee's login with `login:` entries; the assignee's account id with `id:`
|
|
474
|
+
entries, which on GitHub is the assignee's numeric id from the REST issue's
|
|
475
|
+
`.assignees[].id` (not the `id` of a GraphQL-backed `--json assignees` read, which is a node
|
|
476
|
+
id), on Jira the accountId and on Linear the user id; plain entries as "me" is compared; the
|
|
477
|
+
claim assigns only an unassigned item, so an operator's item keeps the operator); anything
|
|
478
|
+
else means skip. Then
|
|
461
479
|
re-read the item with `lisa-tracker-read`: if the re-read shows an assignee that is neither
|
|
462
480
|
"me" nor an operator, or shows the state did not change to the `claimed` role, skip it
|
|
463
481
|
(someone else holds it, or the claim did not land).
|
|
@@ -489,8 +507,9 @@ Skip while `capacity` reports `paused`. Otherwise:
|
|
|
489
507
|
grooming is not the operator's inbox.
|
|
490
508
|
3. **Route the repo** as in step 2.2, but never ask: an ambiguous or multi-repo backlog item is
|
|
491
509
|
skipped.
|
|
492
|
-
4. **Promote** in ONE `lisa-tracker-write` update: assignee = the first `operatorIds` entry
|
|
493
|
-
|
|
510
|
+
4. **Promote** in ONE `lisa-tracker-write` update: assignee = the first `operatorIds` entry
|
|
511
|
+
with any `login:` / `id:` prefix removed (the bare login or id; a GitHub assignee is set by
|
|
512
|
+
login, so on GitHub use a `login:` or plain first entry), move to the `ready` role, comment
|
|
494
513
|
`[lisa-session-manager] Promoted from backlog: validation passed; assigned to the operator.`
|
|
495
514
|
Read it back with `lisa-tracker-read` and continue only when the role is `ready` and the
|
|
496
515
|
assignee is that operator. Then `ledger validation-cleared <ref>`.
|
|
@@ -19,7 +19,8 @@ project's own Telegram chat. Telegram is optional: with no channel, questions wa
|
|
|
19
19
|
|
|
20
20
|
## Candidate selection
|
|
21
21
|
|
|
22
|
-
Leaf items in the `ready` role, ordered: assigned to an operator (`sessionManager.operatorIds
|
|
22
|
+
Leaf items in the `ready` role, ordered: assigned to an operator (`sessionManager.operatorIds`; a
|
|
23
|
+
`login:` entry matches a GitHub assignee login, an `id:` entry an assignee account id),
|
|
23
24
|
then to the manager's own tracker identity, then unassigned; within each, by priority, then oldest.
|
|
24
25
|
Items assigned to someone else, containers, human-held items, items waiting on a human's answer
|
|
25
26
|
in the ledger and (when configured) items by untrusted authors are skipped. As many as the machine has capacity for.
|
|
@@ -57,7 +58,8 @@ pending in the ledger, and keeps dispatching other items: one item waiting on a
|
|
|
57
58
|
the queue. An item that failed `stall.maxAttempts` times also moves to the `blocked` role. With
|
|
58
59
|
Telegram the question goes there too; `/lisa:session-manager status` lists every pending question.
|
|
59
60
|
The operator answers with the CLI `answer` command that `status` lists, on Telegram, or on the
|
|
60
|
-
item (a reply from an operator or trusted author, matched on stable tracker ids
|
|
61
|
+
item (a reply from an operator or trusted author, matched on stable tracker ids, each
|
|
62
|
+
`login:` / `id:` entry by its own kind; with neither
|
|
61
63
|
`operatorIds` nor `trustedAuthorIds` set, replies on the item are not read); the next cycle
|
|
62
64
|
delivers the answer, removes the marker and clears the question. No question is ever asked in the
|
|
63
65
|
manager's terminal. When the manager itself cannot proceed it records `recovery-required` with a one-line
|
|
@@ -11,6 +11,7 @@ import {
|
|
|
11
11
|
AUTOMATION_RUN_OUTCOMES,
|
|
12
12
|
recordAutomationRun,
|
|
13
13
|
} from "../../../scripts/automation-run-record.mjs";
|
|
14
|
+
import { idComparableValues } from "../../../scripts/operator-id-kinds.mjs";
|
|
14
15
|
import {
|
|
15
16
|
CliError,
|
|
16
17
|
EXIT,
|
|
@@ -227,7 +228,9 @@ export async function route(ctx) {
|
|
|
227
228
|
* Who may release a human hold comes from `sessionManager.trustedAuthorIds`
|
|
228
229
|
* only. Any `trustedHumanActorIds` in the input is discarded: the input is
|
|
229
230
|
* assembled from the item's own (untrusted) body and comments, so a list
|
|
230
|
-
* carried beside them would let the item's text vouch for itself.
|
|
231
|
+
* carried beside them would let the item's text vouch for itself. The
|
|
232
|
+
* release check compares account ids only, so an `id:` entry reaches it as
|
|
233
|
+
* its bare value and a `login:` entry not at all (#4623).
|
|
231
234
|
* @param {object} ctx - CLI context
|
|
232
235
|
* @returns {Promise<{ json: object }>} `{action,reason,edges,gate}`
|
|
233
236
|
*/
|
|
@@ -240,7 +243,9 @@ export async function blockedPlan(ctx) {
|
|
|
240
243
|
input.pendingQuestion ??
|
|
241
244
|
(ref ? (await readLedger(ctx.root)).items[ref]?.pendingQuestion : null);
|
|
242
245
|
const project = loadProject(ctx.root);
|
|
243
|
-
const trustedHumanActorIds =
|
|
246
|
+
const trustedHumanActorIds = idComparableValues(
|
|
247
|
+
project.config?.trustedAuthorIds
|
|
248
|
+
);
|
|
244
249
|
return {
|
|
245
250
|
json: planBlockedRelease({
|
|
246
251
|
...input,
|
|
@@ -222,16 +222,23 @@ function environmentProblems(ctx, config) {
|
|
|
222
222
|
|
|
223
223
|
/**
|
|
224
224
|
* `validate`: every problem with the block, exit 2 when there is any.
|
|
225
|
+
* Warnings (a config that works but is ambiguous, #4623) are reported in
|
|
226
|
+
* `warnings`, only when there are any, and never fail the command.
|
|
225
227
|
* @param {object} ctx - CLI context
|
|
226
|
-
* @returns {{ json: object, exitCode: number }} `{valid,errors}`
|
|
228
|
+
* @returns {{ json: object, exitCode: number }} `{valid,errors[,warnings]}`
|
|
227
229
|
*/
|
|
228
230
|
export function validate(ctx) {
|
|
229
231
|
const project = loadProject(ctx.root);
|
|
230
232
|
const errors = project.config
|
|
231
233
|
? [...project.errors, ...environmentProblems(ctx, project.config)]
|
|
232
234
|
: [`No sessionManager block in ${GLOBAL_CONFIG_FILE}.`];
|
|
235
|
+
const warnings = project.warnings ?? [];
|
|
233
236
|
return {
|
|
234
|
-
json: {
|
|
237
|
+
json: {
|
|
238
|
+
valid: errors.length === 0,
|
|
239
|
+
errors,
|
|
240
|
+
...(warnings.length > 0 ? { warnings } : {}),
|
|
241
|
+
},
|
|
235
242
|
exitCode: errors.length === 0 ? EXIT.OK : EXIT.SETUP,
|
|
236
243
|
};
|
|
237
244
|
}
|
|
@@ -16,6 +16,7 @@ import path from "node:path";
|
|
|
16
16
|
|
|
17
17
|
import {
|
|
18
18
|
resolveSessionManagerConfig,
|
|
19
|
+
sessionManagerWarnings,
|
|
19
20
|
validateSessionManager,
|
|
20
21
|
} from "./config.mjs";
|
|
21
22
|
import {
|
|
@@ -134,15 +135,19 @@ function validationView(config) {
|
|
|
134
135
|
* Read both config files and resolve the `sessionManager` block.
|
|
135
136
|
* @param {string} root - Absolute project root
|
|
136
137
|
* @returns {{ global: object | undefined, local: object | undefined,
|
|
137
|
-
* config: object | null, errors: string[] }} Raw
|
|
138
|
-
* (null when absent)
|
|
138
|
+
* config: object | null, errors: string[], warnings: string[] }} Raw
|
|
139
|
+
* files, resolved block (null when absent), validation errors, and
|
|
140
|
+
* warnings that never block a command (such as a plain all-digit
|
|
141
|
+
* operator entry, #4623)
|
|
139
142
|
*/
|
|
140
143
|
export function loadProject(root) {
|
|
141
144
|
const global = readConfigFile(path.join(root, GLOBAL_CONFIG_FILE));
|
|
142
145
|
const local = readConfigFile(path.join(root, LOCAL_CONFIG_FILE));
|
|
143
146
|
const config = resolveSessionManagerConfig(global, local);
|
|
144
|
-
const
|
|
145
|
-
|
|
147
|
+
const view = config ? validationView(config) : null;
|
|
148
|
+
const errors = view ? validateSessionManager(view) : [];
|
|
149
|
+
const warnings = view ? sessionManagerWarnings(view) : [];
|
|
150
|
+
return { global, local, config, errors, warnings };
|
|
146
151
|
}
|
|
147
152
|
|
|
148
153
|
/**
|
|
@@ -116,7 +116,9 @@ Config and routing
|
|
|
116
116
|
repo-dir [--repo <key>] [--raw]
|
|
117
117
|
stdout {repo,dir}; --raw prints the bare dir. Exit 2 for an
|
|
118
118
|
unknown key or a dir without .lisa.config.json.
|
|
119
|
-
validate stdout {valid,errors}; exit 2 when invalid or absent.
|
|
119
|
+
validate stdout {valid,errors[,warnings]}; exit 2 when invalid or absent.
|
|
120
|
+
warnings (only when any, never fatal) names an ambiguous entry,
|
|
121
|
+
such as a plain all-digit operatorIds entry.
|
|
120
122
|
init-config [--slug <slug>] [--notify none|telegram] [--write]
|
|
121
123
|
stdout {written,block[,reason:"exists",layer][,path]}. --notify picks
|
|
122
124
|
the notification channel (default none): none writes
|
|
@@ -159,7 +161,9 @@ Per cycle
|
|
|
159
161
|
reason}]}. An item with a pending question in the ledger is excluded
|
|
160
162
|
(pending-question) from both tiers, and every other item still comes
|
|
161
163
|
back, so one item waiting on a human never stops dispatch. ordered: items assigned to sessionManager.operatorIds
|
|
162
|
-
first
|
|
164
|
+
first (a login: entry matches a GitHub assignee login, an id: entry
|
|
165
|
+
an assignee account id, a plain entry as --me does), then to --me,
|
|
166
|
+
then unassigned; each group by priority, then age.
|
|
163
167
|
Items assigned to anyone else are excluded (assigned-to-other).
|
|
164
168
|
--me defaults to the ledger's control.me.
|
|
165
169
|
With sessionManager.backlogPickup true, also prints backlogTotal,
|
|
@@ -204,7 +208,8 @@ Per cycle
|
|
|
204
208
|
blocked-plan [--input <file>] [--ref <ref>] STDIN (without --input): JSON
|
|
205
209
|
{labels,body,comments,humanNeededLabel?,edges,pendingQuestion?}.
|
|
206
210
|
Trusted hold releasers are sessionManager.trustedAuthorIds (none when
|
|
207
|
-
unset
|
|
211
|
+
unset; plain and id: entries, compared as ids; login: entries never
|
|
212
|
+
release); trustedHumanActorIds in the input is ignored. stdout
|
|
208
213
|
{action:release|keep|escalate|skip-human-gate,reason,edges,gate}.
|
|
209
214
|
--ref fills pendingQuestion from the ledger.
|
|
210
215
|
mark-plan <ref> --kind <kind> [--cause <cause>] [--item-label <l>]...
|
|
@@ -254,8 +259,9 @@ Per cycle
|
|
|
254
259
|
Queues the human's answer from the item's comments (source "item"):
|
|
255
260
|
the first comment after the latest [lisa-session-manager-question]
|
|
256
261
|
comment whose author's STABLE id (GitHub login or numeric id, Jira
|
|
257
|
-
accountId, Linear user id; never a name, displayName or email;
|
|
258
|
-
all-digit entry is a numeric id, never matched against a login
|
|
262
|
+
accountId, Linear user id; never a name, displayName or email; a
|
|
263
|
+
plain all-digit entry is a numeric id, never matched against a login;
|
|
264
|
+
login:<v> matches only a login, id:<v> only an id) is in
|
|
259
265
|
sessionManager.operatorIds or trustedAuthorIds, and that is not a
|
|
260
266
|
machine comment, checked first (body starting with a bracketed tag
|
|
261
267
|
such as [lisa-...] or [claude-sync]; [lisa- or <!-- lisa: anywhere;
|
|
@@ -21,10 +21,11 @@ import { isAbsolute, resolve, sep } from "node:path";
|
|
|
21
21
|
import {
|
|
22
22
|
mergeConfigLayers as mergeLayers,
|
|
23
23
|
parseLoopInterval,
|
|
24
|
+
sessionManagerWarnings,
|
|
24
25
|
validateSessionManager,
|
|
25
26
|
} from "../../lisa-secrets-access/scripts/validate-config.mjs";
|
|
26
27
|
|
|
27
|
-
export { parseLoopInterval, validateSessionManager };
|
|
28
|
+
export { parseLoopInterval, sessionManagerWarnings, validateSessionManager };
|
|
28
29
|
export { detectRepoLayout, detectRepos, draftHints } from "./repo-detect.mjs";
|
|
29
30
|
|
|
30
31
|
/**
|
|
@@ -18,8 +18,11 @@
|
|
|
18
18
|
* login or numeric id, a Jira accountId, a Linear user id, never a display
|
|
19
19
|
* name or email, which anyone can set. An all-digit allowed entry is a
|
|
20
20
|
* numeric id and matches only the `id` or `accountId` field, never a login,
|
|
21
|
-
* which its owner chooses and may make all digits (#4571).
|
|
22
|
-
*
|
|
21
|
+
* which its owner chooses and may make all digits (#4571). A kind-keyed
|
|
22
|
+
* entry names one identity for this matcher, the queue and the claim alike
|
|
23
|
+
* (#4623): `login:<v>` matches only a `login`, `id:<v>` only an `id` or
|
|
24
|
+
* `accountId`, and an entry with an unknown prefix or an empty value matches
|
|
25
|
+
* nobody. The text is carried as data.
|
|
23
26
|
*
|
|
24
27
|
* The question the answer must follow is the comment whose id the manager
|
|
25
28
|
* recorded last; with no recorded id, the latest comment that STARTS with
|
|
@@ -28,6 +31,7 @@
|
|
|
28
31
|
* answer by posting the marker after it.
|
|
29
32
|
* @module session-manager/human-answer
|
|
30
33
|
*/
|
|
34
|
+
import { parseIdEntries } from "../../../scripts/operator-id-kinds.mjs";
|
|
31
35
|
import { QUESTION_MARKER } from "./human-needed.mjs";
|
|
32
36
|
|
|
33
37
|
/** Body markers that make a comment a machine's, never a human's answer. */
|
|
@@ -46,6 +50,9 @@ const QUOTE_LINE = /^\s*>/;
|
|
|
46
50
|
/** The comment fields that carry its tracker id. */
|
|
47
51
|
const COMMENT_ID_KEYS = ["id", "node_id"];
|
|
48
52
|
|
|
53
|
+
/** The author field a `login:` entry matches. */
|
|
54
|
+
const LOGIN_KEYS = ["login"];
|
|
55
|
+
|
|
49
56
|
/** The author fields that are stable ids, never settable display text. */
|
|
50
57
|
const STABLE_ID_KEYS = ["login", "id", "accountId"];
|
|
51
58
|
|
|
@@ -60,6 +67,28 @@ const NUMERIC_ID_KEYS = ["id", "accountId"];
|
|
|
60
67
|
/** An allowed entry that is a numeric account id, never a login. */
|
|
61
68
|
const ALL_DIGITS = /^\d+$/;
|
|
62
69
|
|
|
70
|
+
/**
|
|
71
|
+
* The allowed values, split by the author fields each may match. A plain
|
|
72
|
+
* entry keeps its #4571 meaning (all digits: an id only; otherwise a login
|
|
73
|
+
* or an id); a kind-keyed entry matches its own kind only.
|
|
74
|
+
* @param {readonly unknown[]} allowed - Answerer entries
|
|
75
|
+
* @returns {{ ids: Set<string>, logins: Set<string>, named: Set<string> }}
|
|
76
|
+
* Values matched against id fields, login fields, and any stable field
|
|
77
|
+
*/
|
|
78
|
+
function answererSets(allowed) {
|
|
79
|
+
const entries = parseIdEntries(allowed);
|
|
80
|
+
const plain = entries.filter(entry => entry.kind === "plain");
|
|
81
|
+
const valuesOf = list => new Set(list.map(entry => entry.value));
|
|
82
|
+
return {
|
|
83
|
+
ids: valuesOf([
|
|
84
|
+
...plain.filter(entry => ALL_DIGITS.test(entry.value)),
|
|
85
|
+
...entries.filter(entry => entry.kind === "id"),
|
|
86
|
+
]),
|
|
87
|
+
logins: valuesOf(entries.filter(entry => entry.kind === "login")),
|
|
88
|
+
named: valuesOf(plain.filter(entry => !ALL_DIGITS.test(entry.value))),
|
|
89
|
+
};
|
|
90
|
+
}
|
|
91
|
+
|
|
63
92
|
/**
|
|
64
93
|
* The string or number values of `keys` on `value`, as strings.
|
|
65
94
|
* @param {unknown} value - Object to read
|
|
@@ -148,11 +177,12 @@ function questionIndex(rows, managerCommentIds, authorOf) {
|
|
|
148
177
|
* reported in `refused`, never returned: returning it made every later cycle
|
|
149
178
|
* pick the same reply and fail on it again, so a corrected reply posted after
|
|
150
179
|
* it was never read (CodySwannGT/lisa#4571).
|
|
151
|
-
* @param {{comments: unknown, allowed: readonly string[],
|
|
180
|
+
* @param {{comments: unknown, allowed: readonly (string|number)[],
|
|
152
181
|
* managerCommentIds?: readonly (string|number)[],
|
|
153
182
|
* refuses?: (text: string) => string | null | undefined}} input - The
|
|
154
|
-
* item's comments, the answerer
|
|
155
|
-
* reply's text may not be queued (null
|
|
183
|
+
* item's comments, the answerer entries (plain, `login:` or `id:`), the
|
|
184
|
+
* ids the manager posted, and why a reply's text may not be queued (null
|
|
185
|
+
* when it may)
|
|
156
186
|
* @returns {{answer: {text: string, author: string, at: string|null} | null,
|
|
157
187
|
* reason: string, refused?: {id: string|null, author: string, why: string}[]}}
|
|
158
188
|
* The answer, or null with why there is none, and (only when any were)
|
|
@@ -168,13 +198,12 @@ export function pickItemAnswer({
|
|
|
168
198
|
throw new Error('stdin must be JSON {"comments":[...]}');
|
|
169
199
|
}
|
|
170
200
|
const rows = comments.filter(row => row && typeof row === "object");
|
|
171
|
-
const
|
|
172
|
-
const numeric = new Set(allow.filter(id => ALL_DIGITS.test(id)));
|
|
173
|
-
const named = new Set(allow.filter(id => !ALL_DIGITS.test(id)));
|
|
201
|
+
const { ids, logins, named } = answererSets(allowed);
|
|
174
202
|
const authorOf = row => {
|
|
175
203
|
const author = row.author ?? row.user;
|
|
176
204
|
return (
|
|
177
|
-
idsOf(author, NUMERIC_ID_KEYS).find(id =>
|
|
205
|
+
idsOf(author, NUMERIC_ID_KEYS).find(id => ids.has(id)) ??
|
|
206
|
+
idsOf(author, LOGIN_KEYS).find(login => logins.has(login)) ??
|
|
178
207
|
idsOf(author, STABLE_ID_KEYS).find(id => named.has(id))
|
|
179
208
|
);
|
|
180
209
|
};
|
|
@@ -68,7 +68,10 @@ writes `$SM`, and pass `--project-root "$ROOT"` (the absolute project root) on e
|
|
|
68
68
|
set `sessionManager.trustedAuthorIds`. Without it, any author's Ready item reaches a
|
|
69
69
|
bypass-permissions worker; say so plainly. The list holds stable tracker user ids as strings,
|
|
70
70
|
never logins: the GitHub numeric user id (`gh api users/<login> --jq .id`), the Jira
|
|
71
|
-
`accountId`, or the Linear user id. A login matches no one
|
|
71
|
+
`accountId`, or the Linear user id. A plain login matches no one in the queue and silently
|
|
72
|
+
excludes every item; to trust a GitHub login on purpose write it as `login:<login>`, and to say
|
|
73
|
+
outright that an entry is an id write `id:<id>`. A login GitHub frees (after a rename or a
|
|
74
|
+
deleted account) can be re-registered by someone else, so prefer `id:` for trust.
|
|
72
75
|
4. Set `sessionManager.operatorIds` to a non-empty **array** holding the operator's own tracker
|
|
73
76
|
user id, e.g. `"operatorIds": ["<operator-id>"]` (a bare string fails `validate`). Look up the
|
|
74
77
|
OPERATOR, not the credential: `gh api user` / `viewer.id` return whoever the tracker credential
|
|
@@ -81,6 +84,13 @@ writes `$SM`, and pass `--project-root "$ROOT"` (the absolute project root) on e
|
|
|
81
84
|
"me", spelled as the tracker API returns it: the GitHub **login** (`gh api users/<login> --jq
|
|
82
85
|
.login`), the Jira `accountId`, or the Linear user id (the operator's entry in the team's member
|
|
83
86
|
list, or `viewer.id` only when the operator runs the lookup with their own credential).
|
|
87
|
+
**Prefer the kind-keyed form**, which every reader (the queue, the claim and answers on the
|
|
88
|
+
item) matches the same way: `"login:<github-login>"` on GitHub, `"id:<accountId or user id>"` on
|
|
89
|
+
Jira and Linear. A plain entry still works as before, but a plain **all-digit** GitHub login is
|
|
90
|
+
read as a login by the queue and as a numeric id by the answer matcher, so the operator could
|
|
91
|
+
not answer on the item and the unrelated account whose numeric id equals it could; `validate`
|
|
92
|
+
warns about it (in `warnings`, never failing) and names both forms. An unknown prefix
|
|
93
|
+
(`user:octocat`) or an empty value (`login:`) fails `validate`, naming the entry.
|
|
84
94
|
**Recommend setting it in every setup**, even a single-user one: it is also who may answer a
|
|
85
95
|
human-needed question by replying on the item. With neither `operatorIds` nor
|
|
86
96
|
`trustedAuthorIds` set, the manager reads no answer off the item at all, because the tracker
|
|
@@ -91,10 +101,13 @@ writes `$SM`, and pass `--project-root "$ROOT"` (the absolute project root) on e
|
|
|
91
101
|
is exhausted and a worker slot is still free, the manager then looks at backlog items (open
|
|
92
102
|
leaves in no lifecycle role) that nobody else is assigned to, that are not human-held and have
|
|
93
103
|
no unfinished blocker. Each one that passes the full tracker validation, including the
|
|
94
|
-
stateless-pickup check, is assigned to the first `operatorIds` entry
|
|
104
|
+
stateless-pickup check, is assigned to the first `operatorIds` entry (its bare login or id,
|
|
105
|
+
without the `login:` / `id:` prefix), moved to Ready and
|
|
95
106
|
dispatched. Say plainly that this lets the manager start work nobody marked Ready, so it needs
|
|
96
107
|
`operatorIds` and should go with `trustedAuthorIds` on any tracker outsiders can write to.
|
|
97
108
|
6. `node "$SM/session-manager.mjs" validate --project-root "$ROOT"` must print `valid: true`.
|
|
109
|
+
Show the operator every entry of `warnings`, when there is one, in plain words, and offer to
|
|
110
|
+
rewrite a plain all-digit operator entry in the `login:` / `id:` form it names.
|
|
98
111
|
|
|
99
112
|
## Step 3: Store the bot token
|
|
100
113
|
|