align-agent 0.4.3__tar.gz → 0.4.4__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 (67) hide show
  1. {align_agent-0.4.3 → align_agent-0.4.4}/PKG-INFO +12 -11
  2. {align_agent-0.4.3 → align_agent-0.4.4}/README.md +11 -10
  3. {align_agent-0.4.3 → align_agent-0.4.4}/align_agent/__init__.py +1 -1
  4. {align_agent-0.4.3 → align_agent-0.4.4}/align_agent/cli.py +22 -1
  5. align_agent-0.4.4/align_agent/examples/teleport_control.json +10418 -0
  6. align_agent-0.4.4/align_agent/examples/teleport_diff.json +8586 -0
  7. {align_agent-0.4.3 → align_agent-0.4.4}/align_agent/writethrough/mcp_server.py +1 -1
  8. {align_agent-0.4.3 → align_agent-0.4.4}/align_agent.egg-info/PKG-INFO +12 -11
  9. {align_agent-0.4.3 → align_agent-0.4.4}/align_agent.egg-info/SOURCES.txt +2 -0
  10. {align_agent-0.4.3 → align_agent-0.4.4}/pyproject.toml +2 -1
  11. {align_agent-0.4.3 → align_agent-0.4.4}/LICENSE +0 -0
  12. {align_agent-0.4.3 → align_agent-0.4.4}/align_agent/_audit/common.py +0 -0
  13. {align_agent-0.4.3 → align_agent-0.4.4}/align_agent/_audit/deepswe.py +0 -0
  14. {align_agent-0.4.3 → align_agent-0.4.4}/align_agent/_audit/excerpts.py +0 -0
  15. {align_agent-0.4.3 → align_agent-0.4.4}/align_agent/_audit/extract.py +0 -0
  16. {align_agent-0.4.3 → align_agent-0.4.4}/align_agent/_audit/materialize.py +0 -0
  17. {align_agent-0.4.3 → align_agent-0.4.4}/align_agent/_audit/score.py +0 -0
  18. {align_agent-0.4.3 → align_agent-0.4.4}/align_agent/_audit/shellparse.py +0 -0
  19. {align_agent-0.4.3 → align_agent-0.4.4}/align_agent/_audit/tarsur.py +0 -0
  20. {align_agent-0.4.3 → align_agent-0.4.4}/align_agent/_vendor/src/__init__.py +0 -0
  21. {align_agent-0.4.3 → align_agent-0.4.4}/align_agent/_vendor/src/harness/__init__.py +0 -0
  22. {align_agent-0.4.3 → align_agent-0.4.4}/align_agent/_vendor/src/harness/arms.py +0 -0
  23. {align_agent-0.4.3 → align_agent-0.4.4}/align_agent/_vendor/src/harness/completion.py +0 -0
  24. {align_agent-0.4.3 → align_agent-0.4.4}/align_agent/_vendor/src/harness/dependency_notice.py +0 -0
  25. {align_agent-0.4.3 → align_agent-0.4.4}/align_agent/_vendor/src/harness/freshness_hook.py +0 -0
  26. {align_agent-0.4.3 → align_agent-0.4.4}/align_agent/_vendor/src/harness/lean.py +0 -0
  27. {align_agent-0.4.3 → align_agent-0.4.4}/align_agent/_vendor/src/harness/mini_real.py +0 -0
  28. {align_agent-0.4.3 → align_agent-0.4.4}/align_agent/_vendor/src/harness/miniswe_scaffold.py +0 -0
  29. {align_agent-0.4.3 → align_agent-0.4.4}/align_agent/_vendor/src/harness/tail_diff.py +0 -0
  30. {align_agent-0.4.3 → align_agent-0.4.4}/align_agent/_vendor/src/harness/viewport.py +0 -0
  31. {align_agent-0.4.3 → align_agent-0.4.4}/align_agent/_vendor/src/metrics/__init__.py +0 -0
  32. {align_agent-0.4.3 → align_agent-0.4.4}/align_agent/_vendor/src/metrics/coherence.py +0 -0
  33. {align_agent-0.4.3 → align_agent-0.4.4}/align_agent/_vendor/src/metrics/corruption_oracles.py +0 -0
  34. {align_agent-0.4.3 → align_agent-0.4.4}/align_agent/_vendor/src/metrics/replay.py +0 -0
  35. {align_agent-0.4.3 → align_agent-0.4.4}/align_agent/_vendor/src/metrics/statistics.py +0 -0
  36. {align_agent-0.4.3 → align_agent-0.4.4}/align_agent/_vendor/src/metrics/verification.py +0 -0
  37. {align_agent-0.4.3 → align_agent-0.4.4}/align_agent/_vendor/src/parsers/__init__.py +0 -0
  38. {align_agent-0.4.3 → align_agent-0.4.4}/align_agent/_vendor/src/parsers/base_parser.py +0 -0
  39. {align_agent-0.4.3 → align_agent-0.4.4}/align_agent/_vendor/src/parsers/file_events.py +0 -0
  40. {align_agent-0.4.3 → align_agent-0.4.4}/align_agent/_vendor/src/parsers/miniswe_parser.py +0 -0
  41. {align_agent-0.4.3 → align_agent-0.4.4}/align_agent/_vendor/src/parsers/openhands_parser.py +0 -0
  42. {align_agent-0.4.3 → align_agent-0.4.4}/align_agent/_vendor/src/parsers/sweagent_parser.py +0 -0
  43. {align_agent-0.4.3 → align_agent-0.4.4}/align_agent/_vendor/src/parsers/terminus_parser.py +0 -0
  44. {align_agent-0.4.3 → align_agent-0.4.4}/align_agent/core.py +0 -0
  45. {align_agent-0.4.3 → align_agent-0.4.4}/align_agent/run.py +0 -0
  46. {align_agent-0.4.3 → align_agent-0.4.4}/align_agent/sessions.py +0 -0
  47. {align_agent-0.4.3 → align_agent-0.4.4}/align_agent/writethrough/__init__.py +0 -0
  48. {align_agent-0.4.3 → align_agent-0.4.4}/align_agent/writethrough/_lib/__init__.py +0 -0
  49. {align_agent-0.4.3 → align_agent-0.4.4}/align_agent/writethrough/_lib/wt_src/__init__.py +0 -0
  50. {align_agent-0.4.3 → align_agent-0.4.4}/align_agent/writethrough/_lib/wt_src/harness/__init__.py +0 -0
  51. {align_agent-0.4.3 → align_agent-0.4.4}/align_agent/writethrough/_lib/wt_src/harness/dependency_notice.py +0 -0
  52. {align_agent-0.4.3 → align_agent-0.4.4}/align_agent/writethrough/_lib/wt_src/harness/lean.py +0 -0
  53. {align_agent-0.4.3 → align_agent-0.4.4}/align_agent/writethrough/_lib/wt_src/harness/tail_diff.py +0 -0
  54. {align_agent-0.4.3 → align_agent-0.4.4}/align_agent/writethrough/_lib/wt_src/harness/viewport.py +0 -0
  55. {align_agent-0.4.3 → align_agent-0.4.4}/align_agent/writethrough/_lib/wt_src/metrics/__init__.py +0 -0
  56. {align_agent-0.4.3 → align_agent-0.4.4}/align_agent/writethrough/_lib/wt_src/metrics/replay.py +0 -0
  57. {align_agent-0.4.3 → align_agent-0.4.4}/align_agent/writethrough/_lib/wt_src/parsers/__init__.py +0 -0
  58. {align_agent-0.4.3 → align_agent-0.4.4}/align_agent/writethrough/_lib/wt_src/parsers/file_events.py +0 -0
  59. {align_agent-0.4.3 → align_agent-0.4.4}/align_agent/writethrough/claude_code.py +0 -0
  60. {align_agent-0.4.3 → align_agent-0.4.4}/align_agent/writethrough/engine.py +0 -0
  61. {align_agent-0.4.3 → align_agent-0.4.4}/align_agent/writethrough/hooks.py +0 -0
  62. {align_agent-0.4.3 → align_agent-0.4.4}/align_agent/writethrough/protocol.py +0 -0
  63. {align_agent-0.4.3 → align_agent-0.4.4}/align_agent.egg-info/dependency_links.txt +0 -0
  64. {align_agent-0.4.3 → align_agent-0.4.4}/align_agent.egg-info/entry_points.txt +0 -0
  65. {align_agent-0.4.3 → align_agent-0.4.4}/align_agent.egg-info/requires.txt +0 -0
  66. {align_agent-0.4.3 → align_agent-0.4.4}/align_agent.egg-info/top_level.txt +0 -0
  67. {align_agent-0.4.3 → align_agent-0.4.4}/setup.cfg +0 -0
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: align-agent
3
- Version: 0.4.3
3
+ Version: 0.4.4
4
4
  Summary: Find edits a coding agent made against a stale view of a file, and keep agents' views current with a write-through hook (Claude Code, any hook system, any MCP client, mini-swe-agent)
5
5
  License: MIT License
6
6
 
@@ -51,11 +51,11 @@ engine uses only the standard library.
51
51
  ### 1. Install the commands
52
52
 
53
53
  ```bash
54
- pipx install git+https://github.com/VA24d/align-agent@v0.4.3 # recommended: its own environment, commands on PATH
54
+ pipx install align-agent # recommended: its own environment, commands on PATH
55
55
  # or, in a virtual environment:
56
- python3 -m venv ~/.align && ~/.align/bin/pip install git+https://github.com/VA24d/align-agent@v0.4.3
56
+ python3 -m venv ~/.align && ~/.align/bin/pip install align-agent
57
57
  export PATH="$HOME/.align/bin:$PATH" # add this line to ~/.zshrc or ~/.bashrc
58
- align-agent --version # prints: align-agent 0.4.3
58
+ align-agent --version # prints: align-agent 0.4.4
59
59
  ```
60
60
 
61
61
  If the shell says `command not found: align-agent`, the install folder is not on `PATH`: run
@@ -130,7 +130,7 @@ the command once and shows those lines. Nothing earlier in the conversation is r
130
130
  prompt cache is kept.
131
131
 
132
132
  ```bash
133
- pip install git+https://github.com/VA24d/align-agent@v0.4.3 # the write-through engine itself uses only the standard library
133
+ pip install align-agent # the write-through engine itself uses only the standard library
134
134
  ```
135
135
 
136
136
  | Agent | Set up |
@@ -151,21 +151,22 @@ deleted after each call, and sessions idle for 7 days are deleted (`ALIGN_KEEP_D
151
151
  ## Find stale edits in trajectories
152
152
 
153
153
  ```bash
154
- pip install git+https://github.com/VA24d/align-agent@v0.4.3
155
- align-agent analyze examples/teleport_control.json examples/teleport_diff.json
154
+ pip install align-agent
155
+ align-agent analyze --examples # the two example trajectories bundled with the package
156
+ align-agent examples # where they are, to open or copy
156
157
  ```
157
158
 
158
159
  Or, with nothing to install or build (image for amd64 and arm64, examples included):
159
160
 
160
161
  ```bash
161
- docker run --rm ghcr.io/va24d/align-agent:0.4.3 analyze /opt/align-agent/examples/teleport_control.json
162
- docker run --rm -v "$PWD:/work" ghcr.io/va24d/align-agent:0.4.3 analyze /work/my_trajectories/
162
+ docker run --rm ghcr.io/va24d/align-agent:0.4.4 analyze /opt/align-agent/examples/teleport_control.json
163
+ docker run --rm -v "$PWD:/work" ghcr.io/va24d/align-agent:0.4.4 analyze /work/my_trajectories/
163
164
  ```
164
165
 
165
166
  ## `align-agent analyze`
166
167
 
167
168
  ```
168
- align-agent analyze PATH [PATH ...] [--format F] [--cwd DIR] [--json OUT] [--quiet]
169
+ align-agent analyze [PATH ...] [--examples] [--format F] [--cwd DIR] [--json OUT] [--quiet] [-j N]
169
170
  ```
170
171
 
171
172
  Reads trajectory files, or directories of them. The format is detected:
@@ -206,7 +207,7 @@ align-agent run --repo DIR --task TEXT_OR_FILE --model NAME --base-url URL \
206
207
  [--arm control|viewport|diff|lean|dependency] [--image IMAGE] [--out trajectory.json]
207
208
  ```
208
209
 
209
- Needs the `[run]` extra: `pip install 'align-agent[run] @ git+https://github.com/VA24d/align-agent@v0.4.3'`. Runs mini-swe-agent 2.4.6 against any OpenAI-compatible endpoint. The API key is read from `$OPENAI_API_KEY`, or from the variable that `--api-key-env` names. After each command, the hook finds the files the command changed by content hash and appends one of these to that command's output:
210
+ Needs the `[run]` extra: `pip install 'align-agent[run]'`. Runs mini-swe-agent 2.4.6 against any OpenAI-compatible endpoint. The API key is read from `$OPENAI_API_KEY`, or from the variable that `--api-key-env` names. After each command, the hook finds the files the command changed by content hash and appends one of these to that command's output:
210
211
 
211
212
  - `viewport`: a numbered window around each change.
212
213
  - `diff`: the net diff since the agent last saw the file.
@@ -14,11 +14,11 @@ engine uses only the standard library.
14
14
  ### 1. Install the commands
15
15
 
16
16
  ```bash
17
- pipx install git+https://github.com/VA24d/align-agent@v0.4.3 # recommended: its own environment, commands on PATH
17
+ pipx install align-agent # recommended: its own environment, commands on PATH
18
18
  # or, in a virtual environment:
19
- python3 -m venv ~/.align && ~/.align/bin/pip install git+https://github.com/VA24d/align-agent@v0.4.3
19
+ python3 -m venv ~/.align && ~/.align/bin/pip install align-agent
20
20
  export PATH="$HOME/.align/bin:$PATH" # add this line to ~/.zshrc or ~/.bashrc
21
- align-agent --version # prints: align-agent 0.4.3
21
+ align-agent --version # prints: align-agent 0.4.4
22
22
  ```
23
23
 
24
24
  If the shell says `command not found: align-agent`, the install folder is not on `PATH`: run
@@ -93,7 +93,7 @@ the command once and shows those lines. Nothing earlier in the conversation is r
93
93
  prompt cache is kept.
94
94
 
95
95
  ```bash
96
- pip install git+https://github.com/VA24d/align-agent@v0.4.3 # the write-through engine itself uses only the standard library
96
+ pip install align-agent # the write-through engine itself uses only the standard library
97
97
  ```
98
98
 
99
99
  | Agent | Set up |
@@ -114,21 +114,22 @@ deleted after each call, and sessions idle for 7 days are deleted (`ALIGN_KEEP_D
114
114
  ## Find stale edits in trajectories
115
115
 
116
116
  ```bash
117
- pip install git+https://github.com/VA24d/align-agent@v0.4.3
118
- align-agent analyze examples/teleport_control.json examples/teleport_diff.json
117
+ pip install align-agent
118
+ align-agent analyze --examples # the two example trajectories bundled with the package
119
+ align-agent examples # where they are, to open or copy
119
120
  ```
120
121
 
121
122
  Or, with nothing to install or build (image for amd64 and arm64, examples included):
122
123
 
123
124
  ```bash
124
- docker run --rm ghcr.io/va24d/align-agent:0.4.3 analyze /opt/align-agent/examples/teleport_control.json
125
- docker run --rm -v "$PWD:/work" ghcr.io/va24d/align-agent:0.4.3 analyze /work/my_trajectories/
125
+ docker run --rm ghcr.io/va24d/align-agent:0.4.4 analyze /opt/align-agent/examples/teleport_control.json
126
+ docker run --rm -v "$PWD:/work" ghcr.io/va24d/align-agent:0.4.4 analyze /work/my_trajectories/
126
127
  ```
127
128
 
128
129
  ## `align-agent analyze`
129
130
 
130
131
  ```
131
- align-agent analyze PATH [PATH ...] [--format F] [--cwd DIR] [--json OUT] [--quiet]
132
+ align-agent analyze [PATH ...] [--examples] [--format F] [--cwd DIR] [--json OUT] [--quiet] [-j N]
132
133
  ```
133
134
 
134
135
  Reads trajectory files, or directories of them. The format is detected:
@@ -169,7 +170,7 @@ align-agent run --repo DIR --task TEXT_OR_FILE --model NAME --base-url URL \
169
170
  [--arm control|viewport|diff|lean|dependency] [--image IMAGE] [--out trajectory.json]
170
171
  ```
171
172
 
172
- Needs the `[run]` extra: `pip install 'align-agent[run] @ git+https://github.com/VA24d/align-agent@v0.4.3'`. Runs mini-swe-agent 2.4.6 against any OpenAI-compatible endpoint. The API key is read from `$OPENAI_API_KEY`, or from the variable that `--api-key-env` names. After each command, the hook finds the files the command changed by content hash and appends one of these to that command's output:
173
+ Needs the `[run]` extra: `pip install 'align-agent[run]'`. Runs mini-swe-agent 2.4.6 against any OpenAI-compatible endpoint. The API key is read from `$OPENAI_API_KEY`, or from the variable that `--api-key-env` names. After each command, the hook finds the files the command changed by content hash and appends one of these to that command's output:
173
174
 
174
175
  - `viewport`: a numbered window around each change.
175
176
  - `diff`: the net diff since the agent last saw the file.
@@ -8,4 +8,4 @@ held the view, how the view was delivered, and whether the edit went wrong
8
8
  because of it.
9
9
  """
10
10
 
11
- __version__ = "0.4.3"
11
+ __version__ = "0.4.4"
@@ -11,6 +11,13 @@ from . import __version__
11
11
  from .core import FORMATS, analyze, load, summarize
12
12
  from .run import add_parser as add_run
13
13
 
14
+ EXAMPLES = os.path.join(os.path.dirname(os.path.abspath(__file__)), "examples")
15
+
16
+
17
+ def example_files():
18
+ """The trajectories bundled with the package (two runs of one SWE-Bench Pro task)."""
19
+ return sorted(glob.glob(os.path.join(EXAMPLES, "*.json")))
20
+
14
21
 
15
22
  def _files(paths):
16
23
  for p in paths:
@@ -50,7 +57,18 @@ def _analyzed(args):
50
57
  yield from pool.imap(_one, jobs, chunksize=8)
51
58
 
52
59
 
60
+ def cmd_examples(args):
61
+ for f in example_files():
62
+ print(f)
63
+ return 0
64
+
65
+
53
66
  def cmd_analyze(args):
67
+ if args.examples:
68
+ args.paths = list(args.paths) + example_files()
69
+ if not args.paths:
70
+ print("align-agent analyze: give trajectory files or directories, or --examples", file=sys.stderr)
71
+ return 2
54
72
  results, skipped, t0 = [], [], time.time()
55
73
  for r, skip in _analyzed(args):
56
74
  if skip:
@@ -85,13 +103,16 @@ def main(argv=None):
85
103
  ap.add_argument("--version", action="version", version=f"align-agent {__version__}")
86
104
  sub = ap.add_subparsers(dest="cmd", required=True)
87
105
  a = sub.add_parser("analyze", help="find stale edits in trajectories")
88
- a.add_argument("paths", nargs="+", help="trajectory files or directories (searched for *.json and *.jsonl)")
106
+ a.add_argument("paths", nargs="*", help="trajectory files or directories (searched for *.json and *.jsonl)")
107
+ a.add_argument("--examples", action="store_true", help="also analyze the example trajectories bundled with the package")
89
108
  a.add_argument("--format", choices=sorted(FORMATS), help="skip format detection")
90
109
  a.add_argument("--cwd", help="the agent's working directory, for resolving relative paths")
91
110
  a.add_argument("--json", help="write per-edit results here")
92
111
  a.add_argument("--quiet", action="store_true", help="print the summary only")
93
112
  a.add_argument("-j", "--jobs", type=int, default=1, help="analyze this many files in parallel (default 1)")
94
113
  a.set_defaults(fn=cmd_analyze)
114
+ e = sub.add_parser("examples", help="print the paths of the bundled example trajectories")
115
+ e.set_defaults(fn=cmd_examples)
95
116
  add_run(sub)
96
117
  args = ap.parse_args(argv)
97
118
  return args.fn(args)