agentic-devtools 0.2.656__py3-none-any.whl → 0.2.658__py3-none-any.whl

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.
@@ -18,7 +18,7 @@ version_tuple: tuple[int | str, ...]
18
18
  commit_id: str | None
19
19
  __commit_id__: str | None
20
20
 
21
- __version__ = version = '0.2.656'
22
- __version_tuple__ = version_tuple = (0, 2, 656)
21
+ __version__ = version = '0.2.658'
22
+ __version_tuple__ = version_tuple = (0, 2, 658)
23
23
 
24
24
  __commit_id__ = commit_id = None
@@ -51,6 +51,12 @@ class DispatcherWakeStore:
51
51
 
52
52
  def __init__(self, provider: CIPlatformProvider) -> None:
53
53
  self.provider = provider
54
+ self._last_refusal: str | None = None
55
+
56
+ @property
57
+ def last_refusal(self) -> str | None:
58
+ """Return the last mutation's refusal reason, or None after success."""
59
+ return self._last_refusal
54
60
 
55
61
  @staticmethod
56
62
  def _timestamp(value: Any) -> float:
@@ -131,10 +137,12 @@ class DispatcherWakeStore:
131
137
 
132
138
  def enqueue(self, pr_number: int, head_sha: str, event: str, resume_at: float, now: float | None = None) -> bool:
133
139
  """Persist a deduplicated intent without shortening an existing deadline."""
140
+ self._last_refusal = None
134
141
  current = self._timestamp(time.time() if now is None else now)
135
142
  deadline = self._timestamp(resume_at)
136
143
  key = self._key(pr_number, head_sha, event)
137
144
  if deadline >= current + self.TTL_SECONDS:
145
+ self._last_refusal = "deadline-beyond-ttl"
138
146
  return False
139
147
  entry = {
140
148
  "version": 1,
@@ -147,25 +155,32 @@ class DispatcherWakeStore:
147
155
  "expires_at": current + self.TTL_SECONDS,
148
156
  "status": "pending",
149
157
  }
150
- return self._valid(key, entry) and self._update(key, entry, None, current)
158
+ if not self._valid(key, entry):
159
+ self._last_refusal = "invalid-entry"
160
+ return False
161
+ return self._update(key, entry, None, current)
151
162
 
152
163
  def acknowledge(self, key: str, expected_entry: dict, now: float | None = None) -> bool:
153
164
  """Retain a delivered tombstone only if the pending snapshot still matches."""
165
+ self._last_refusal = None
154
166
  current = self._timestamp(time.time() if now is None else now)
155
167
  return self._change(key, expected_entry, None, current)
156
168
 
157
169
  def postpone(self, key: str, expected_entry: dict, resume_at: float, now: float | None = None) -> bool:
158
170
  """Monotonically postpone a matching pending snapshot, within its original TTL."""
171
+ self._last_refusal = None
159
172
  current = self._timestamp(time.time() if now is None else now)
160
173
  return self._change(key, expected_entry, self._timestamp(resume_at), current)
161
174
 
162
175
  def _change(self, key: str, expected: dict, deadline: float | None, current: float) -> bool:
163
176
  if not self._valid(key, expected) or expected["status"] != "pending" or expected["expires_at"] <= current:
177
+ self._last_refusal = "invalid-entry"
164
178
  return False
165
179
  desired = dict(expected)
166
180
  if deadline is None:
167
181
  desired["status"] = "delivered"
168
182
  elif deadline >= expected["expires_at"]:
183
+ self._last_refusal = "deadline-beyond-expiry"
169
184
  return False
170
185
  else:
171
186
  desired["resume_at"] = max(deadline, expected["resume_at"])
@@ -175,35 +190,48 @@ class DispatcherWakeStore:
175
190
  known: dict[str, Any] = {}
176
191
  with _WRITE_LOCK:
177
192
  for attempt in range(3):
193
+ cause = None
194
+ stage = "read"
178
195
  try:
179
196
  observed = self._read()
180
197
  observed_records = self._prepare(observed, current)
181
198
  actual = observed_records.get(key)
182
199
  if expected is not None and actual != expected and (attempt == 0 or actual != desired):
200
+ self._last_refusal = "snapshot-mismatch"
183
201
  return False
184
202
  known = _merge_payloads(known, observed)
185
203
  records = self._prepare(known, current)
186
204
  previous = records.get(key)
187
205
  if expected is None and previous is not None:
188
206
  if not self._valid(key, previous):
207
+ self._last_refusal = "invalid-existing"
189
208
  return False
190
209
  desired = dict(previous, resume_at=max(previous["resume_at"], desired["resume_at"]))
191
210
  if desired["resume_at"] >= desired["expires_at"]:
211
+ self._last_refusal = "deadline-beyond-expiry"
192
212
  return False
193
213
  if len(records) > self.MAX_ENTRIES or (previous is None and len(records) >= self.MAX_ENTRIES):
214
+ self._last_refusal = "entry-capacity"
194
215
  return False
195
216
  records[key] = desired
196
217
  encoded = json.dumps(known, separators=(",", ":"), sort_keys=True)
197
218
  if len(encoded.encode()) > self.MAX_BYTES:
219
+ self._last_refusal = "byte-capacity"
198
220
  return False
221
+ stage = "write"
199
222
  self.provider.set_variable(COOLDOWN_VARIABLE, encoded)
223
+ stage = "verify-read"
200
224
  verified = self._read()
201
225
  verified_records = self._prepare(verified, current)
202
226
  combined = _merge_payloads(known, verified)
203
227
  target: Any = verified_records.get(key)
204
228
  if combined == verified and self._valid(key, target) and (expected is None or target == desired):
229
+ self._last_refusal = None
205
230
  return True
206
231
  known = combined
232
+ cause = "verification-failed"
207
233
  except Exception as exc:
234
+ cause = f"{stage}-error:{type(exc).__name__}"
208
235
  logger.warning("Could not persist dispatcher wake; retrying: %s", type(exc).__name__)
236
+ self._last_refusal = cause
209
237
  return False
@@ -97,8 +97,12 @@ class DispatcherWakeup:
97
97
  paused = _provider_cooldown(provider, datetime.fromtimestamp(now, UTC))
98
98
  if paused is not None:
99
99
  number, sha, event = self._current_wake_identity()
100
- if not DispatcherWakeStore(provider).enqueue(number, sha, event, paused[1].resume_at, now=now):
101
- raise RuntimeError("Dispatcher wake was not preserved; the scheduler wake-up was not handled")
100
+ store = DispatcherWakeStore(provider)
101
+ if not store.enqueue(number, sha, event, paused[1].resume_at, now=now):
102
+ raise RuntimeError(
103
+ "Dispatcher wake was not preserved; the scheduler wake-up was not handled "
104
+ f"(reason: {store.last_refusal})"
105
+ )
102
106
  with open(output_path, "a", encoding="utf-8") as output:
103
107
  output.write("throttled=true\n")
104
108
  print(
@@ -122,8 +126,12 @@ class DispatcherWakeup:
122
126
  paused = _provider_cooldown(provider, datetime.fromtimestamp(now, UTC))
123
127
  if paused is not None:
124
128
  number, sha, event = self._current_wake_identity()
125
- if not DispatcherWakeStore(provider).enqueue(number, sha, event, paused[1].resume_at, now=now):
126
- raise RuntimeError("Dispatcher wake was not preserved; the scheduler wake-up was not handled")
129
+ store = DispatcherWakeStore(provider)
130
+ if not store.enqueue(number, sha, event, paused[1].resume_at, now=now):
131
+ raise RuntimeError(
132
+ "Dispatcher wake was not preserved; the scheduler wake-up was not handled "
133
+ f"(reason: {store.last_refusal})"
134
+ )
127
135
  print(
128
136
  f"::notice::Dispatcher wake deferred by provider cooldown for PR {number} head {sha} event {event}."
129
137
  )
@@ -200,8 +208,12 @@ class DispatcherWakeup:
200
208
  except Exception as exc:
201
209
  shared_persisted = False
202
210
  print(f"::warning::Shared provider cooldown persistence failed ({type(exc).__name__}).")
203
- if not DispatcherWakeStore(provider).enqueue(number, sha, event, resume_at, now=now):
204
- raise RuntimeError("Dispatcher wake was not preserved; the scheduler wake-up was not handled") from error
211
+ store = DispatcherWakeStore(provider)
212
+ if not store.enqueue(number, sha, event, resume_at, now=now):
213
+ raise RuntimeError(
214
+ "Dispatcher wake was not preserved; the scheduler wake-up was not handled "
215
+ f"(reason: {store.last_refusal})"
216
+ ) from error
205
217
  if not shared_persisted:
206
218
  print(
207
219
  "::warning::Shared provider cooldown persistence is unconfirmed or shorter than the resolved deadline; "
@@ -0,0 +1,43 @@
1
+ """Stateless Markdown fence-line candidate classification."""
2
+
3
+ from dataclasses import dataclass
4
+
5
+
6
+ @dataclass(frozen=True)
7
+ class FenceLineCandidate:
8
+ """Syntax facts about one candidate fence delimiter line."""
9
+
10
+ line_number: int
11
+ marker: str
12
+ run_length: int
13
+ can_open: bool
14
+ can_close: bool
15
+
16
+
17
+ def classify_fence_line(line: str, line_number: int) -> FenceLineCandidate | None:
18
+ """Classify one physical line without tracking Markdown fence state."""
19
+ if line_number <= 0:
20
+ raise ValueError("line_number must be positive")
21
+
22
+ marker_start = 0
23
+ while marker_start < len(line) and marker_start < 3 and line[marker_start] == " ":
24
+ marker_start += 1
25
+ if marker_start == len(line) or line[marker_start] not in ("`", "~"):
26
+ return None
27
+
28
+ marker = line[marker_start]
29
+ run_end = marker_start
30
+ while run_end < len(line) and line[run_end] == marker:
31
+ run_end += 1
32
+ run_length = run_end - marker_start
33
+ if run_length < 3:
34
+ return None
35
+
36
+ info = line[run_end:]
37
+ return FenceLineCandidate(
38
+ line_number=line_number,
39
+ marker=marker,
40
+ run_length=run_length,
41
+ can_open=marker != "`" or "`" not in info,
42
+ can_close=not info.strip(),
43
+ )
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.5
2
2
  Name: agentic-devtools
3
- Version: 0.2.656
3
+ Version: 0.2.658
4
4
  Summary: Agentic devtools integrate Jira, DevOps & more
5
5
  Author: ayaiayorg
6
6
  License-Expression: MIT
@@ -1,5 +1,5 @@
1
1
  agentic_devtools/__init__.py,sha256=gvLzsZ6L3Abr4sPHr4OJ_rdZDD8cFzXacaV0LGs8dVc,539
2
- agentic_devtools/_version.py,sha256=jnIQpoO33KBqGyMUZBpGXojzzc89HmiPYgP1kAtgmfE,524
2
+ agentic_devtools/_version.py,sha256=3PTwYSBtjUUBMot6qEbt5CTj--vDfwXvHaEYaecya4k,524
3
3
  agentic_devtools/agdt_gitignore.py,sha256=vVVqTjBZ_ijn6U3Lnh_JGrARLschYVN-fFal9jDk0Ak,2694
4
4
  agentic_devtools/background_tasks.py,sha256=sFgmqOnCdCjclABJ8V__yDwBXDyi45b1Z-MVv3G2zB8,17664
5
5
  agentic_devtools/config.py,sha256=DEVxTVZhsQbVQwO9qdB_1h19aBpjMzF6xJY_ePYLGLs,15629
@@ -258,8 +258,8 @@ agentic_devtools/cli/ci/dispatch_state_codec.py,sha256=VELG4U_JzaSm9u4_JNHHkGJMg
258
258
  agentic_devtools/cli/ci/dispatcher_policy.py,sha256=ZE5Wc1uBL_or9sF9Sd1K1On7j_3Pw6CUUvhj9Hi80aw,7105
259
259
  agentic_devtools/cli/ci/dispatcher_throttle.py,sha256=q7x2xqHZzCpGtvxcWUPhQXXHhceu2XpoVzZnCr9eeXU,10113
260
260
  agentic_devtools/cli/ci/dispatcher_wake_replay.py,sha256=TSmyRXa7Itj29Rxbl7z6sIx5E7IPfra0VBE7w4RlMBU,18031
261
- agentic_devtools/cli/ci/dispatcher_wake_store.py,sha256=cV0UWO3SPdmsOll2Vl66RqLgaE3KJuUNzIF6thCG6Go,9713
262
- agentic_devtools/cli/ci/dispatcher_wakeup.py,sha256=ypdnMatom0XxDpTnt33CAjsB-XUOXpDgRquIQkMFNCs,12627
261
+ agentic_devtools/cli/ci/dispatcher_wake_store.py,sha256=Ls6BKN67LGvoFVzIQAYA9G54HzqtSoEfqE8qTIRwgVs,10949
262
+ agentic_devtools/cli/ci/dispatcher_wakeup.py,sha256=6toDxOoGuT-bH1aXtjg6YAdJvGYZklv7wtupVbUEkmk,13016
263
263
  agentic_devtools/cli/ci/due_probe_wakeup.py,sha256=4Tie-_cSFlYlkb6o3kJUZt9RaIiROBd5Crm5QAqSxfY,13494
264
264
  agentic_devtools/cli/ci/exceptions.py,sha256=zpKWOgnBbHHQgAQRvdRW4VFnE_qdgqgmo8r1H-x47l4,1086
265
265
  agentic_devtools/cli/ci/finalization_state.py,sha256=jQm_cH0J09LCZfEUdZK2XQNZFhF7KhyilKcGZ4g8Wzc,8978
@@ -344,6 +344,7 @@ agentic_devtools/cli/ci/pipeline/exclusion.py,sha256=mrOG5G1-m3U-GM4YgtMTuzmoj02
344
344
  agentic_devtools/cli/ci/pipeline/gate_verdict.py,sha256=-vbp24Kr172wXpB5T-y9lm-7JxiYurixEu3-nuZohgY,44352
345
345
  agentic_devtools/cli/ci/pipeline/lifecycle_reconciliation_support.py,sha256=R15VC18-xSUEMoTtI8y9z5xYIFLWloWXAvnDPSSPtvM,2405
346
346
  agentic_devtools/cli/ci/pipeline/markdown_comments.py,sha256=nNGHpAWwLtXbe8Vg4cmZSziXJ-FD_Fcv8todJvBGfY8,929
347
+ agentic_devtools/cli/ci/pipeline/markdown_fences.py,sha256=pJgoDLfodIqrtm167fWckShLLNW-mCfatbn_5BLoQoc,1244
347
348
  agentic_devtools/cli/ci/pipeline/models.py,sha256=jKuSunZ8FDsVFbIUwLkMVZdfVun9bc_SKvcxLW7s9Ls,4501
348
349
  agentic_devtools/cli/ci/pipeline/repair_attempts.py,sha256=K9JgsxIW0CjxfV6PMmZRKd6w7qsTYClZvzwFSu7shsA,11054
349
350
  agentic_devtools/cli/ci/pipeline/runner.py,sha256=0lXe0sr8GB9VWejOIHZimWy9GF_obRFn9agO-ugCWgM,76902
@@ -1345,8 +1346,8 @@ agentic_devtools/_bundled_skills/skills/speckit-plan/SKILL.md,sha256=qYLpzgLCIZ6
1345
1346
  agentic_devtools/_bundled_skills/skills/speckit-specify/SKILL.md,sha256=HbHRbdphMqbtNw6fL6NcYCj6sSFmUyk2S4U0bZ9p_l4,13681
1346
1347
  agentic_devtools/_bundled_skills/skills/write-github-commit-message/SKILL.md,sha256=Ep1lR8NDN117Iytj172VZgqazFiLpJ56Z7RXgaTnxR8,2626
1347
1348
  agentic_devtools/_bundled_skills/skills/write-github-commit-message/commit-types.md,sha256=bTy_t68ZD6R87rFIzq9wybTu8Wudoahb7nB9IWC4bFo,1839
1348
- agentic_devtools-0.2.656.dist-info/METADATA,sha256=lvvmgROcbnku9mgroCrf3wKymB7eNbFCFAwexMsUW9M,35594
1349
- agentic_devtools-0.2.656.dist-info/WHEEL,sha256=2iZrJkDIkeDh0k9SikKMqFuRP-ua6mb4Ir1AsER4BEw,87
1350
- agentic_devtools-0.2.656.dist-info/entry_points.txt,sha256=oHUiF-YvDtXSMTUh0E2bwYKGn4hZlIVbBRaQGSFXASc,13696
1351
- agentic_devtools-0.2.656.dist-info/licenses/LICENSE,sha256=yBEDdICksxhBYLWoERKp9MTqwGnUF6Ryj9BTLwXTc6k,1082
1352
- agentic_devtools-0.2.656.dist-info/RECORD,,
1349
+ agentic_devtools-0.2.658.dist-info/METADATA,sha256=tCheB1KISd3D5jG4tLrtATk1BEbVc0Mgxkt8usPX9wU,35594
1350
+ agentic_devtools-0.2.658.dist-info/WHEEL,sha256=2iZrJkDIkeDh0k9SikKMqFuRP-ua6mb4Ir1AsER4BEw,87
1351
+ agentic_devtools-0.2.658.dist-info/entry_points.txt,sha256=oHUiF-YvDtXSMTUh0E2bwYKGn4hZlIVbBRaQGSFXASc,13696
1352
+ agentic_devtools-0.2.658.dist-info/licenses/LICENSE,sha256=yBEDdICksxhBYLWoERKp9MTqwGnUF6Ryj9BTLwXTc6k,1082
1353
+ agentic_devtools-0.2.658.dist-info/RECORD,,