ambitgraph 0.9.1__tar.gz → 0.9.3__tar.gz

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 (123) hide show
  1. {ambitgraph-0.9.1/ambitgraph.egg-info → ambitgraph-0.9.3}/PKG-INFO +1 -1
  2. {ambitgraph-0.9.1 → ambitgraph-0.9.3}/ambit_map/__main__.py +1 -1
  3. {ambitgraph-0.9.1 → ambitgraph-0.9.3}/ambit_map/assistant.py +7 -1
  4. {ambitgraph-0.9.1 → ambitgraph-0.9.3}/ambit_map/cli.py +51 -33
  5. {ambitgraph-0.9.1 → ambitgraph-0.9.3}/ambit_map/langmirror.py +16 -1
  6. {ambitgraph-0.9.1 → ambitgraph-0.9.3}/ambit_map/mapllm.py +185 -226
  7. {ambitgraph-0.9.1 → ambitgraph-0.9.3}/ambit_map/serve.py +12 -12
  8. {ambitgraph-0.9.1 → ambitgraph-0.9.3}/ambit_telegraph/export.py +3 -1
  9. {ambitgraph-0.9.1 → ambitgraph-0.9.3}/ambit_telegraph/responsibility.py +3 -1
  10. ambitgraph-0.9.3/ambitgraph/__init__.py +34 -0
  11. {ambitgraph-0.9.1 → ambitgraph-0.9.3}/ambitgraph/_delimited.py +55 -27
  12. {ambitgraph-0.9.1 → ambitgraph-0.9.3}/ambitgraph/cli.py +7 -3
  13. {ambitgraph-0.9.1 → ambitgraph-0.9.3}/ambitgraph/codelib.py +3 -0
  14. {ambitgraph-0.9.1 → ambitgraph-0.9.3}/ambitgraph/console.py +143 -74
  15. {ambitgraph-0.9.1 → ambitgraph-0.9.3}/ambitgraph/demo.py +76 -25
  16. ambitgraph-0.9.3/ambitgraph/docs_discovery.py +365 -0
  17. {ambitgraph-0.9.1 → ambitgraph-0.9.3}/ambitgraph/doctor.py +89 -19
  18. {ambitgraph-0.9.1 → ambitgraph-0.9.3}/ambitgraph/edges.py +1495 -69
  19. ambitgraph-0.9.3/ambitgraph/engine_identity.py +86 -0
  20. ambitgraph-0.9.3/ambitgraph/eval.py +178 -0
  21. {ambitgraph-0.9.1 → ambitgraph-0.9.3}/ambitgraph/explain.py +30 -41
  22. {ambitgraph-0.9.1 → ambitgraph-0.9.3}/ambitgraph/explain_stage.py +67 -34
  23. {ambitgraph-0.9.1 → ambitgraph-0.9.3}/ambitgraph/families.py +157 -83
  24. {ambitgraph-0.9.1 → ambitgraph-0.9.3}/ambitgraph/feeds.py +42 -14
  25. ambitgraph-0.9.3/ambitgraph/gate_check.py +798 -0
  26. {ambitgraph-0.9.1 → ambitgraph-0.9.3}/ambitgraph/gate_server.py +16 -1
  27. ambitgraph-0.9.3/ambitgraph/harvest.py +645 -0
  28. ambitgraph-0.9.3/ambitgraph/jsobjects.py +824 -0
  29. {ambitgraph-0.9.1 → ambitgraph-0.9.3}/ambitgraph/langs.py +27 -20
  30. {ambitgraph-0.9.1 → ambitgraph-0.9.3}/ambitgraph/mds.py +80 -21
  31. {ambitgraph-0.9.1 → ambitgraph-0.9.3}/ambitgraph/merge.py +33 -8
  32. {ambitgraph-0.9.1 → ambitgraph-0.9.3}/ambitgraph/objects.py +57 -17
  33. {ambitgraph-0.9.1 → ambitgraph-0.9.3}/ambitgraph/omniscient_next/__init__.py +56 -18
  34. {ambitgraph-0.9.1 → ambitgraph-0.9.3}/ambitgraph/omniscient_next/_init_js.py +12 -1
  35. {ambitgraph-0.9.1 → ambitgraph-0.9.3}/ambitgraph/omniscient_next/charts.js +3 -1
  36. ambitgraph-0.9.3/ambitgraph/omniscient_next/classdiagram.js +1224 -0
  37. {ambitgraph-0.9.1 → ambitgraph-0.9.3}/ambitgraph/omniscient_next/graph.js +37 -0
  38. ambitgraph-0.9.3/ambitgraph/omniscient_next/insideview.js +1491 -0
  39. {ambitgraph-0.9.1 → ambitgraph-0.9.3}/ambitgraph/omniscient_next/library.js +225 -192
  40. {ambitgraph-0.9.1 → ambitgraph-0.9.3}/ambitgraph/omniscient_next/next_embed.css +184 -46
  41. ambitgraph-0.9.3/ambitgraph/omniscient_next/objectcard.js +402 -0
  42. {ambitgraph-0.9.1 → ambitgraph-0.9.3}/ambitgraph/prompts.py +37 -15
  43. {ambitgraph-0.9.1 → ambitgraph-0.9.3}/ambitgraph/reports.py +41 -20
  44. {ambitgraph-0.9.1 → ambitgraph-0.9.3}/ambitgraph/responsibility.py +74 -41
  45. {ambitgraph-0.9.1 → ambitgraph-0.9.3}/ambitgraph/sample.py +7 -4
  46. {ambitgraph-0.9.1 → ambitgraph-0.9.3}/ambitgraph/stages.py +69 -2
  47. {ambitgraph-0.9.1 → ambitgraph-0.9.3}/ambitgraph/symbols.py +28 -4
  48. {ambitgraph-0.9.1 → ambitgraph-0.9.3}/ambitgraph/tables.py +114 -89
  49. ambitgraph-0.9.3/ambitgraph/tasks.py +158 -0
  50. {ambitgraph-0.9.1 → ambitgraph-0.9.3}/ambitgraph/text_capture.py +28 -15
  51. {ambitgraph-0.9.1 → ambitgraph-0.9.3}/ambitgraph/urcode.py +35 -16
  52. {ambitgraph-0.9.1 → ambitgraph-0.9.3/ambitgraph.egg-info}/PKG-INFO +1 -1
  53. {ambitgraph-0.9.1 → ambitgraph-0.9.3}/ambitgraph.egg-info/SOURCES.txt +4 -0
  54. {ambitgraph-0.9.1 → ambitgraph-0.9.3}/pyproject.toml +1 -1
  55. ambitgraph-0.9.1/ambitgraph/__init__.py +0 -39
  56. ambitgraph-0.9.1/ambitgraph/docs_discovery.py +0 -281
  57. ambitgraph-0.9.1/ambitgraph/engine_identity.py +0 -87
  58. ambitgraph-0.9.1/ambitgraph/eval.py +0 -126
  59. ambitgraph-0.9.1/ambitgraph/gate_check.py +0 -551
  60. ambitgraph-0.9.1/ambitgraph/harvest.py +0 -510
  61. ambitgraph-0.9.1/ambitgraph/tasks.py +0 -105
  62. {ambitgraph-0.9.1 → ambitgraph-0.9.3}/LICENSE +0 -0
  63. {ambitgraph-0.9.1 → ambitgraph-0.9.3}/MANIFEST.in +0 -0
  64. {ambitgraph-0.9.1 → ambitgraph-0.9.3}/README.md +0 -0
  65. {ambitgraph-0.9.1 → ambitgraph-0.9.3}/ambit_contracts/__init__.py +0 -0
  66. {ambitgraph-0.9.1 → ambitgraph-0.9.3}/ambit_contracts/edge.py +0 -0
  67. {ambitgraph-0.9.1 → ambitgraph-0.9.3}/ambit_contracts/envelope.py +0 -0
  68. {ambitgraph-0.9.1 → ambitgraph-0.9.3}/ambit_contracts/fields.py +0 -0
  69. {ambitgraph-0.9.1 → ambitgraph-0.9.3}/ambit_contracts/grant.py +0 -0
  70. {ambitgraph-0.9.1 → ambitgraph-0.9.3}/ambit_contracts/household.py +0 -0
  71. {ambitgraph-0.9.1 → ambitgraph-0.9.3}/ambit_map/__init__.py +0 -0
  72. {ambitgraph-0.9.1 → ambitgraph-0.9.3}/ambit_map/ambit-map-enrich.md +0 -0
  73. {ambitgraph-0.9.1 → ambitgraph-0.9.3}/ambit_map/ambit-mapllm-contract.md +0 -0
  74. {ambitgraph-0.9.1 → ambitgraph-0.9.3}/ambit_map/daemon.py +0 -0
  75. {ambitgraph-0.9.1 → ambitgraph-0.9.3}/ambit_map/dialects/__init__.py +0 -0
  76. {ambitgraph-0.9.1 → ambitgraph-0.9.3}/ambit_map/dialects/contract.py +0 -0
  77. {ambitgraph-0.9.1 → ambitgraph-0.9.3}/ambit_map/dialects/express_pack.py +0 -0
  78. {ambitgraph-0.9.1 → ambitgraph-0.9.3}/ambit_map/dialects/fastapi_pack.py +0 -0
  79. {ambitgraph-0.9.1 → ambitgraph-0.9.3}/ambit_map/dialects/flask_pack.py +0 -0
  80. {ambitgraph-0.9.1 → ambitgraph-0.9.3}/ambit_map/dialects/nextjs_pack.py +0 -0
  81. {ambitgraph-0.9.1 → ambitgraph-0.9.3}/ambit_map/dialects/supabase_pack.py +0 -0
  82. {ambitgraph-0.9.1 → ambitgraph-0.9.3}/ambit_map/load.py +0 -0
  83. {ambitgraph-0.9.1 → ambitgraph-0.9.3}/ambit_map/model.py +0 -0
  84. {ambitgraph-0.9.1 → ambitgraph-0.9.3}/ambit_map/orchestrate.py +0 -0
  85. {ambitgraph-0.9.1 → ambitgraph-0.9.3}/ambit_map/registry.py +0 -0
  86. {ambitgraph-0.9.1 → ambitgraph-0.9.3}/ambit_telegraph/__init__.py +0 -0
  87. {ambitgraph-0.9.1 → ambitgraph-0.9.3}/ambit_telegraph/cli.py +0 -0
  88. {ambitgraph-0.9.1 → ambitgraph-0.9.3}/ambit_telegraph/ledger.py +0 -0
  89. {ambitgraph-0.9.1 → ambitgraph-0.9.3}/ambit_telegraph/store.py +0 -0
  90. {ambitgraph-0.9.1 → ambitgraph-0.9.3}/ambitgraph/WALKTHROUGH.md +0 -0
  91. {ambitgraph-0.9.1 → ambitgraph-0.9.3}/ambitgraph/__main__.py +0 -0
  92. {ambitgraph-0.9.1 → ambitgraph-0.9.3}/ambitgraph/cockpit.py +0 -0
  93. {ambitgraph-0.9.1 → ambitgraph-0.9.3}/ambitgraph/config.py +0 -0
  94. {ambitgraph-0.9.1 → ambitgraph-0.9.3}/ambitgraph/design_tokens.py +0 -0
  95. {ambitgraph-0.9.1 → ambitgraph-0.9.3}/ambitgraph/duplication.py +0 -0
  96. {ambitgraph-0.9.1 → ambitgraph-0.9.3}/ambitgraph/emit.py +0 -0
  97. {ambitgraph-0.9.1 → ambitgraph-0.9.3}/ambitgraph/estimate.py +0 -0
  98. {ambitgraph-0.9.1 → ambitgraph-0.9.3}/ambitgraph/gate.py +0 -0
  99. {ambitgraph-0.9.1 → ambitgraph-0.9.3}/ambitgraph/html_safe.py +0 -0
  100. {ambitgraph-0.9.1 → ambitgraph-0.9.3}/ambitgraph/inventory.py +0 -0
  101. {ambitgraph-0.9.1 → ambitgraph-0.9.3}/ambitgraph/jscalls.py +0 -0
  102. {ambitgraph-0.9.1 → ambitgraph-0.9.3}/ambitgraph/merge_jsp.py +0 -0
  103. {ambitgraph-0.9.1 → ambitgraph-0.9.3}/ambitgraph/omniscient_next/escape.js +0 -0
  104. {ambitgraph-0.9.1 → ambitgraph-0.9.3}/ambitgraph/omniscient_next/filterpanel.js +0 -0
  105. {ambitgraph-0.9.1 → ambitgraph-0.9.3}/ambitgraph/omniscient_next/paths.js +0 -0
  106. {ambitgraph-0.9.1 → ambitgraph-0.9.3}/ambitgraph/omniscient_next/search.js +0 -0
  107. {ambitgraph-0.9.1 → ambitgraph-0.9.3}/ambitgraph/omniscient_next/siderail.js +0 -0
  108. {ambitgraph-0.9.1 → ambitgraph-0.9.3}/ambitgraph/omniscient_next/standalone.py +0 -0
  109. {ambitgraph-0.9.1 → ambitgraph-0.9.3}/ambitgraph/omniscient_next/wholemap.js +0 -0
  110. {ambitgraph-0.9.1 → ambitgraph-0.9.3}/ambitgraph/parameterize.py +0 -0
  111. {ambitgraph-0.9.1 → ambitgraph-0.9.3}/ambitgraph/pipeline.py +0 -0
  112. {ambitgraph-0.9.1 → ambitgraph-0.9.3}/ambitgraph/portal.py +0 -0
  113. {ambitgraph-0.9.1 → ambitgraph-0.9.3}/ambitgraph/pycalls.py +0 -0
  114. {ambitgraph-0.9.1 → ambitgraph-0.9.3}/ambitgraph/pyshapes.py +0 -0
  115. {ambitgraph-0.9.1 → ambitgraph-0.9.3}/ambitgraph/ratify.py +0 -0
  116. {ambitgraph-0.9.1 → ambitgraph-0.9.3}/ambitgraph/report.py +0 -0
  117. {ambitgraph-0.9.1 → ambitgraph-0.9.3}/ambitgraph/secretary.py +0 -0
  118. {ambitgraph-0.9.1 → ambitgraph-0.9.3}/ambitgraph/shell.py +0 -0
  119. {ambitgraph-0.9.1 → ambitgraph-0.9.3}/ambitgraph.egg-info/dependency_links.txt +0 -0
  120. {ambitgraph-0.9.1 → ambitgraph-0.9.3}/ambitgraph.egg-info/entry_points.txt +0 -0
  121. {ambitgraph-0.9.1 → ambitgraph-0.9.3}/ambitgraph.egg-info/requires.txt +0 -0
  122. {ambitgraph-0.9.1 → ambitgraph-0.9.3}/ambitgraph.egg-info/top_level.txt +0 -0
  123. {ambitgraph-0.9.1 → ambitgraph-0.9.3}/setup.cfg +0 -0
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: ambitgraph
3
- Version: 0.9.1
3
+ Version: 0.9.3
4
4
  Summary: Read-only codebase scan: reusable units, families, roles, ownership candidates, duplication.
5
5
  Author: AmbitGraph
6
6
  License: Proprietary
@@ -3,4 +3,4 @@ import sys
3
3
  from .cli import main
4
4
 
5
5
  if __name__ == "__main__":
6
- sys.exit(main(sys.argv[1:]))
6
+ sys.exit(main(sys.argv[1:])) # argv[1:]: the arguments after the program name
@@ -38,6 +38,12 @@ class Page:
38
38
  copies, and the sentence naming where the run stands."""
39
39
 
40
40
  def __init__(self, text, copy_line, state_line):
41
+ """Hold one rendering's three parts.
42
+
43
+ @param text: the page's full text (str)
44
+ @param copy_line: the line a person copies (str)
45
+ @param state_line: the sentence naming where the run stands (str)
46
+ """
41
47
  self.text = text
42
48
  self.copy_line = copy_line
43
49
  self.state_line = state_line
@@ -50,7 +56,7 @@ def state_line(state):
50
56
  @return: the sentence for that state (str)
51
57
  @raises KeyError: when the state is not one of the three
52
58
  """
53
- return _STATE_LINES[state]
59
+ return _STATE_LINES[state] # the fixed sentence for this state; an unknown state raises KeyError
54
60
 
55
61
 
56
62
  def build_page(state, run_dir, task_path, results_path, folder):
@@ -18,6 +18,11 @@ from . import daemon
18
18
 
19
19
 
20
20
  def build_parser() -> argparse.ArgumentParser:
21
+ """Build the command-line parser for `python -m ambit_map`.
22
+
23
+ @return: the configured parser, every map and launcher flag registered (argparse.ArgumentParser)
24
+ """
25
+ # p: the parser being built
21
26
  p = argparse.ArgumentParser(prog="ambit-map",
22
27
  description="Map a repository and serve it on loopback.")
23
28
  p.add_argument("repo", help="the repository to map (read-only)")
@@ -57,19 +62,21 @@ def build_parser() -> argparse.ArgumentParser:
57
62
 
58
63
 
59
64
  def cmd_map(args) -> int:
60
- """Map a repository and serve it on loopback. THE ONE ENTRY POINT.
61
-
62
- The engine seam (a lazy `from ambit_map import cli` inside an
63
- ambitgraph/cli.py command body, following the ambitgraph/cli.py:1396
64
- _cmd_gate pattern) will call cmd_map(args) UNCHANGED -- args need only carry the
65
- six attributes (repo, port, out, config, no_open, once), so an argparse
66
- Namespace built by the engine's own parser works verbatim. Do not add
67
- required positional parameters to this function. --patience,
68
- --stop/--status/--foreground/--idle-minutes are ALL read with getattr
69
- and a default, so a Namespace built by an OLDER engine parser (which has
70
- none of them) keeps working verbatim -- the exact failure mode
71
- (AttributeError traceback on every `python -m ambitgraph map ...`) this
72
- seam exists to prevent.
65
+ """Map a repository and serve it on loopback, or run the launcher's
66
+ stop/status/foreground control paths. THE ONE ENTRY POINT.
67
+ Logic: stop/status answer and exit without scanning; --once scans,
68
+ renders once and exits; the default re-attaches to a running map or
69
+ launches a detached child; --foreground serves in this process.
70
+
71
+ @param args: a Namespace carrying at least repo, port, out, config, no_open and once --
72
+ the engine seam (a lazy `from ambit_map import cli` inside an
73
+ ambitgraph/cli.py command body, following its own _cmd_gate
74
+ pattern) calls cmd_map(args) UNCHANGED and needs only those six, so
75
+ this function must never gain a required positional parameter;
76
+ --patience/--stop/--status/--foreground/--idle-minutes are read
77
+ with getattr and a default so a Namespace built by an OLDER
78
+ engine parser, which has none of them, keeps working verbatim (Namespace)
79
+ @return: the process exit code (int)
73
80
  """
74
81
  # getattr, never args.stop/.status/.foreground/.idle_minutes/.patience
75
82
  # directly -- see the docstring above.
@@ -86,20 +93,22 @@ def cmd_map(args) -> int:
86
93
  # path), never orch.plan() itself, which would mkdir the out dir and
87
94
  # write a fresh config just to answer a status question.
88
95
  if stop_flag or status_flag:
96
+ # repo_p: the repo path, resolved; out_p: the given --out, resolved, or the repo's own default
89
97
  repo_p = Path(args.repo).resolve()
90
98
  out_p = Path(args.out).resolve() if getattr(args, "out", None) else orch.default_out_dir(repo_p)
91
99
  if stop_flag:
100
+ # rc: the process exit code the called daemon function reports
92
101
  rc, message = daemon.stop(out_p, str(repo_p))
93
102
  print(message)
94
103
  return rc
95
- rc, message = daemon.status(out_p, str(repo_p))
104
+ rc, message = daemon.status(out_p, str(repo_p)) # rc: the exit code; message: the line to print
96
105
  print(message)
97
106
  return rc
98
107
 
99
108
  if args.once:
100
109
  try:
101
110
  plan = orch.plan(args.repo, out=args.out, config=args.config, budget=budget)
102
- result, model = orch.bootstrap(plan)
111
+ result, model = orch.bootstrap(plan) # result: this run's ScanResult; model: its MapModel
103
112
  # Drawing the page is the second child of this path, after the
104
113
  # scan, and it fails in its own ways -- inside the try so that a
105
114
  # builder that cannot draw says so and leaves, exactly as a scan
@@ -133,6 +142,7 @@ def cmd_map(args) -> int:
133
142
  print(str(exc))
134
143
  return 2
135
144
  cmd = daemon.invocation_form() + " map"
145
+ # rc: the detached child's exit code; lines: its lines to print; url: its page url or None
136
146
  rc, lines, url = daemon.launch(args, plan.out_dir, str(plan.repo), idle_minutes,
137
147
  budget_s=budget + 30, cmd=cmd)
138
148
  # flush=True, every line, BEFORE open_browser: a caller that piped
@@ -148,29 +158,26 @@ def cmd_map(args) -> int:
148
158
  orch.open_browser(url, not args.no_open)
149
159
  return rc
150
160
 
151
- # --foreground: today's srv.serve path (routing
152
- # through srv.serve() rather than duplicating bind/greet/open/serve is
153
- # what makes reg.SERVE_BANNER ever print at all), now ALSO writing the
154
- # serve file after the bind (on_bound) and carrying idle_minutes, so a
155
- # `--stop`/`--status` from another terminal can find and manage a
156
- # foreground-launched map exactly as it would a detached one.
161
+ # --foreground: serves through srv.serve() (never duplicating
162
+ # bind/greet/open/serve, which is what makes reg.SERVE_BANNER print at
163
+ # all), writing the serve file after the bind (on_bound) and carrying
164
+ # idle_minutes, so a `--stop`/`--status` from another terminal can find
165
+ # and manage a foreground-launched map exactly as it would a detached
166
+ # one.
157
167
  try:
158
168
  plan = orch.plan(args.repo, out=args.out, config=args.config, budget=budget)
159
169
  except orch.OutInsideRepo as exc:
160
170
  print(str(exc))
161
171
  return 2
162
172
 
163
- # The identity check runs BEFORE the scan, and before anything is
164
- # written: this path used to write its serve file without looking,
165
- # and the exiting server's own cleanup then deleted whatever file was
166
- # PRESENT -- which could be a different, still-running map's own
167
- # record. A live map for this repo refuses here instead: the running
168
- # url is printed, nothing is scanned, nothing is written or removed.
173
+ # The identity check runs BEFORE the scan and before anything is
174
+ # written, because a serve file written without it could replace a
175
+ # different, still-running map's own record. A live map for this
176
+ # repo refuses here instead: the running url is printed, nothing is
177
+ # scanned, nothing is written or removed.
169
178
  #
170
- # DAEMON_ALREADY_RUNNING is now the ONE line this
171
- # refusal prints, and it carries {url} itself -- a separate
172
- # DAEMON_REATTACH "-- opened it" used to print alongside it while this
173
- # path opens nothing, which was simply false.
179
+ # DAEMON_ALREADY_RUNNING carries {url} itself (DAEMON_DAMAGED precedes
180
+ # it only when the running map reports damage); this path opens nothing.
174
181
  #
175
182
  # A stale record that already_running's own identity check found and
176
183
  # removed along the way (dead pid, unreachable, wrong repo, pid
@@ -191,6 +198,7 @@ def cmd_map(args) -> int:
191
198
  # ever again.
192
199
  info, health, reason, installed = daemon.already_running(plan.out_dir, str(plan.repo))
193
200
  if health is not None and reason in (daemon.ENGINE_CHANGED, daemon.ENGINE_UNREADABLE):
201
+ # stop_code: daemon.stop's exit code; stop_message: its printable line
194
202
  stop_code, stop_message = daemon.stop(plan.out_dir, str(plan.repo))
195
203
  if stop_code != 0:
196
204
  print(stop_message)
@@ -208,13 +216,13 @@ def cmd_map(args) -> int:
208
216
  elif health is not None:
209
217
  url = "http://127.0.0.1:{0}/".format(info.get("port"))
210
218
  if health.get("damaged"):
211
- print(reg.DAEMON_DAMAGED.format(reason=health["damaged"]))
219
+ print(reg.DAEMON_DAMAGED.format(reason=health["damaged"])) # confirmed set by the check above
212
220
  print(reg.DAEMON_ALREADY_RUNNING.format(url=url, repo=args.repo,
213
221
  cmd=daemon.invocation_form() + " map"))
214
222
  return 2
215
223
 
216
224
  try:
217
- result, model = orch.bootstrap(plan)
225
+ result, model = orch.bootstrap(plan) # result: this run's ScanResult; model: its MapModel
218
226
  except orch.ScanFailed as exc:
219
227
  print(str(exc))
220
228
  return 2
@@ -228,6 +236,11 @@ def cmd_map(args) -> int:
228
236
  log_path = daemon.log_path_for(plan.out_dir)
229
237
 
230
238
  def on_bound(bound_port, token):
239
+ """Write the serve file once the server has actually bound its port.
240
+
241
+ @param bound_port: the port the server bound to (int)
242
+ @param token: the token the /stop route checks requests against, minted by serve() before the bind (str)
243
+ """
231
244
  # `token` is minted by serve() itself (before the bind) and
232
245
  # handed to this closure the same way `bound_port` is -- this
233
246
  # process never invents or reads it from anywhere else, so the
@@ -243,6 +256,11 @@ def cmd_map(args) -> int:
243
256
 
244
257
 
245
258
  def main(argv) -> int:
259
+ """Parse the command line and run cmd_map with it.
260
+
261
+ @param argv: the command-line arguments, excluding the program name (list of str)
262
+ @return: the process exit code (int)
263
+ """
246
264
  parser = build_parser()
247
265
  args = parser.parse_args(argv)
248
266
  return cmd_map(args)
@@ -325,7 +325,7 @@ KIND_READER_LANGS = {
325
325
  # "rb" joins this row the same way: langs.py's rb
326
326
  # LangSpec declares call_lane=True and edges.py builds Ruby its own
327
327
  # definer pool, landed independently of this stage.
328
- "calls": frozenset({"jsp", "java", "py", "js", "c", "rb", "cpp"}),
328
+ "calls": frozenset({"jsp", "java", "py", "js", "c", "rb", "cpp", "go"}),
329
329
  "reference/script": frozenset({"jsp"}),
330
330
  "route/mount": frozenset({"py", "js"}),
331
331
  "ui/component-use": frozenset({"js"}),
@@ -474,6 +474,21 @@ BLIND_SENTENCE_LANGS = (
474
474
  _GO),
475
475
  ("A Go import inside the declared module naming a directory with no "
476
476
  "Go file this scan reads", _GO),
477
+ # The Go CALL lane's held causes, each shipped only on a scan where its
478
+ # own cause occurred. They are separate rows because they are different
479
+ # admissions: the first says the callee is outside the repository, the
480
+ # second that the caller's own text does not say what type the receiver
481
+ # holds, the third that the name is a value the caller's own function
482
+ # bound, the fourth that no module line says which directory an import
483
+ # names, the fifth that a file stays in the lane although the go tool
484
+ # rejects its build constraint.
485
+ ("A Go call qualified by a package outside the declared module", _GO),
486
+ ("A Go call qualified by anything but an import its file binds", _GO),
487
+ ("A Go call to a name its own function binds", _GO),
488
+ ("A Go call qualified by an import, in a scan with no module directive",
489
+ _GO),
490
+ ("A Go call into or out of a file whose build constraint cannot be read",
491
+ _GO),
477
492
  # Ruby's own two STATIC, structural gaps (ambitgraph.symbols.
478
493
  # BLIND_SENTENCES), anchored on their opening words -- the same
479
494
  # shape as the C declaration grammar's own gaps just above.