graphban-cli 0.1.0__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.
- graphban_cli-0.1.0/.gitignore +62 -0
- graphban_cli-0.1.0/LICENSE +201 -0
- graphban_cli-0.1.0/PKG-INFO +135 -0
- graphban_cli-0.1.0/README.md +120 -0
- graphban_cli-0.1.0/pyproject.toml +45 -0
- graphban_cli-0.1.0/src/gban/__init__.py +0 -0
- graphban_cli-0.1.0/src/gban/cli.py +379 -0
- graphban_cli-0.1.0/src/gban/client.py +154 -0
- graphban_cli-0.1.0/src/gban/config.py +102 -0
- graphban_cli-0.1.0/src/gban/doctor.py +196 -0
- graphban_cli-0.1.0/tests/test_acts.py +242 -0
- graphban_cli-0.1.0/tests/test_doctor.py +406 -0
- graphban_cli-0.1.0/tests/test_packaging.py +185 -0
- graphban_cli-0.1.0/tests/test_session.py +300 -0
|
@@ -0,0 +1,62 @@
|
|
|
1
|
+
# Python
|
|
2
|
+
__pycache__/
|
|
3
|
+
*.py[cod]
|
|
4
|
+
backend/.venv/
|
|
5
|
+
backend/*.db
|
|
6
|
+
backend/.pytest.db
|
|
7
|
+
# Bare too: pytest writes it to whatever directory it is invoked from, and a 0.7 MB
|
|
8
|
+
# SQLite file reached main from the repo ROOT, where the backend-scoped line above
|
|
9
|
+
# did not cover it (GRPH-428's branch, merged as #267). It fails
|
|
10
|
+
# `test_no_tracked_control_bytes` on main and therefore on every PR built against it.
|
|
11
|
+
.pytest.db
|
|
12
|
+
.pytest.db-journal
|
|
13
|
+
# The concurrency lock GRPH-554 added sits beside the database it guards, and xdist gives
|
|
14
|
+
# each worker its own — so the pattern has to cover `.pytest_gw3.db.lock` as well as the
|
|
15
|
+
# bare one. Untracked litter in `git status` is how a real change gets missed in the noise.
|
|
16
|
+
*.db.lock
|
|
17
|
+
# Same trap, same fix: scripts/docs_completeness.py opens a throwaway SQLite
|
|
18
|
+
# database in whatever directory it is run from (GRPH-475).
|
|
19
|
+
.docscheck.db
|
|
20
|
+
.docscheck.db-journal
|
|
21
|
+
backend/.pytest_cache/
|
|
22
|
+
# graphban-fleet is a separate distribution with its own venv (PRD-22 D-e). `uv` drops a
|
|
23
|
+
# self-ignoring .gitignore inside .venv/, but naming it here means the repo does not
|
|
24
|
+
# depend on that convenience holding.
|
|
25
|
+
fleet/.venv/
|
|
26
|
+
fleet/.pytest_cache/
|
|
27
|
+
*.egg-info/
|
|
28
|
+
|
|
29
|
+
# Node
|
|
30
|
+
web/node_modules/
|
|
31
|
+
web/dist/
|
|
32
|
+
web/.vite/
|
|
33
|
+
web/*.tsbuildinfo
|
|
34
|
+
|
|
35
|
+
# Env
|
|
36
|
+
.env
|
|
37
|
+
.env.local
|
|
38
|
+
|
|
39
|
+
# Drive sync target (runtime data / mounted volume)
|
|
40
|
+
sync/
|
|
41
|
+
|
|
42
|
+
# Compose apply helper socket dir (docker-compose default mount)
|
|
43
|
+
.graphban-apply/
|
|
44
|
+
|
|
45
|
+
# Packed native/GitHub release trees (scripts/graphban_release.py publish)
|
|
46
|
+
dist-release/
|
|
47
|
+
|
|
48
|
+
# OS / editor
|
|
49
|
+
.DS_Store
|
|
50
|
+
|
|
51
|
+
# Tooling
|
|
52
|
+
.serena/
|
|
53
|
+
|
|
54
|
+
# Cursor MCP config — holds a real API key; copy .cursor/mcp.json.example instead
|
|
55
|
+
.cursor/mcp.json
|
|
56
|
+
|
|
57
|
+
# Project MCP config — holds a real API key
|
|
58
|
+
.mcp.json
|
|
59
|
+
|
|
60
|
+
# Cursor claim manifest — per-session runtime state (see .cursor/hooks/README.md)
|
|
61
|
+
.cursor/graphban-claim.json
|
|
62
|
+
.cursor/agentledger-claim.json
|
|
@@ -0,0 +1,201 @@
|
|
|
1
|
+
Apache License
|
|
2
|
+
Version 2.0, January 2004
|
|
3
|
+
http://www.apache.org/licenses/
|
|
4
|
+
|
|
5
|
+
TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION
|
|
6
|
+
|
|
7
|
+
1. Definitions.
|
|
8
|
+
|
|
9
|
+
"License" shall mean the terms and conditions for use, reproduction,
|
|
10
|
+
and distribution as defined by Sections 1 through 9 of this document.
|
|
11
|
+
|
|
12
|
+
"Licensor" shall mean the copyright owner or entity authorized by
|
|
13
|
+
the copyright owner that is granting the License.
|
|
14
|
+
|
|
15
|
+
"Legal Entity" shall mean the union of the acting entity and all
|
|
16
|
+
other entities that control, are controlled by, or are under common
|
|
17
|
+
control with that entity. For the purposes of this definition,
|
|
18
|
+
"control" means (i) the power, direct or indirect, to cause the
|
|
19
|
+
direction or management of such entity, whether by contract or
|
|
20
|
+
otherwise, or (ii) ownership of fifty percent (50%) or more of the
|
|
21
|
+
outstanding shares, or (iii) beneficial ownership of such entity.
|
|
22
|
+
|
|
23
|
+
"You" (or "Your") shall mean an individual or Legal Entity
|
|
24
|
+
exercising permissions granted by this License.
|
|
25
|
+
|
|
26
|
+
"Source" form shall mean the preferred form for making modifications,
|
|
27
|
+
including but not limited to software source code, documentation
|
|
28
|
+
source, and configuration files.
|
|
29
|
+
|
|
30
|
+
"Object" form shall mean any form resulting from mechanical
|
|
31
|
+
transformation or translation of a Source form, including but
|
|
32
|
+
not limited to compiled object code, generated documentation,
|
|
33
|
+
and conversions to other media types.
|
|
34
|
+
|
|
35
|
+
"Work" shall mean the work of authorship, whether in Source or
|
|
36
|
+
Object form, made available under the License, as indicated by a
|
|
37
|
+
copyright notice that is included in or attached to the work
|
|
38
|
+
(an example is provided in the Appendix below).
|
|
39
|
+
|
|
40
|
+
"Derivative Works" shall mean any work, whether in Source or Object
|
|
41
|
+
form, that is based on (or derived from) the Work and for which the
|
|
42
|
+
editorial revisions, annotations, elaborations, or other modifications
|
|
43
|
+
represent, as a whole, an original work of authorship. For the purposes
|
|
44
|
+
of this License, Derivative Works shall not include works that remain
|
|
45
|
+
separable from, or merely link (or bind by name) to the interfaces of,
|
|
46
|
+
the Work and Derivative Works thereof.
|
|
47
|
+
|
|
48
|
+
"Contribution" shall mean any work of authorship, including
|
|
49
|
+
the original version of the Work and any modifications or additions
|
|
50
|
+
to that Work or Derivative Works thereof, that is intentionally
|
|
51
|
+
submitted to Licensor for inclusion in the Work by the copyright owner
|
|
52
|
+
or by an individual or Legal Entity authorized to submit on behalf of
|
|
53
|
+
the copyright owner. For the purposes of this definition, "submitted"
|
|
54
|
+
means any form of electronic, verbal, or written communication sent
|
|
55
|
+
to the Licensor or its representatives, including but not limited to
|
|
56
|
+
communication on electronic mailing lists, source code control systems,
|
|
57
|
+
and issue tracking systems that are managed by, or on behalf of, the
|
|
58
|
+
Licensor for the purpose of discussing and improving the Work, but
|
|
59
|
+
excluding communication that is conspicuously marked or otherwise
|
|
60
|
+
designated in writing by the copyright owner as "Not a Contribution."
|
|
61
|
+
|
|
62
|
+
"Contributor" shall mean Licensor and any individual or Legal Entity
|
|
63
|
+
on behalf of whom a Contribution has been received by Licensor and
|
|
64
|
+
subsequently incorporated within the Work.
|
|
65
|
+
|
|
66
|
+
2. Grant of Copyright License. Subject to the terms and conditions of
|
|
67
|
+
this License, each Contributor hereby grants to You a perpetual,
|
|
68
|
+
worldwide, non-exclusive, no-charge, royalty-free, irrevocable
|
|
69
|
+
copyright license to reproduce, prepare Derivative Works of,
|
|
70
|
+
publicly display, publicly perform, sublicense, and distribute the
|
|
71
|
+
Work and such Derivative Works in Source or Object form.
|
|
72
|
+
|
|
73
|
+
3. Grant of Patent License. Subject to the terms and conditions of
|
|
74
|
+
this License, each Contributor hereby grants to You a perpetual,
|
|
75
|
+
worldwide, non-exclusive, no-charge, royalty-free, irrevocable
|
|
76
|
+
(except as stated in this section) patent license to make, have made,
|
|
77
|
+
use, offer to sell, sell, import, and otherwise transfer the Work,
|
|
78
|
+
where such license applies only to those patent claims licensable
|
|
79
|
+
by such Contributor that are necessarily infringed by their
|
|
80
|
+
Contribution(s) alone or by combination of their Contribution(s)
|
|
81
|
+
with the Work to which such Contribution(s) was submitted. If You
|
|
82
|
+
institute patent litigation against any entity (including a
|
|
83
|
+
cross-claim or counterclaim in a lawsuit) alleging that the Work
|
|
84
|
+
or a Contribution incorporated within the Work constitutes direct
|
|
85
|
+
or contributory patent infringement, then any patent licenses
|
|
86
|
+
granted to You under this License for that Work shall terminate
|
|
87
|
+
as of the date such litigation is filed.
|
|
88
|
+
|
|
89
|
+
4. Redistribution. You may reproduce and distribute copies of the
|
|
90
|
+
Work or Derivative Works thereof in any medium, with or without
|
|
91
|
+
modifications, and in Source or Object form, provided that You
|
|
92
|
+
meet the following conditions:
|
|
93
|
+
|
|
94
|
+
(a) You must give any other recipients of the Work or
|
|
95
|
+
Derivative Works a copy of this License; and
|
|
96
|
+
|
|
97
|
+
(b) You must cause any modified files to carry prominent notices
|
|
98
|
+
stating that You changed the files; and
|
|
99
|
+
|
|
100
|
+
(c) You must retain, in the Source form of any Derivative Works
|
|
101
|
+
that You distribute, all copyright, patent, trademark, and
|
|
102
|
+
attribution notices from the Source form of the Work,
|
|
103
|
+
excluding those notices that do not pertain to any part of
|
|
104
|
+
the Derivative Works; and
|
|
105
|
+
|
|
106
|
+
(d) If the Work includes a "NOTICE" text file as part of its
|
|
107
|
+
distribution, then any Derivative Works that You distribute must
|
|
108
|
+
include a readable copy of the attribution notices contained
|
|
109
|
+
within such NOTICE file, excluding those notices that do not
|
|
110
|
+
pertain to any part of the Derivative Works, in at least one
|
|
111
|
+
of the following places: within a NOTICE text file distributed
|
|
112
|
+
as part of the Derivative Works; within the Source form or
|
|
113
|
+
documentation, if provided along with the Derivative Works; or,
|
|
114
|
+
within a display generated by the Derivative Works, if and
|
|
115
|
+
wherever such third-party notices normally appear. The contents
|
|
116
|
+
of the NOTICE file are for informational purposes only and
|
|
117
|
+
do not modify the License. You may add Your own attribution
|
|
118
|
+
notices within Derivative Works that You distribute, alongside
|
|
119
|
+
or as an addendum to the NOTICE text from the Work, provided
|
|
120
|
+
that such additional attribution notices cannot be construed
|
|
121
|
+
as modifying the License.
|
|
122
|
+
|
|
123
|
+
You may add Your own copyright statement to Your modifications and
|
|
124
|
+
may provide additional or different license terms and conditions
|
|
125
|
+
for use, reproduction, or distribution of Your modifications, or
|
|
126
|
+
for any such Derivative Works as a whole, provided Your use,
|
|
127
|
+
reproduction, and distribution of the Work otherwise complies with
|
|
128
|
+
the conditions stated in this License.
|
|
129
|
+
|
|
130
|
+
5. Submission of Contributions. Unless You explicitly state otherwise,
|
|
131
|
+
any Contribution intentionally submitted for inclusion in the Work
|
|
132
|
+
by You to the Licensor shall be under the terms and conditions of
|
|
133
|
+
this License, without any additional terms or conditions.
|
|
134
|
+
Notwithstanding the above, nothing herein shall supersede or modify
|
|
135
|
+
the terms of any separate license agreement you may have executed
|
|
136
|
+
with Licensor regarding such Contributions.
|
|
137
|
+
|
|
138
|
+
6. Trademarks. This License does not grant permission to use the trade
|
|
139
|
+
names, trademarks, service marks, or product names of the Licensor,
|
|
140
|
+
except as required for reasonable and customary use in describing the
|
|
141
|
+
origin of the Work and reproducing the content of the NOTICE file.
|
|
142
|
+
|
|
143
|
+
7. Disclaimer of Warranty. Unless required by applicable law or
|
|
144
|
+
agreed to in writing, Licensor provides the Work (and each
|
|
145
|
+
Contributor provides its Contributions) on an "AS IS" BASIS,
|
|
146
|
+
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
|
|
147
|
+
implied, including, without limitation, any warranties or conditions
|
|
148
|
+
of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A
|
|
149
|
+
PARTICULAR PURPOSE. You are solely responsible for determining the
|
|
150
|
+
appropriateness of using or redistributing the Work and assume any
|
|
151
|
+
risks associated with Your exercise of permissions under this License.
|
|
152
|
+
|
|
153
|
+
8. Limitation of Liability. In no event and under no legal theory,
|
|
154
|
+
whether in tort (including negligence), contract, or otherwise,
|
|
155
|
+
unless required by applicable law (such as deliberate and grossly
|
|
156
|
+
negligent acts) or agreed to in writing, shall any Contributor be
|
|
157
|
+
liable to You for damages, including any direct, indirect, special,
|
|
158
|
+
incidental, or consequential damages of any character arising as a
|
|
159
|
+
result of this License or out of the use or inability to use the
|
|
160
|
+
Work (including but not limited to damages for loss of goodwill,
|
|
161
|
+
work stoppage, computer failure or malfunction, or any and all
|
|
162
|
+
other commercial damages or losses), even if such Contributor
|
|
163
|
+
has been advised of the possibility of such damages.
|
|
164
|
+
|
|
165
|
+
9. Accepting Warranty or Additional Liability. While redistributing
|
|
166
|
+
the Work or Derivative Works thereof, You may choose to offer,
|
|
167
|
+
and charge a fee for, acceptance of support, warranty, indemnity,
|
|
168
|
+
or other liability obligations and/or rights consistent with this
|
|
169
|
+
License. However, in accepting such obligations, You may act only
|
|
170
|
+
on Your own behalf and on Your sole responsibility, not on behalf
|
|
171
|
+
of any other Contributor, and only if You agree to indemnify,
|
|
172
|
+
defend, and hold each Contributor harmless for any liability
|
|
173
|
+
incurred by, or claims asserted against, such Contributor by reason
|
|
174
|
+
of your accepting any such warranty or additional liability.
|
|
175
|
+
|
|
176
|
+
END OF TERMS AND CONDITIONS
|
|
177
|
+
|
|
178
|
+
APPENDIX: How to apply the Apache License to your work.
|
|
179
|
+
|
|
180
|
+
To apply the Apache License to your work, attach the following
|
|
181
|
+
boilerplate notice, with the fields enclosed by brackets "[]"
|
|
182
|
+
replaced with your own identifying information. (Don't include
|
|
183
|
+
the brackets!) The text should be enclosed in the appropriate
|
|
184
|
+
comment syntax for the file format. We also recommend that a
|
|
185
|
+
file or class name and description of purpose be included on the
|
|
186
|
+
same "printed page" as the copyright notice for easier
|
|
187
|
+
identification within third-party archives.
|
|
188
|
+
|
|
189
|
+
Copyright 2026 Ascme Labs
|
|
190
|
+
|
|
191
|
+
Licensed under the Apache License, Version 2.0 (the "License");
|
|
192
|
+
you may not use this file except in compliance with the License.
|
|
193
|
+
You may obtain a copy of the License at
|
|
194
|
+
|
|
195
|
+
http://www.apache.org/licenses/LICENSE-2.0
|
|
196
|
+
|
|
197
|
+
Unless required by applicable law or agreed to in writing, software
|
|
198
|
+
distributed under the License is distributed on an "AS IS" BASIS,
|
|
199
|
+
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
200
|
+
See the License for the specific language governing permissions and
|
|
201
|
+
limitations under the License.
|
|
@@ -0,0 +1,135 @@
|
|
|
1
|
+
Metadata-Version: 2.5
|
|
2
|
+
Name: graphban-cli
|
|
3
|
+
Version: 0.1.0
|
|
4
|
+
Summary: gban — a Graphban client for the human at a terminal
|
|
5
|
+
Project-URL: Homepage, https://github.com/asc-me/graphban
|
|
6
|
+
Project-URL: Repository, https://github.com/asc-me/graphban
|
|
7
|
+
Project-URL: Documentation, https://github.com/asc-me/graphban/blob/main/cli/README.md
|
|
8
|
+
License-Expression: Apache-2.0
|
|
9
|
+
License-File: LICENSE
|
|
10
|
+
Requires-Python: >=3.12
|
|
11
|
+
Provides-Extra: dev
|
|
12
|
+
Requires-Dist: pytest-cov>=5.0; extra == 'dev'
|
|
13
|
+
Requires-Dist: pytest>=8.0; extra == 'dev'
|
|
14
|
+
Description-Content-Type: text/markdown
|
|
15
|
+
|
|
16
|
+
# graphban-cli
|
|
17
|
+
|
|
18
|
+
**`gban`** — the client for a human at a terminal.
|
|
19
|
+
|
|
20
|
+
Five surfaces existed before this and none of them was for a person at a shell prompt:
|
|
21
|
+
`graphban` talks to the database from inside the container, `gbfleet` supervises processes,
|
|
22
|
+
`gbagent` is a spawned child, the web app is a browser, and `/api/mcp` is for agents. Issuing
|
|
23
|
+
a seat, seeing why an agent is stuck, or re-tasking one meant opening a browser.
|
|
24
|
+
|
|
25
|
+
Specified by [PRD-40](https://github.com/asc-me/graphban/blob/main/docs/prd-40-gb-cli.md).
|
|
26
|
+
|
|
27
|
+
## Install
|
|
28
|
+
|
|
29
|
+
Not on PyPI yet, so it installs from the repository. `uv tool install` puts it on your PATH
|
|
30
|
+
in its own environment, which is what you want for a CLI:
|
|
31
|
+
|
|
32
|
+
```bash
|
|
33
|
+
uv tool install "git+https://github.com/asc-me/graphban.git#subdirectory=cli"
|
|
34
|
+
```
|
|
35
|
+
|
|
36
|
+
Add `gbfleet` too if you run waves — it is a separate package, and `gban fleet` hands off to it:
|
|
37
|
+
|
|
38
|
+
```bash
|
|
39
|
+
uv tool install "git+https://github.com/asc-me/graphban.git#subdirectory=fleet"
|
|
40
|
+
```
|
|
41
|
+
|
|
42
|
+
`uv tool update-shell` once, if uv says the bin directory is not on your PATH. Upgrade either
|
|
43
|
+
with `uv tool upgrade graphban-cli` (or `--all`); reinstalling from the same URL also works,
|
|
44
|
+
since the spec is a branch rather than a pin.
|
|
45
|
+
|
|
46
|
+
With pip instead, into an environment you already have:
|
|
47
|
+
|
|
48
|
+
```bash
|
|
49
|
+
pip install "graphban-cli @ git+https://github.com/asc-me/graphban.git#subdirectory=cli"
|
|
50
|
+
```
|
|
51
|
+
|
|
52
|
+
`gban` pulls **nothing**: `client.py` is `urllib.request` throughout, and the install lands
|
|
53
|
+
exactly one distribution. `gbfleet` brings httpx and its four transitive dependencies, which
|
|
54
|
+
is why they are separate packages and not one.
|
|
55
|
+
|
|
56
|
+
```bash
|
|
57
|
+
gban login --server https://cloud.agentldgr.dev
|
|
58
|
+
gban doctor # both halves: the ledger, and the local fleet
|
|
59
|
+
gban agents # the roster, and why an agent is stuck
|
|
60
|
+
gban agents role SA-A4 planner # what used to need a browser
|
|
61
|
+
gban seats issue worker worker planner # one entry per agent
|
|
62
|
+
gban keys # which key is that agent on
|
|
63
|
+
gban fleet up --seats-file seats.txt --adapter claude # hands off to gbfleet
|
|
64
|
+
```
|
|
65
|
+
|
|
66
|
+
`seats issue` takes **one role per agent, repeats included**, because that is the server's
|
|
67
|
+
own shape: two agents on one seat share a session and cannot review each other. Each code is
|
|
68
|
+
printed once and written nowhere — a CLI that helpfully saved them would invent a second
|
|
69
|
+
credential at rest that no route and no test knows about.
|
|
70
|
+
|
|
71
|
+
`agents` prints what an agent was **last refused, and why**. That line is the reason the verb
|
|
72
|
+
exists: a roster saying "idle worker" for an agent being told no on every call it makes is
|
|
73
|
+
what made the Super-Arc diagnosis take a database query.
|
|
74
|
+
|
|
75
|
+
`agents role` re-tasks a live agent **within its credential's ceiling** and never past it. A
|
|
76
|
+
role the key does not permit is the server's refusal, printed in the server's own words;
|
|
77
|
+
widening a ceiling means minting a different credential, and keeping those two acts apart is
|
|
78
|
+
the point of having a ceiling. It lands on the agent's next poll.
|
|
79
|
+
|
|
80
|
+
## `gban login` wants a real terminal
|
|
81
|
+
|
|
82
|
+
It refuses without one, rather than prompting. `getpass` falls back to a plain **echoing**
|
|
83
|
+
read when it cannot turn echo off — it warns, but the warning arrives after the person has
|
|
84
|
+
decided to type — so a login through a pipe, a heredoc or an editor's command runner would
|
|
85
|
+
put the password in the scrollback. There is no non-interactive login yet (PRD-40 open
|
|
86
|
+
question 2: an API key cannot reach the JWT routes, so CI would need a service session).
|
|
87
|
+
|
|
88
|
+
## Why not `gb`
|
|
89
|
+
|
|
90
|
+
Because `gb` is already `git branch` on a large share of developer machines, and **an alias
|
|
91
|
+
beats a binary on `PATH`**. The deployed walk hit it on the very first command and got git's
|
|
92
|
+
usage text; nothing inside the process can detect that, because by the time `gb` would have
|
|
93
|
+
run, the alias did not.
|
|
94
|
+
|
|
95
|
+
It is not one alias but a whole namespace. oh-my-zsh's git plugin — which is where most of
|
|
96
|
+
these come from — defines sixteen `gb*` aliases and ten `grb*`, so `gb`, `gba`, `grb` and
|
|
97
|
+
`gbl` are all spoken for. `gban` is outside it, still short, and still says which product it
|
|
98
|
+
belongs to.
|
|
99
|
+
|
|
100
|
+
## Licence — Apache-2.0, deliberately not the repository's FSL-1.1
|
|
101
|
+
|
|
102
|
+
The repository is [FSL-1.1-Apache-2.0](https://github.com/asc-me/graphban/blob/main/LICENSE.md). This directory is
|
|
103
|
+
[Apache-2.0](https://github.com/asc-me/graphban/blob/main/cli/LICENSE), for the reasons PRD-22 §8 gives for `fleet/` — every one of which
|
|
104
|
+
applies here identically. `gban` is inert without a Graphban server and holds no authority of
|
|
105
|
+
its own, so FSL's Competing Use clause protects the server and protects nothing here. It is a
|
|
106
|
+
laptop-installed developer CLI, which is exactly the kind of dependency that has to clear a
|
|
107
|
+
corporate licence policy scanner.
|
|
108
|
+
|
|
109
|
+
## Why it is in this repository
|
|
110
|
+
|
|
111
|
+
**Not a second repository**, for the reason [`fleet/README.md`](https://github.com/asc-me/graphban/blob/main/fleet/README.md) gives for
|
|
112
|
+
the supervisor, with more force: the client↔server contract has no schema anywhere, and a
|
|
113
|
+
cross-repo break would present as absence reading clean — `gban` still runs, nothing errors, the
|
|
114
|
+
verb quietly stops meaning what it said. The evidence is recent and specific: `ROLES` lost
|
|
115
|
+
`reviewer` in one PR while another added a test naming it, and CI caught the pair inside
|
|
116
|
+
seventeen minutes because both lived in one repository. Split across two, that lands as a bug
|
|
117
|
+
report from somebody whose `gban agents role ... reviewer` started refusing.
|
|
118
|
+
|
|
119
|
+
**Not inside `backend/`**, because `graphban-api` pulls fastapi, sqlalchemy, pgvector, psycopg,
|
|
120
|
+
alembic, redis and cryptography, and this installs on a laptop. `tests/test_packaging.py`
|
|
121
|
+
derives its forbidden set from the backend's own dependency list rather than a denylist
|
|
122
|
+
somebody maintains.
|
|
123
|
+
|
|
124
|
+
## What it is not
|
|
125
|
+
|
|
126
|
+
It is **not a second web app**: no board, no PRD editor, no search. Every verb is either
|
|
127
|
+
something a human currently opens a browser for, or a diagnosis nothing else gives.
|
|
128
|
+
|
|
129
|
+
It is **not `graphban`**, which talks to the local database from inside the container and
|
|
130
|
+
stays exactly as it is. Mixing "against the DB in the container" and "over HTTP from a laptop"
|
|
131
|
+
into one command is an ambiguity that ends with somebody purging the wrong instance.
|
|
132
|
+
|
|
133
|
+
It **holds no state the server does not** and computes nothing the server computes. Every verb
|
|
134
|
+
is one endpoint, called once (PRD-40 D11); an ordering between two calls would be a rule, and
|
|
135
|
+
a rule in the client is a second definition of something the server already enforces.
|
|
@@ -0,0 +1,120 @@
|
|
|
1
|
+
# graphban-cli
|
|
2
|
+
|
|
3
|
+
**`gban`** — the client for a human at a terminal.
|
|
4
|
+
|
|
5
|
+
Five surfaces existed before this and none of them was for a person at a shell prompt:
|
|
6
|
+
`graphban` talks to the database from inside the container, `gbfleet` supervises processes,
|
|
7
|
+
`gbagent` is a spawned child, the web app is a browser, and `/api/mcp` is for agents. Issuing
|
|
8
|
+
a seat, seeing why an agent is stuck, or re-tasking one meant opening a browser.
|
|
9
|
+
|
|
10
|
+
Specified by [PRD-40](https://github.com/asc-me/graphban/blob/main/docs/prd-40-gb-cli.md).
|
|
11
|
+
|
|
12
|
+
## Install
|
|
13
|
+
|
|
14
|
+
Not on PyPI yet, so it installs from the repository. `uv tool install` puts it on your PATH
|
|
15
|
+
in its own environment, which is what you want for a CLI:
|
|
16
|
+
|
|
17
|
+
```bash
|
|
18
|
+
uv tool install "git+https://github.com/asc-me/graphban.git#subdirectory=cli"
|
|
19
|
+
```
|
|
20
|
+
|
|
21
|
+
Add `gbfleet` too if you run waves — it is a separate package, and `gban fleet` hands off to it:
|
|
22
|
+
|
|
23
|
+
```bash
|
|
24
|
+
uv tool install "git+https://github.com/asc-me/graphban.git#subdirectory=fleet"
|
|
25
|
+
```
|
|
26
|
+
|
|
27
|
+
`uv tool update-shell` once, if uv says the bin directory is not on your PATH. Upgrade either
|
|
28
|
+
with `uv tool upgrade graphban-cli` (or `--all`); reinstalling from the same URL also works,
|
|
29
|
+
since the spec is a branch rather than a pin.
|
|
30
|
+
|
|
31
|
+
With pip instead, into an environment you already have:
|
|
32
|
+
|
|
33
|
+
```bash
|
|
34
|
+
pip install "graphban-cli @ git+https://github.com/asc-me/graphban.git#subdirectory=cli"
|
|
35
|
+
```
|
|
36
|
+
|
|
37
|
+
`gban` pulls **nothing**: `client.py` is `urllib.request` throughout, and the install lands
|
|
38
|
+
exactly one distribution. `gbfleet` brings httpx and its four transitive dependencies, which
|
|
39
|
+
is why they are separate packages and not one.
|
|
40
|
+
|
|
41
|
+
```bash
|
|
42
|
+
gban login --server https://cloud.agentldgr.dev
|
|
43
|
+
gban doctor # both halves: the ledger, and the local fleet
|
|
44
|
+
gban agents # the roster, and why an agent is stuck
|
|
45
|
+
gban agents role SA-A4 planner # what used to need a browser
|
|
46
|
+
gban seats issue worker worker planner # one entry per agent
|
|
47
|
+
gban keys # which key is that agent on
|
|
48
|
+
gban fleet up --seats-file seats.txt --adapter claude # hands off to gbfleet
|
|
49
|
+
```
|
|
50
|
+
|
|
51
|
+
`seats issue` takes **one role per agent, repeats included**, because that is the server's
|
|
52
|
+
own shape: two agents on one seat share a session and cannot review each other. Each code is
|
|
53
|
+
printed once and written nowhere — a CLI that helpfully saved them would invent a second
|
|
54
|
+
credential at rest that no route and no test knows about.
|
|
55
|
+
|
|
56
|
+
`agents` prints what an agent was **last refused, and why**. That line is the reason the verb
|
|
57
|
+
exists: a roster saying "idle worker" for an agent being told no on every call it makes is
|
|
58
|
+
what made the Super-Arc diagnosis take a database query.
|
|
59
|
+
|
|
60
|
+
`agents role` re-tasks a live agent **within its credential's ceiling** and never past it. A
|
|
61
|
+
role the key does not permit is the server's refusal, printed in the server's own words;
|
|
62
|
+
widening a ceiling means minting a different credential, and keeping those two acts apart is
|
|
63
|
+
the point of having a ceiling. It lands on the agent's next poll.
|
|
64
|
+
|
|
65
|
+
## `gban login` wants a real terminal
|
|
66
|
+
|
|
67
|
+
It refuses without one, rather than prompting. `getpass` falls back to a plain **echoing**
|
|
68
|
+
read when it cannot turn echo off — it warns, but the warning arrives after the person has
|
|
69
|
+
decided to type — so a login through a pipe, a heredoc or an editor's command runner would
|
|
70
|
+
put the password in the scrollback. There is no non-interactive login yet (PRD-40 open
|
|
71
|
+
question 2: an API key cannot reach the JWT routes, so CI would need a service session).
|
|
72
|
+
|
|
73
|
+
## Why not `gb`
|
|
74
|
+
|
|
75
|
+
Because `gb` is already `git branch` on a large share of developer machines, and **an alias
|
|
76
|
+
beats a binary on `PATH`**. The deployed walk hit it on the very first command and got git's
|
|
77
|
+
usage text; nothing inside the process can detect that, because by the time `gb` would have
|
|
78
|
+
run, the alias did not.
|
|
79
|
+
|
|
80
|
+
It is not one alias but a whole namespace. oh-my-zsh's git plugin — which is where most of
|
|
81
|
+
these come from — defines sixteen `gb*` aliases and ten `grb*`, so `gb`, `gba`, `grb` and
|
|
82
|
+
`gbl` are all spoken for. `gban` is outside it, still short, and still says which product it
|
|
83
|
+
belongs to.
|
|
84
|
+
|
|
85
|
+
## Licence — Apache-2.0, deliberately not the repository's FSL-1.1
|
|
86
|
+
|
|
87
|
+
The repository is [FSL-1.1-Apache-2.0](https://github.com/asc-me/graphban/blob/main/LICENSE.md). This directory is
|
|
88
|
+
[Apache-2.0](https://github.com/asc-me/graphban/blob/main/cli/LICENSE), for the reasons PRD-22 §8 gives for `fleet/` — every one of which
|
|
89
|
+
applies here identically. `gban` is inert without a Graphban server and holds no authority of
|
|
90
|
+
its own, so FSL's Competing Use clause protects the server and protects nothing here. It is a
|
|
91
|
+
laptop-installed developer CLI, which is exactly the kind of dependency that has to clear a
|
|
92
|
+
corporate licence policy scanner.
|
|
93
|
+
|
|
94
|
+
## Why it is in this repository
|
|
95
|
+
|
|
96
|
+
**Not a second repository**, for the reason [`fleet/README.md`](https://github.com/asc-me/graphban/blob/main/fleet/README.md) gives for
|
|
97
|
+
the supervisor, with more force: the client↔server contract has no schema anywhere, and a
|
|
98
|
+
cross-repo break would present as absence reading clean — `gban` still runs, nothing errors, the
|
|
99
|
+
verb quietly stops meaning what it said. The evidence is recent and specific: `ROLES` lost
|
|
100
|
+
`reviewer` in one PR while another added a test naming it, and CI caught the pair inside
|
|
101
|
+
seventeen minutes because both lived in one repository. Split across two, that lands as a bug
|
|
102
|
+
report from somebody whose `gban agents role ... reviewer` started refusing.
|
|
103
|
+
|
|
104
|
+
**Not inside `backend/`**, because `graphban-api` pulls fastapi, sqlalchemy, pgvector, psycopg,
|
|
105
|
+
alembic, redis and cryptography, and this installs on a laptop. `tests/test_packaging.py`
|
|
106
|
+
derives its forbidden set from the backend's own dependency list rather than a denylist
|
|
107
|
+
somebody maintains.
|
|
108
|
+
|
|
109
|
+
## What it is not
|
|
110
|
+
|
|
111
|
+
It is **not a second web app**: no board, no PRD editor, no search. Every verb is either
|
|
112
|
+
something a human currently opens a browser for, or a diagnosis nothing else gives.
|
|
113
|
+
|
|
114
|
+
It is **not `graphban`**, which talks to the local database from inside the container and
|
|
115
|
+
stays exactly as it is. Mixing "against the DB in the container" and "over HTTP from a laptop"
|
|
116
|
+
into one command is an ambiguity that ends with somebody purging the wrong instance.
|
|
117
|
+
|
|
118
|
+
It **holds no state the server does not** and computes nothing the server computes. Every verb
|
|
119
|
+
is one endpoint, called once (PRD-40 D11); an ordering between two calls would be a rule, and
|
|
120
|
+
a rule in the client is a second definition of something the server already enforces.
|
|
@@ -0,0 +1,45 @@
|
|
|
1
|
+
[project]
|
|
2
|
+
name = "graphban-cli"
|
|
3
|
+
version = "0.1.0"
|
|
4
|
+
description = "gban — a Graphban client for the human at a terminal"
|
|
5
|
+
readme = "README.md"
|
|
6
|
+
requires-python = ">=3.12"
|
|
7
|
+
# Apache-2.0, deliberately not the repository's FSL-1.1, for the reasons PRD-22 §8 gives for
|
|
8
|
+
# `fleet/` — every one of which applies here identically. `gban` is inert without a Graphban
|
|
9
|
+
# server and holds no authority of its own, so FSL's Competing Use clause protects the server
|
|
10
|
+
# and protects nothing in this directory. It is also a laptop-installed developer CLI, which
|
|
11
|
+
# is precisely the kind of dependency that has to clear a corporate licence policy scanner.
|
|
12
|
+
license = "Apache-2.0"
|
|
13
|
+
license-files = ["LICENSE"]
|
|
14
|
+
|
|
15
|
+
# PRD-40 D1/D2: HTTP-only, and that is a REQUIREMENT rather than a preference. `graphban-api`
|
|
16
|
+
# pulls fastapi, sqlalchemy, pgvector, psycopg, alembic, redis and cryptography, and this
|
|
17
|
+
# installs on a laptop. `tests/test_packaging.py` derives the forbidden set from the backend's
|
|
18
|
+
# own list, the way `fleet/` already does, because the only thing keeping a dependency list
|
|
19
|
+
# thin is something that objects when it is not.
|
|
20
|
+
dependencies = [] # stdlib only: client.py is urllib.request throughout (GRPH-782)
|
|
21
|
+
|
|
22
|
+
[project.urls]
|
|
23
|
+
# So the PyPI page links back. Without these it is a name, a summary and nothing to check.
|
|
24
|
+
Homepage = "https://github.com/asc-me/graphban"
|
|
25
|
+
Repository = "https://github.com/asc-me/graphban"
|
|
26
|
+
Documentation = "https://github.com/asc-me/graphban/blob/main/cli/README.md"
|
|
27
|
+
|
|
28
|
+
[project.scripts]
|
|
29
|
+
# `graphban` and `agentledger` are claimed by backend/, `gbfleet` and `gbagent` by fleet/.
|
|
30
|
+
# `gban` is short because it is the one a person types constantly.
|
|
31
|
+
gban = "gban.cli:main"
|
|
32
|
+
|
|
33
|
+
[project.optional-dependencies]
|
|
34
|
+
dev = ["pytest>=8.0", "pytest-cov>=5.0"]
|
|
35
|
+
|
|
36
|
+
[build-system]
|
|
37
|
+
requires = ["hatchling"]
|
|
38
|
+
build-backend = "hatchling.build"
|
|
39
|
+
|
|
40
|
+
[tool.hatch.build.targets.wheel]
|
|
41
|
+
packages = ["src/gban"]
|
|
42
|
+
|
|
43
|
+
[tool.pytest.ini_options]
|
|
44
|
+
testpaths = ["tests"]
|
|
45
|
+
pythonpath = ["src", "tests"]
|
|
File without changes
|