@webpieces/pr-gate 0.4.564 → 0.4.566

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 (57) hide show
  1. package/bin/wp-finish-push-dev.js +27 -0
  2. package/bin/wp-push-dev.js +27 -0
  3. package/package.json +5 -3
  4. package/src/dashboard/checklist-comment-row.d.ts +42 -0
  5. package/src/dashboard/checklist-comment-row.js +59 -0
  6. package/src/dashboard/checklist-comment-row.js.map +1 -0
  7. package/src/dashboard/dashboard.d.ts +19 -29
  8. package/src/dashboard/dashboard.js +57 -53
  9. package/src/dashboard/dashboard.js.map +1 -1
  10. package/src/scripts/commands/finish-push-dev-command.d.ts +28 -0
  11. package/src/scripts/commands/finish-push-dev-command.js +62 -0
  12. package/src/scripts/commands/finish-push-dev-command.js.map +1 -0
  13. package/src/scripts/commands/finish-upsert-pr-command.d.ts +9 -0
  14. package/src/scripts/commands/finish-upsert-pr-command.js +24 -4
  15. package/src/scripts/commands/finish-upsert-pr-command.js.map +1 -1
  16. package/src/scripts/commands/push-dev-command.d.ts +89 -0
  17. package/src/scripts/commands/push-dev-command.js +249 -0
  18. package/src/scripts/commands/push-dev-command.js.map +1 -0
  19. package/src/scripts/commands/review-upsert-pr-command.d.ts +12 -1
  20. package/src/scripts/commands/review-upsert-pr-command.js +20 -4
  21. package/src/scripts/commands/review-upsert-pr-command.js.map +1 -1
  22. package/src/scripts/pr-gate-app.d.ts +24 -3
  23. package/src/scripts/pr-gate-app.js +48 -4
  24. package/src/scripts/pr-gate-app.js.map +1 -1
  25. package/src/scripts/workflow/checklist-detector.js +1 -1
  26. package/src/scripts/workflow/checklist-detector.js.map +1 -1
  27. package/src/scripts/workflow/checklist-scanner.d.ts +21 -1
  28. package/src/scripts/workflow/checklist-scanner.js +31 -3
  29. package/src/scripts/workflow/checklist-scanner.js.map +1 -1
  30. package/src/scripts/workflow/dev-deploy-refs.d.ts +66 -0
  31. package/src/scripts/workflow/dev-deploy-refs.js +143 -0
  32. package/src/scripts/workflow/dev-deploy-refs.js.map +1 -0
  33. package/src/scripts/workflow/dev-resolve-runner.d.ts +72 -0
  34. package/src/scripts/workflow/dev-resolve-runner.js +180 -0
  35. package/src/scripts/workflow/dev-resolve-runner.js.map +1 -0
  36. package/src/scripts/workflow/git-exec.d.ts +20 -1
  37. package/src/scripts/workflow/git-exec.js +30 -3
  38. package/src/scripts/workflow/git-exec.js.map +1 -1
  39. package/src/scripts/workflow/push-dev-state.d.ts +52 -0
  40. package/src/scripts/workflow/push-dev-state.js +147 -0
  41. package/src/scripts/workflow/push-dev-state.js.map +1 -0
  42. package/src/scripts/workflow/review-report.d.ts +62 -1
  43. package/src/scripts/workflow/review-report.js +165 -34
  44. package/src/scripts/workflow/review-report.js.map +1 -1
  45. package/src/scripts/workflow/reviewer-briefing-builder.js +1 -0
  46. package/src/scripts/workflow/reviewer-briefing-builder.js.map +1 -1
  47. package/src/scripts/workflow/reviewer-verdict-gate.d.ts +10 -0
  48. package/src/scripts/workflow/reviewer-verdict-gate.js +17 -1
  49. package/src/scripts/workflow/reviewer-verdict-gate.js.map +1 -1
  50. package/src/scripts/wp-finish-push-dev.d.ts +2 -0
  51. package/src/scripts/wp-finish-push-dev.js +20 -0
  52. package/src/scripts/wp-finish-push-dev.js.map +1 -0
  53. package/src/scripts/wp-push-dev.d.ts +2 -0
  54. package/src/scripts/wp-push-dev.js +44 -0
  55. package/src/scripts/wp-push-dev.js.map +1 -0
  56. package/src/scripts/wp-review-upsert-pr.js +9 -2
  57. package/src/scripts/wp-review-upsert-pr.js.map +1 -1
@@ -0,0 +1,20 @@
1
+ #!/usr/bin/env node
2
+ "use strict";
3
+ Object.defineProperty(exports, "__esModule", { value: true });
4
+ require("reflect-metadata");
5
+ const inversify_1 = require("inversify");
6
+ const rules_config_1 = require("@webpieces/rules-config");
7
+ const pr_gate_app_1 = require("./pr-gate-app");
8
+ const finish_push_dev_command_1 = require("./commands/finish-push-dev-command");
9
+ const ABORT = '--abort';
10
+ // Composition root: build the container and resolve the app so inversify constructs the whole DAG.
11
+ (0, rules_config_1.runMain)(async () => {
12
+ // autobind self-binds every @injectable(Singleton) tooling class (replaces the buildProviderModule registry scan)
13
+ const container = new inversify_1.Container({ autobind: true });
14
+ // Reject `--help`/bogus flags BEFORE the app touches git — a mistyped `--abrt` that was silently
15
+ // ignored would COMMIT and PUBLISH the composition the caller was trying to throw away.
16
+ const args = container.get(rules_config_1.CliArgs).parse(new rules_config_1.CliUsage('wp-finish-push-dev', 'Commit a resolved dev composition and publish the copy. Only needed when `pnpm wp-push-dev --resolve` stopped on a conflict.', [new rules_config_1.CliFlag(ABORT, 'Throw the whole resolve away: undo the halted merge, go back to your feature\n'
17
+ + ' branch, and delete the throwaway branch and state file. Nothing is published.')]));
18
+ await container.get(pr_gate_app_1.PrGateApp).finishPushDev(new finish_push_dev_command_1.FinishPushDevOptions(args.has(ABORT)));
19
+ });
20
+ //# sourceMappingURL=wp-finish-push-dev.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"wp-finish-push-dev.js","sourceRoot":"","sources":["../../../../../../packages/tooling/pr-gate/src/scripts/wp-finish-push-dev.ts"],"names":[],"mappings":";;;AACA,4BAA0B;AAC1B,yCAAsC;AACtC,0DAA8E;AAC9E,+CAA0C;AAC1C,gFAA0E;AAE1E,MAAM,KAAK,GAAG,SAAS,CAAC;AAExB,mGAAmG;AACnG,IAAA,sBAAO,EAAC,KAAK,IAAmB,EAAE;IAC9B,kHAAkH;IAClH,MAAM,SAAS,GAAG,IAAI,qBAAS,CAAC,EAAE,QAAQ,EAAE,IAAI,EAAE,CAAC,CAAC;IACpD,iGAAiG;IACjG,wFAAwF;IACxF,MAAM,IAAI,GAAG,SAAS,CAAC,GAAG,CAAC,sBAAO,CAAC,CAAC,KAAK,CAAC,IAAI,uBAAQ,CAClD,oBAAoB,EACpB,8HAA8H,EAC9H,CAAC,IAAI,sBAAO,CAAC,KAAK,EACd,gFAAgF;cAC9E,2FAA2F,CAAC,CAAC,CACtG,CAAC,CAAC;IACH,MAAM,SAAS,CAAC,GAAG,CAAC,uBAAS,CAAC,CAAC,aAAa,CAAC,IAAI,8CAAoB,CAAC,IAAI,CAAC,GAAG,CAAC,KAAK,CAAC,CAAC,CAAC,CAAC;AAC5F,CAAC,CAAC,CAAC","sourcesContent":["#!/usr/bin/env node\nimport 'reflect-metadata';\nimport { Container } from 'inversify';\nimport { runMain, CliArgs, CliFlag, CliUsage } from '@webpieces/rules-config';\nimport { PrGateApp } from './pr-gate-app';\nimport { FinishPushDevOptions } from './commands/finish-push-dev-command';\n\nconst ABORT = '--abort';\n\n// Composition root: build the container and resolve the app so inversify constructs the whole DAG.\nrunMain(async (): Promise<void> => {\n // autobind self-binds every @injectable(Singleton) tooling class (replaces the buildProviderModule registry scan)\n const container = new Container({ autobind: true });\n // Reject `--help`/bogus flags BEFORE the app touches git — a mistyped `--abrt` that was silently\n // ignored would COMMIT and PUBLISH the composition the caller was trying to throw away.\n const args = container.get(CliArgs).parse(new CliUsage(\n 'wp-finish-push-dev',\n 'Commit a resolved dev composition and publish the copy. Only needed when `pnpm wp-push-dev --resolve` stopped on a conflict.',\n [new CliFlag(ABORT,\n 'Throw the whole resolve away: undo the halted merge, go back to your feature\\n'\n + ' branch, and delete the throwaway branch and state file. Nothing is published.')],\n ));\n await container.get(PrGateApp).finishPushDev(new FinishPushDevOptions(args.has(ABORT)));\n});\n"]}
@@ -0,0 +1,2 @@
1
+ #!/usr/bin/env node
2
+ import 'reflect-metadata';
@@ -0,0 +1,44 @@
1
+ #!/usr/bin/env node
2
+ "use strict";
3
+ Object.defineProperty(exports, "__esModule", { value: true });
4
+ require("reflect-metadata");
5
+ const inversify_1 = require("inversify");
6
+ const rules_config_1 = require("@webpieces/rules-config");
7
+ const pr_gate_app_1 = require("./pr-gate-app");
8
+ const push_dev_command_1 = require("./commands/push-dev-command");
9
+ const REMOVE = '--remove';
10
+ const LIST = '--list';
11
+ const FORCE = '--force';
12
+ const REBASE_RESOLUTION = '--rebase-resolution';
13
+ const RESOLVE = '--resolve';
14
+ // Composition root: build the container and resolve the app so inversify constructs the whole DAG.
15
+ (0, rules_config_1.runMain)(async () => {
16
+ // autobind self-binds every @injectable(Singleton) tooling class (replaces the buildProviderModule registry scan)
17
+ const container = new inversify_1.Container({ autobind: true });
18
+ // Reject `--help`/bogus flags BEFORE the app touches git — an ignored flag must never start the flow.
19
+ // A mistyped `--forc` that was silently dropped would turn "discard the published resolution" into a
20
+ // refusal, or worse, the reverse.
21
+ const args = container.get(rules_config_1.CliArgs).parse(new rules_config_1.CliUsage('wp-push-dev', 'Publish a DISPOSABLE copy of this branch for the shared dev environment. No PR, no build, and the feature branch is never moved.', [
22
+ new rules_config_1.CliFlag(LIST, 'List the dev copies currently published on origin, then stop.'),
23
+ new rules_config_1.CliFlag(REMOVE, 'Delete this branch\'s dev copy — the rollback. It drops out of the shared dev\n'
24
+ + ' branch on the next composition run.'),
25
+ new rules_config_1.CliFlag(RESOLVE, 'Compose the OTHER published copies onto yours, so the shared environment can\n'
26
+ + ' build them together. With a branch name, merge only that one (the CI\n'
27
+ + ' conflict message names it); bare, merge every other copy in the order\n'
28
+ + ' CI composes them. Conflicts stop for you to resolve; finish with\n'
29
+ + ' `pnpm wp-finish-push-dev`.', true),
30
+ new rules_config_1.CliFlag(REBASE_RESOLUTION, 'The copy already holds a conflict resolution and your branch has moved on:\n'
31
+ + ' REPLAY that resolution on top of your new commits instead of losing it.'),
32
+ new rules_config_1.CliFlag(FORCE, 'DISCARD a conflict resolution published on the copy and overwrite it with your\n'
33
+ + ' branch as-is. Somebody has to re-resolve the composition afterwards.'),
34
+ ]));
35
+ const opts = new push_dev_command_1.PushDevOptions();
36
+ opts.list = args.has(LIST);
37
+ opts.remove = args.has(REMOVE);
38
+ opts.force = args.has(FORCE);
39
+ opts.rebaseResolution = args.has(REBASE_RESOLUTION);
40
+ opts.resolve = args.has(RESOLVE);
41
+ opts.resolveTarget = args.value(RESOLVE);
42
+ await container.get(pr_gate_app_1.PrGateApp).pushDev(opts);
43
+ });
44
+ //# sourceMappingURL=wp-push-dev.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"wp-push-dev.js","sourceRoot":"","sources":["../../../../../../packages/tooling/pr-gate/src/scripts/wp-push-dev.ts"],"names":[],"mappings":";;;AACA,4BAA0B;AAC1B,yCAAsC;AACtC,0DAA8E;AAC9E,+CAA0C;AAC1C,kEAA6D;AAE7D,MAAM,MAAM,GAAG,UAAU,CAAC;AAC1B,MAAM,IAAI,GAAG,QAAQ,CAAC;AACtB,MAAM,KAAK,GAAG,SAAS,CAAC;AACxB,MAAM,iBAAiB,GAAG,qBAAqB,CAAC;AAChD,MAAM,OAAO,GAAG,WAAW,CAAC;AAE5B,mGAAmG;AACnG,IAAA,sBAAO,EAAC,KAAK,IAAmB,EAAE;IAC9B,kHAAkH;IAClH,MAAM,SAAS,GAAG,IAAI,qBAAS,CAAC,EAAE,QAAQ,EAAE,IAAI,EAAE,CAAC,CAAC;IACpD,sGAAsG;IACtG,qGAAqG;IACrG,kCAAkC;IAClC,MAAM,IAAI,GAAG,SAAS,CAAC,GAAG,CAAC,sBAAO,CAAC,CAAC,KAAK,CAAC,IAAI,uBAAQ,CAClD,aAAa,EACb,kIAAkI,EAClI;QACI,IAAI,sBAAO,CAAC,IAAI,EAAE,+DAA+D,CAAC;QAClF,IAAI,sBAAO,CAAC,MAAM,EACd,iFAAiF;cAC/E,6DAA6D,CAAC;QACpE,IAAI,sBAAO,CAAC,OAAO,EACf,gFAAgF;cAC9E,gGAAgG;cAChG,iGAAiG;cACjG,4FAA4F;cAC5F,oDAAoD,EAAE,IAAI,CAAC;QACjE,IAAI,sBAAO,CAAC,iBAAiB,EACzB,8EAA8E;cAC5E,iGAAiG,CAAC;QACxG,IAAI,sBAAO,CAAC,KAAK,EACb,kFAAkF;cAChF,8FAA8F,CAAC;KACxG,CACJ,CAAC,CAAC;IACH,MAAM,IAAI,GAAG,IAAI,iCAAc,EAAE,CAAC;IAClC,IAAI,CAAC,IAAI,GAAG,IAAI,CAAC,GAAG,CAAC,IAAI,CAAC,CAAC;IAC3B,IAAI,CAAC,MAAM,GAAG,IAAI,CAAC,GAAG,CAAC,MAAM,CAAC,CAAC;IAC/B,IAAI,CAAC,KAAK,GAAG,IAAI,CAAC,GAAG,CAAC,KAAK,CAAC,CAAC;IAC7B,IAAI,CAAC,gBAAgB,GAAG,IAAI,CAAC,GAAG,CAAC,iBAAiB,CAAC,CAAC;IACpD,IAAI,CAAC,OAAO,GAAG,IAAI,CAAC,GAAG,CAAC,OAAO,CAAC,CAAC;IACjC,IAAI,CAAC,aAAa,GAAG,IAAI,CAAC,KAAK,CAAC,OAAO,CAAC,CAAC;IACzC,MAAM,SAAS,CAAC,GAAG,CAAC,uBAAS,CAAC,CAAC,OAAO,CAAC,IAAI,CAAC,CAAC;AACjD,CAAC,CAAC,CAAC","sourcesContent":["#!/usr/bin/env node\nimport 'reflect-metadata';\nimport { Container } from 'inversify';\nimport { runMain, CliArgs, CliFlag, CliUsage } from '@webpieces/rules-config';\nimport { PrGateApp } from './pr-gate-app';\nimport { PushDevOptions } from './commands/push-dev-command';\n\nconst REMOVE = '--remove';\nconst LIST = '--list';\nconst FORCE = '--force';\nconst REBASE_RESOLUTION = '--rebase-resolution';\nconst RESOLVE = '--resolve';\n\n// Composition root: build the container and resolve the app so inversify constructs the whole DAG.\nrunMain(async (): Promise<void> => {\n // autobind self-binds every @injectable(Singleton) tooling class (replaces the buildProviderModule registry scan)\n const container = new Container({ autobind: true });\n // Reject `--help`/bogus flags BEFORE the app touches git — an ignored flag must never start the flow.\n // A mistyped `--forc` that was silently dropped would turn \"discard the published resolution\" into a\n // refusal, or worse, the reverse.\n const args = container.get(CliArgs).parse(new CliUsage(\n 'wp-push-dev',\n 'Publish a DISPOSABLE copy of this branch for the shared dev environment. No PR, no build, and the feature branch is never moved.',\n [\n new CliFlag(LIST, 'List the dev copies currently published on origin, then stop.'),\n new CliFlag(REMOVE,\n 'Delete this branch\\'s dev copy — the rollback. It drops out of the shared dev\\n'\n + ' branch on the next composition run.'),\n new CliFlag(RESOLVE,\n 'Compose the OTHER published copies onto yours, so the shared environment can\\n'\n + ' build them together. With a branch name, merge only that one (the CI\\n'\n + ' conflict message names it); bare, merge every other copy in the order\\n'\n + ' CI composes them. Conflicts stop for you to resolve; finish with\\n'\n + ' `pnpm wp-finish-push-dev`.', true),\n new CliFlag(REBASE_RESOLUTION,\n 'The copy already holds a conflict resolution and your branch has moved on:\\n'\n + ' REPLAY that resolution on top of your new commits instead of losing it.'),\n new CliFlag(FORCE,\n 'DISCARD a conflict resolution published on the copy and overwrite it with your\\n'\n + ' branch as-is. Somebody has to re-resolve the composition afterwards.'),\n ],\n ));\n const opts = new PushDevOptions();\n opts.list = args.has(LIST);\n opts.remove = args.has(REMOVE);\n opts.force = args.has(FORCE);\n opts.rebaseResolution = args.has(REBASE_RESOLUTION);\n opts.resolve = args.has(RESOLVE);\n opts.resolveTarget = args.value(RESOLVE);\n await container.get(PrGateApp).pushDev(opts);\n});\n"]}
@@ -5,12 +5,19 @@ require("reflect-metadata");
5
5
  const inversify_1 = require("inversify");
6
6
  const rules_config_1 = require("@webpieces/rules-config");
7
7
  const pr_gate_app_1 = require("./pr-gate-app");
8
+ const review_upsert_pr_command_1 = require("./commands/review-upsert-pr-command");
9
+ const NO_OPTIONAL = '--no-optional';
8
10
  // Composition root: build the container and resolve the app so inversify constructs the whole DAG.
9
11
  (0, rules_config_1.runMain)(async () => {
10
12
  // autobind self-binds every @injectable(Singleton) tooling class (replaces the buildProviderModule registry scan)
11
13
  const container = new inversify_1.Container({ autobind: true });
12
14
  // Reject `--help`/bogus flags BEFORE the app touches git — an ignored flag must never start the flow.
13
- container.get(rules_config_1.CliArgs).assertNoArgs(new rules_config_1.CliUsage('wp-review-upsert-pr', 'Validate the 3-point merge, build it, extract this branch\'s diff, and brief the reviewer subagents.'));
14
- await container.get(pr_gate_app_1.PrGateApp).reviewUpsertPr();
15
+ // An UNDECLARED token is still fatal here: a mistyped `--no-optionl` that was silently ignored would run
16
+ // the flow with exactly the reviews the caller was trying to skip.
17
+ const args = container.get(rules_config_1.CliArgs).parse(new rules_config_1.CliUsage('wp-review-upsert-pr', 'Validate the 3-point merge, build it, extract this branch\'s diff, and brief the reviewer subagents.', [new rules_config_1.CliFlag(NO_OPTIONAL, 'The human has ALREADY said to submit without the optional reviews — do not offer them.\n' +
18
+ ' Pass this ONLY on their instruction, never on your own judgement. Required\n' +
19
+ ' checklists are unaffected, and an optional checklist that already has a red\n' +
20
+ ' verdict on this branch still blocks the PR.')]));
21
+ await container.get(pr_gate_app_1.PrGateApp).reviewUpsertPr(new review_upsert_pr_command_1.ReviewUpsertPrOptions(args.has(NO_OPTIONAL)));
15
22
  });
16
23
  //# sourceMappingURL=wp-review-upsert-pr.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"wp-review-upsert-pr.js","sourceRoot":"","sources":["../../../../../../packages/tooling/pr-gate/src/scripts/wp-review-upsert-pr.ts"],"names":[],"mappings":";;;AACA,4BAA0B;AAC1B,yCAAsC;AACtC,0DAAqE;AACrE,+CAA0C;AAE1C,mGAAmG;AACnG,IAAA,sBAAO,EAAC,KAAK,IAAmB,EAAE;IAC9B,kHAAkH;IAClH,MAAM,SAAS,GAAG,IAAI,qBAAS,CAAC,EAAE,QAAQ,EAAE,IAAI,EAAE,CAAC,CAAC;IACpD,sGAAsG;IACtG,SAAS,CAAC,GAAG,CAAC,sBAAO,CAAC,CAAC,YAAY,CAAC,IAAI,uBAAQ,CAC5C,qBAAqB,EACrB,sGAAsG,CACzG,CAAC,CAAC;IACH,MAAM,SAAS,CAAC,GAAG,CAAC,uBAAS,CAAC,CAAC,cAAc,EAAE,CAAC;AACpD,CAAC,CAAC,CAAC","sourcesContent":["#!/usr/bin/env node\nimport 'reflect-metadata';\nimport { Container } from 'inversify';\nimport { runMain, CliArgs, CliUsage } from '@webpieces/rules-config';\nimport { PrGateApp } from './pr-gate-app';\n\n// Composition root: build the container and resolve the app so inversify constructs the whole DAG.\nrunMain(async (): Promise<void> => {\n // autobind self-binds every @injectable(Singleton) tooling class (replaces the buildProviderModule registry scan)\n const container = new Container({ autobind: true });\n // Reject `--help`/bogus flags BEFORE the app touches git — an ignored flag must never start the flow.\n container.get(CliArgs).assertNoArgs(new CliUsage(\n 'wp-review-upsert-pr',\n 'Validate the 3-point merge, build it, extract this branch\\'s diff, and brief the reviewer subagents.',\n ));\n await container.get(PrGateApp).reviewUpsertPr();\n});\n"]}
1
+ {"version":3,"file":"wp-review-upsert-pr.js","sourceRoot":"","sources":["../../../../../../packages/tooling/pr-gate/src/scripts/wp-review-upsert-pr.ts"],"names":[],"mappings":";;;AACA,4BAA0B;AAC1B,yCAAsC;AACtC,0DAA8E;AAC9E,+CAA0C;AAC1C,kFAA4E;AAE5E,MAAM,WAAW,GAAG,eAAe,CAAC;AAEpC,mGAAmG;AACnG,IAAA,sBAAO,EAAC,KAAK,IAAmB,EAAE;IAC9B,kHAAkH;IAClH,MAAM,SAAS,GAAG,IAAI,qBAAS,CAAC,EAAE,QAAQ,EAAE,IAAI,EAAE,CAAC,CAAC;IACpD,sGAAsG;IACtG,yGAAyG;IACzG,mEAAmE;IACnE,MAAM,IAAI,GAAG,SAAS,CAAC,GAAG,CAAC,sBAAO,CAAC,CAAC,KAAK,CAAC,IAAI,uBAAQ,CAClD,qBAAqB,EACrB,sGAAsG,EACtG,CAAC,IAAI,sBAAO,CACR,WAAW,EACX,0FAA0F;YAC1F,+FAA+F;YAC/F,gGAAgG;YAChG,8DAA8D,CAAC,CAAC,CACvE,CAAC,CAAC;IACH,MAAM,SAAS,CAAC,GAAG,CAAC,uBAAS,CAAC,CAAC,cAAc,CAAC,IAAI,gDAAqB,CAAC,IAAI,CAAC,GAAG,CAAC,WAAW,CAAC,CAAC,CAAC,CAAC;AACpG,CAAC,CAAC,CAAC","sourcesContent":["#!/usr/bin/env node\nimport 'reflect-metadata';\nimport { Container } from 'inversify';\nimport { runMain, CliArgs, CliFlag, CliUsage } from '@webpieces/rules-config';\nimport { PrGateApp } from './pr-gate-app';\nimport { ReviewUpsertPrOptions } from './commands/review-upsert-pr-command';\n\nconst NO_OPTIONAL = '--no-optional';\n\n// Composition root: build the container and resolve the app so inversify constructs the whole DAG.\nrunMain(async (): Promise<void> => {\n // autobind self-binds every @injectable(Singleton) tooling class (replaces the buildProviderModule registry scan)\n const container = new Container({ autobind: true });\n // Reject `--help`/bogus flags BEFORE the app touches git — an ignored flag must never start the flow.\n // An UNDECLARED token is still fatal here: a mistyped `--no-optionl` that was silently ignored would run\n // the flow with exactly the reviews the caller was trying to skip.\n const args = container.get(CliArgs).parse(new CliUsage(\n 'wp-review-upsert-pr',\n 'Validate the 3-point merge, build it, extract this branch\\'s diff, and brief the reviewer subagents.',\n [new CliFlag(\n NO_OPTIONAL,\n 'The human has ALREADY said to submit without the optional reviews — do not offer them.\\n' +\n ' Pass this ONLY on their instruction, never on your own judgement. Required\\n' +\n ' checklists are unaffected, and an optional checklist that already has a red\\n' +\n ' verdict on this branch still blocks the PR.')],\n ));\n await container.get(PrGateApp).reviewUpsertPr(new ReviewUpsertPrOptions(args.has(NO_OPTIONAL)));\n});\n"]}