@giamme/forge 0.13.0 → 0.14.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.
Files changed (60) hide show
  1. package/CHANGELOG.md +40 -0
  2. package/SKILL.md +17 -11
  3. package/VERSION +1 -1
  4. package/docs/artifacts.md +1 -0
  5. package/docs/commands.md +121 -7
  6. package/docs/development.md +3 -0
  7. package/docs/forge-ui.md +7 -1
  8. package/docs/reviews.md +2 -0
  9. package/docs/troubleshooting.md +5 -1
  10. package/forge +28 -1
  11. package/package.json +1 -1
  12. package/references/dataset.md +3 -1
  13. package/references/decision-models.md +5 -1
  14. package/references/decompose.md +199 -61
  15. package/references/runtime.md +29 -0
  16. package/references/ui.md +10 -0
  17. package/scripts/forge-compare.py +491 -0
  18. package/scripts/forge-config.py +3 -3
  19. package/scripts/forge-contract.py +34 -8
  20. package/scripts/forge-control.py +105 -13
  21. package/scripts/forge-dispatch.sh +9 -5
  22. package/scripts/forge-jev-options.sh +17 -4
  23. package/scripts/forge-ledger.py +387 -0
  24. package/scripts/forge-lib-plans.sh +16 -2
  25. package/scripts/forge-lib-task.sh +390 -28
  26. package/scripts/forge-parallel-options.sh +20 -4
  27. package/scripts/forge-parallel.sh +118 -12
  28. package/scripts/forge-plan-check.py +68 -3
  29. package/scripts/forge-pr.py +276 -0
  30. package/scripts/forge-route.py +350 -34
  31. package/scripts/forge-runs.py +18 -1
  32. package/scripts/forge-runtime.py +23 -7
  33. package/scripts/forge-schedule.py +303 -46
  34. package/scripts/forge-solo.sh +1 -0
  35. package/scripts/forge-ui-options.sh +25 -0
  36. package/scripts/forge-verify-failed.py +111 -0
  37. package/scripts/forge-watch.py +372 -0
  38. package/scripts/forge_dataset/export.py +87 -41
  39. package/scripts/forge_dataset/harvest.py +3 -1
  40. package/scripts/forge_decide/budget.py +39 -8
  41. package/scripts/forge_decide/doctor.py +49 -0
  42. package/scripts/forge_fractal/cli.py +23 -6
  43. package/scripts/forge_infra.py +274 -0
  44. package/scripts/forge_jev/client.py +13 -9
  45. package/ui/docs/api.md +83 -15
  46. package/ui/forge_ui/control.py +11 -3
  47. package/ui/forge_ui/export.py +6 -2
  48. package/ui/forge_ui/models.py +16 -16
  49. package/ui/forge_ui/reader.py +217 -13
  50. package/ui/forge_ui/repos.py +428 -0
  51. package/ui/forge_ui/static/app.js +24 -5
  52. package/ui/forge_ui/static/checksview.js +20 -7
  53. package/ui/forge_ui/static/cloudmodel.js +8 -5
  54. package/ui/forge_ui/static/controls.js +6 -3
  55. package/ui/forge_ui/static/modelstats.js +12 -8
  56. package/ui/forge_ui/static/panel.js +69 -4
  57. package/ui/forge_ui/static/runmodel.js +55 -10
  58. package/ui/forge_ui/static/scene3d.js +3 -2
  59. package/ui/forge_ui/static/settings.js +147 -29
  60. package/ui/forge_ui/static/style.css +49 -7
@@ -4,11 +4,17 @@
4
4
  show <plan> [--json] every control, per-task overrides, pins and the change log
5
5
  set <plan> <key> <value> [--task ID] qa-threshold, timeout, escalate-after, escalate-effort,
6
6
  verify-retries, retry-budget, infra-retries, infra-backoff
7
- (none drops it), max-parallel (1-64), pre-review-tests
8
- (on/off), pre-review-parallel (1-64)
7
+ (none drops it), infra-fallback (on/off), max-parallel (1-64),
8
+ pre-review-tests
9
+ (on/off), pre-review-parallel (1-64), max-attempts (0 = no cap;
10
+ needs --confirm: raising the cap is a person's decision),
11
+ converge-window (reviews the non-converging signal looks at)
9
12
  pin <plan> <task> <spec> the model the task's next FULL implementer retry uses
10
13
  unpin <plan> <task>
11
14
  retry <plan> <task> [--dwarf SPEC] queue a retry of a stopped or failed task into the live run
15
+ a NEEDS_DECISION task (reviews that do not converge, or a stop with no
16
+ stronger model) is resumed only by a decision: --decide retry=N or
17
+ threshold=P0..P3, or --dwarf SPEC, each with --reason TEXT --approved
12
18
  add <plan> <task> queue a row added to tasks.tsv (with its prompt.md) into the live run
13
19
  drain <plan> start nothing new; running tasks finish and the scheduler waits
14
20
  while tasks remain (with none left to start, the run ends as usual)
@@ -19,8 +25,9 @@
19
25
  them like SIGTERM
20
26
 
21
27
  `show` reports escalate-after and verify-retries at their defaults (3 and 1) when unset,
22
- escalate-effort and pre-review-tests as on or off (off when the file is absent), pre-review-parallel
23
- at its default (2) when unset, and the two budgets only while a scheduler is live.
28
+ escalate-effort, infra-fallback and pre-review-tests as on or off (off when the file is absent),
29
+ pre-review-parallel at its default (2) when unset, each task's attempts used and cap (`9/8`, or `9/-`
30
+ with no cap), and the two budgets only while a scheduler is live.
24
31
 
25
32
  Every change is validated, written atomically under the plan's control lock (`control.lock`),
26
33
  appended to `control.log` and recorded as a dataset `control` event. This is the only writer of
@@ -56,6 +63,14 @@ import stat
56
63
  import subprocess
57
64
  import sys
58
65
  import time
66
+ from pathlib import Path
67
+
68
+ # forge_infra.py sits beside this file: the causes table and the wording the run summary shares. As in
69
+ # forge-schedule.py, the directory is put on sys.path here, since -I or PYTHONSAFEPATH would leave it off.
70
+ SCRIPTS = os.path.dirname(os.path.realpath(__file__))
71
+ if SCRIPTS not in sys.path:
72
+ sys.path.insert(0, SCRIPTS)
73
+ import forge_infra # noqa: E402
59
74
 
60
75
  SKILL = os.path.dirname(os.path.dirname(os.path.realpath(__file__)))
61
76
  LOCK_WAIT = 5.0
@@ -74,6 +89,7 @@ NEXT_DECISION = 'at the next retry decision'
74
89
  NEXT_RETRY = 'at the next full retry (not QA-only resumes)'
75
90
  NEXT_VERIFY = 'at the next verification'
76
91
  NEXT_INFRA_WAIT = 'at the next infrastructure wait'
92
+ NEXT_INFRA_STOP = 'at the next infrastructure stop'
77
93
  NEXT_DISPATCH = "at the scheduler's next dispatch decision"
78
94
 
79
95
 
@@ -397,7 +413,8 @@ def nullable(value):
397
413
  return None if value in (None, '', '-', 'UNASSIGNED') else value
398
414
 
399
415
 
400
- PAUSE_KEYS = ('scope', 'class', 'harness', 'model', 'tasks', 'cycle', 'until', 'exhausted')
416
+ PAUSE_KEYS = ('scope', 'class', 'harness', 'model', 'tasks', 'cycle', 'until', 'exhausted', 'needs_you', 'hint',
417
+ 'reset_at')
401
418
 
402
419
 
403
420
  def paused_scopes(text):
@@ -427,12 +444,14 @@ def show(plan, rows):
427
444
  verify_retries=number(get('verify_retries')),
428
445
  retry_budget=budget('retry_budget'), infra_budget=budget('infra_budget'))
429
446
  run['infra_backoff'] = get('infra_backoff') or default_backoff()
447
+ run['infra_fallback'] = 'on' if get('infra_fallback') == 'on' else 'off'
430
448
  parallel = number(get('max_parallel'))
431
449
  run['max_parallel'] = parallel if parallel and parallel <= 64 else None
432
450
  stopping = get('stop') if live else None
433
451
  run['drained'] = live and has(plan, 'drain')
434
452
  run['stopping'] = stopping if stopping in ('graceful', 'now') else None
435
453
  run['infra_paused'] = paused_scopes(get('infra.paused')) if live else None
454
+ pauses, now = run['infra_paused'] or [], time.time()
436
455
  if run['escalate_after'] is None:
437
456
  run['escalate_after'] = DEFAULT_ESCALATE_AFTER
438
457
  if run['verify_retries'] is None:
@@ -454,6 +473,10 @@ def show(plan, rows):
454
473
  retries_used=number(get(base + 'retries.used')) or 0,
455
474
  pin=get(base + 'escalation.pin'), escalation_stop=has(plan, base + 'escalation.stop'),
456
475
  escalation_next=get(base + 'escalation.next'))
476
+ if tasks[task]['status'] == 'INFRA':
477
+ # Present on an INFRA task only (#81): its cause, where it stopped, when the limit resets, who must act.
478
+ info = forge_infra.parse_stop(get(base + 'infra.txt'))
479
+ tasks[task]['infra'] = forge_infra.stop_of(task, info, pauses, now)
457
480
  log = []
458
481
  for line in reversed((read_file(plan, 'control.log', tail=LOG_TAIL) or '').splitlines()):
459
482
  try:
@@ -497,6 +520,20 @@ def schedule_module():
497
520
  return _SCHEDULE
498
521
 
499
522
 
523
+ _ROUTE = None
524
+
525
+
526
+ def route_module():
527
+ """forge-route.py, loaded by path: the one owner of a task's attempts used and its cap (#69)."""
528
+ global _ROUTE
529
+ if _ROUTE is None:
530
+ import importlib.util
531
+ spec = importlib.util.spec_from_file_location('forge_route', os.path.join(SKILL, 'scripts', 'forge-route.py'))
532
+ _ROUTE = importlib.util.module_from_spec(spec)
533
+ spec.loader.exec_module(_ROUTE)
534
+ return _ROUTE
535
+
536
+
500
537
  def _backoff(value, task):
501
538
  if value == 'none':
502
539
  return value
@@ -537,9 +574,12 @@ KEYS = {
537
574
  'retry-budget': ('both', _budget, 'retry_budget', True, NEXT_DECISION),
538
575
  'infra-retries': ('plan', _int, 'infra_budget', True, NEXT_DECISION),
539
576
  'infra-backoff': ('plan', _backoff, 'infra_backoff', False, NEXT_INFRA_WAIT),
577
+ 'infra-fallback': ('plan', _onoff, 'infra_fallback', False, NEXT_INFRA_STOP),
540
578
  'max-parallel': ('plan', _parallel, 'max_parallel', True, NEXT_DISPATCH),
541
579
  'pre-review-tests': ('plan', _onoff, 'pre_review_tests', False, NEXT_ATTEMPT),
542
580
  'pre-review-parallel': ('plan', _parallel, 'pre_review_parallel', False, NEXT_ATTEMPT),
581
+ 'max-attempts': ('plan', _int, 'max_attempts', False, NEXT_DECISION),
582
+ 'converge-window': ('plan', _int, 'converge_window', False, NEXT_DECISION),
543
583
  }
544
584
 
545
585
 
@@ -592,6 +632,12 @@ def change(args, plan, rows, action, task, key, work, applies, summary, live_onl
592
632
  def cmd_set(args):
593
633
  plan, rows = load(args.plan)
594
634
  scope, check, name, live_only, applies = KEYS[args.key]
635
+ # The cap on a task's attempts is a person's decision: any change to it is given with --confirm.
636
+ if args.key == 'max-attempts' and not args.confirm:
637
+ raise Refused('max-attempts is a person\'s decision: a task at its cap waits for one, and raising the cap '
638
+ 'lets it run more attempts; give --confirm to change it')
639
+ if args.confirm and args.key != 'max-attempts':
640
+ raise Invalid('--confirm applies only to max-attempts')
595
641
  task = args.task
596
642
  if task is not None:
597
643
  require_task(rows, task)
@@ -758,8 +804,9 @@ def check_row(plan, rows, task):
758
804
  return dwarf, qa
759
805
 
760
806
 
761
- def queue(args, plan, verb, task, dwarf):
762
- """Write the request under the control lock, live only; log it with its id."""
807
+ def queue(args, plan, verb, task, dwarf, decision=None):
808
+ """Write the request under the control lock, live only; log it with its id.
809
+ decision: a retry's (--decide choice or None, reason, approved) for a NEEDS_DECISION task."""
763
810
  with control_lock(plan):
764
811
  probe(plan, 'control.log')
765
812
  if not is_live(plan):
@@ -768,8 +815,10 @@ def queue(args, plan, verb, task, dwarf):
768
815
  refuse_task(plan, task, pin=True)
769
816
  name = f'{time.time_ns()}-{os.getpid()}.json'
770
817
  request = dict(verb=verb, task=task, dwarf=dwarf, at=time.time(), actor=args.actor)
818
+ if decision:
819
+ request.update(decide=decision[0], reason=decision[1], approved=True)
771
820
  write_atomic(plan, f'{REQUESTS}/{name}', json.dumps(request) + '\n')
772
- audit(plan, args.actor, verb, task, None, dwarf, None, request=name)
821
+ audit(plan, args.actor, verb, task, None, dwarf or (decision[0] if decision else None), None, request=name)
773
822
  if args.json:
774
823
  json.dump(dict(queued=True, request=name), sys.stdout)
775
824
  sys.stdout.write('\n')
@@ -779,6 +828,35 @@ def queue(args, plan, verb, task, dwarf):
779
828
  return 0
780
829
 
781
830
 
831
+ DECISION = re.compile(r'retry=(?:[1-9]|1[0-9]|20)|threshold=P[0-3]')
832
+
833
+
834
+ def decision_of(plan, args, dwarf):
835
+ """The decision a retry carries, (choice or None, reason, True), or None for a plain retry.
836
+ A NEEDS_DECISION task is resumed only by a decision: --decide or --dwarf, with --reason and
837
+ --approved. --decide is for no other task."""
838
+ status = task_status(plan, args.task, strict=True)
839
+ if status != 'NEEDS_DECISION':
840
+ if args.decide is not None:
841
+ raise Refused(f'task {args.task} is {status}, not waiting for a decision: --decide only decides a NEEDS_DECISION task')
842
+ return None
843
+ if args.decide is None and dwarf is None:
844
+ head = ' '.join(line.strip() for line in (read_file(plan, f'tasks/{args.task}/decision.md') or '').splitlines()[:3]
845
+ if line.strip())
846
+ raise Refused(f'task {args.task} is waiting for your decision, and only a decision resumes it: {head or "see decision.md"} '
847
+ '(retry --decide retry=N | threshold=Pn, or --dwarf SPEC, each with --reason TEXT --approved)')
848
+ if args.decide is not None and dwarf is not None:
849
+ raise Invalid('give --decide or --dwarf, not both: a decision is one choice')
850
+ if args.decide is not None and not DECISION.fullmatch(args.decide):
851
+ raise Invalid('--decide takes retry=N (1 to 20) or threshold=P0|P1|P2|P3')
852
+ reason = re.sub(r'\s+', ' ', args.reason or '').strip()
853
+ if not reason:
854
+ raise Invalid('a decision needs --reason TEXT: it is recorded with the task')
855
+ if not args.approved:
856
+ raise Invalid('a decision needs --approved: it resumes a task forge stopped, and is only given on the user\'s instruction')
857
+ return args.decide, reason, True
858
+
859
+
782
860
  def cmd_retry(args):
783
861
  plan, rows = load(args.plan)
784
862
  require_task(rows, args.task)
@@ -786,9 +864,10 @@ def cmd_retry(args):
786
864
  if args.dwarf is not None:
787
865
  dwarf = clean_spec(args.dwarf, '--dwarf')
788
866
  refuse_task(plan, args.task, pin=True) # before the doctor: MERGED and Fractal need no model check
867
+ decision = decision_of(plan, args, dwarf)
789
868
  if dwarf:
790
869
  doctor(dwarf)
791
- return queue(args, plan, 'retry', args.task, dwarf)
870
+ return queue(args, plan, 'retry', args.task, dwarf, decision)
792
871
 
793
872
 
794
873
  def cmd_add(args):
@@ -821,6 +900,7 @@ def cmd_show(args):
821
900
  f" fractal {'yes' if controls['fractal'] else 'no'}")
822
901
  print(' ' + ' '.join(f"{k.replace('_', '-')} {cell(v)}" + (' (default)' if k == 'qa_threshold' and run['qa_threshold_source'] == 'default' else '')
823
902
  for k, v in run.items() if k not in ('infra_paused', 'qa_threshold_source')))
903
+ now = time.time()
824
904
  for p in run['infra_paused'] or []:
825
905
  tasks = ','.join(t for t in (p['tasks'] or []) if isinstance(t, str)) or '-'
826
906
  if p['exhausted']:
@@ -829,12 +909,20 @@ def cmd_show(args):
829
909
  when = f"wait {cell(p['cycle'])} until {stamp(p['until'])}"
830
910
  else:
831
911
  when = 'waiting for running tasks to finish'
832
- print(f" paused {p['scope']} ({cell(p['class'])}) tasks {tasks} {when}")
833
- columns = ('task', 'status', 'dwarf', 'qa', 'threshold', 'budget', 'used', 'pin', 'stop', 'next')
912
+ # The reset, and a pause that waits on a person says so with the hint (#81).
913
+ parts = [when] + [text for text in [forge_infra.reset_text(p['reset_at'], now)] if text]
914
+ if p['needs_you']:
915
+ parts.append('needs you' + (f": {p['hint']}" if isinstance(p['hint'], str) and p['hint'] else ''))
916
+ print(f" paused {p['scope']} ({forge_infra.label(p['class'])}) tasks {tasks} " + ' '.join(parts))
917
+ columns = ('task', 'status', 'dwarf', 'qa', 'threshold', 'budget', 'used', 'attempts', 'pin', 'stop', 'next')
834
918
  table = [columns]
835
919
  for task, t in controls['tasks'].items():
836
- table.append((task, t['status'], cell(t['dwarf']), cell(t['qa']), cell(t['qa_threshold']), cell(t['retry_budget']),
837
- cell(t['retries_used']), cell(t['pin']), 'yes' if t['escalation_stop'] else '-',
920
+ status = f"{t['status']} ({t['infra']['cause']})" if t.get('infra') else t['status']
921
+ # attempts used/cap (#69): 9/8, or 9/- for a plan with no cap. Text only: the JSON keeps its keys.
922
+ used, cap = route_module().attempt_cap(Path(plan), task)
923
+ attempts = f"{used}/{cell(cap)}"
924
+ table.append((task, status, cell(t['dwarf']), cell(t['qa']), cell(t['qa_threshold']), cell(t['retry_budget']),
925
+ cell(t['retries_used']), attempts, cell(t['pin']), 'yes' if t['escalation_stop'] else '-',
838
926
  cell(t['escalation_next'])))
839
927
  widths = [max(len(r[i]) for r in table) for i in range(len(columns))]
840
928
  for r in table:
@@ -872,6 +960,7 @@ def parser():
872
960
  p.add_argument('key', choices=list(KEYS))
873
961
  p.add_argument('value')
874
962
  p.add_argument('--task', metavar='ID', help='change this task only (qa-threshold, retry-budget)')
963
+ p.add_argument('--confirm', action='store_true', help="max-attempts only: the change is a person's decision")
875
964
  p.set_defaults(func=cmd_set)
876
965
  p = sub.add_parser('pin', help="set the model a task's next full retry uses")
877
966
  common(p)
@@ -886,6 +975,9 @@ def parser():
886
975
  common(p)
887
976
  p.add_argument('task')
888
977
  p.add_argument('--dwarf', metavar='SPEC', help='the implementer for this retry (an explicit escalation)')
978
+ p.add_argument('--decide', metavar='CHOICE', help='decide a NEEDS_DECISION task: retry=N (1 to 20) or threshold=P0..P3')
979
+ p.add_argument('--reason', metavar='TEXT', help='why (a decision needs it)')
980
+ p.add_argument('--approved', action='store_true', help='the decision is the user\'s (a decision needs it)')
889
981
  p.set_defaults(func=cmd_retry)
890
982
  p = sub.add_parser('add', help='queue a row added to tasks.tsv into the live run')
891
983
  common(p)
@@ -36,8 +36,9 @@
36
36
  #
37
37
  # Exit codes: 0 ok | 2 usage/resolution error | 3 harness missing or unusable
38
38
  # 4 backend ran but failed | 7 backend exceeded --timeout and was killed
39
- # 8 infrastructure failure (auth, quota, rate limit, network, or an empty
40
- # answer): the model never got to do its work. $ROLE.infra says which.
39
+ # 8 infrastructure failure (auth, usage_limit, budget, capacity, rate_limit,
40
+ # provider_down, network, or an empty answer; forge_infra.py says what each
41
+ # means): the model never got to do its work. $ROLE.infra says which.
41
42
  # A DWARF that exits 0 with an empty final message also writes $ROLE.infra
42
43
  # (class=empty) but still exits 0; consult the file only if the diff is empty.
43
44
  # 9 the session was not continued (--continue-session only): the harness cannot
@@ -844,9 +845,10 @@ if [ -f "$RUN_DIR/$ROLE.timedout" ]; then
844
845
  write_continue failed timeout
845
846
  exit 7
846
847
  fi
847
- # Infrastructure, not the model's work: auth, quota, rate limit, network, or an answer that
848
- # never arrived. Classified from the LOG because $LAST is only created later, by the EXIT
849
- # trap's `finish`. Any trouble running the classifier counts as "not infrastructure".
848
+ # Infrastructure, not the model's work: auth, a usage limit, budget, capacity, rate limit, a
849
+ # provider or the network, or an answer that never arrived. Classified from the LOG because $LAST
850
+ # is only created later, by the EXIT trap's `finish`. Any trouble running the classifier counts as
851
+ # "not infrastructure".
850
852
  INFRA="$(python3 "$RUNTIME" classify "$LOG" "$HARNESS" "$rc" "$LAST" "$ROLE" 2>/dev/null)" || INFRA=""
851
853
  if [ -n "$INFRA" ]; then
852
854
  TAB=$'\t'
@@ -855,6 +857,8 @@ if [ -n "$INFRA" ]; then
855
857
  {
856
858
  echo "class=$infra_class"
857
859
  echo "retry_after=$infra_after"
860
+ # The moment the wait ends, when the message said how long it is.
861
+ case "$infra_after" in ''|*[!0-9]*) ;; *) echo "reset_at=$(( $(date +%s) + infra_after ))" ;; esac
858
862
  echo "detail=$infra_detail"
859
863
  echo "rc=$rc"
860
864
  echo "role=$ROLE"
@@ -78,6 +78,17 @@ _forge_decide_word() {
78
78
  return 1
79
79
  }
80
80
 
81
+ # _forge_decide_split <array-name> <text> — split <text> on IFS into the named array
82
+ # without pathname expansion, so a `*` or `?` in a flag value stays as typed (GitHub #82).
83
+ # The caller's noglob setting is left as it was.
84
+ _forge_decide_split() {
85
+ local had_noglob=0
86
+ case $- in *f*) had_noglob=1 ;; esac
87
+ set -f
88
+ eval "$1=(\$2)"
89
+ [ "$had_noglob" = 1 ] || set +f
90
+ }
91
+
81
92
  # _forge_decide_gate_list <list> — validate and append `name=mode[,name=mode...]` to
82
93
  # DECIDE_GATES. Nothing is appended unless every entry is valid.
83
94
  _forge_decide_gate_list() {
@@ -86,8 +97,9 @@ _forge_decide_gate_list() {
86
97
  echo "--gate needs name=mode[,name=mode...]; gates: $FORGE_DECIDE_GATE_NAMES; modes: $FORGE_DECIDE_MODE_NAMES" >&2
87
98
  return 2
88
99
  fi
89
- local IFS=,
90
- for entry in $list; do
100
+ local IFS=, entries
101
+ _forge_decide_split entries "$list"
102
+ for entry in ${entries[@]+"${entries[@]}"}; do
91
103
  name="${entry%%=*}"; mode="${entry#*=}"
92
104
  if [ "$name" = "$entry" ] || [ -z "$name" ]; then
93
105
  echo "--gate: '$entry' is not name=mode; gates: $FORGE_DECIDE_GATE_NAMES; modes: $FORGE_DECIDE_MODE_NAMES" >&2
@@ -117,8 +129,9 @@ _forge_decide_budget_spec() {
117
129
  local spec="$1" part field value tokens="$DECIDE_BUDGET_TOKENS" usd="$DECIDE_BUDGET_USD"
118
130
  local usage="--decide-budget expects tokens=N[,usd=X] (N a whole number, X a number, both >= 0)"
119
131
  [ -n "$spec" ] || { echo "$usage" >&2; return 2; }
120
- local IFS=,
121
- for part in $spec; do
132
+ local IFS=, parts
133
+ _forge_decide_split parts "$spec"
134
+ for part in ${parts[@]+"${parts[@]}"}; do
122
135
  field="${part%%=*}"; value="${part#*=}"
123
136
  [ "$field" != "$part" ] || { echo "$usage; got '$part'" >&2; return 2; }
124
137
  case "$field" in