[Feat]: Add a task-state-invariants agent skill for sibling-surface propagation

Ouverte
#1,413 3 commentaires 0 réactions 1 personne assignée Voir sur GitHub

Les mainteneurs répondent en général sous 2 jours

@Linux2010 y travaille déjà.

Depuis le 2/11/2026.

  • #1414 par @Linux2010 — ouverte

Évaluation

Cette issue n'a pas encore été évaluée.

Description

component: tooling status:awaiting response
Is your feature request related to a problem? Please describe

The agent rule layer in this repo is good at three things: code style
(docs/ai/coding_conventions.md), the pre-done gate
(docs/ai/mandatory_checks.md), and post-mortem capture
(.agents/skills/mistake-reflection). What none of them state is which
surfaces a task-state write has to reach
. That gap keeps producing the same
class of defect: a value that is correct on one surface and missing or stale
on another.

Recent instances, all in this class:

  • #1276 (closed): status.timestamp was mapped by
    src/a2a/compat/v0_3/conversions.py (JSON-RPC/REST compat) but not by
    src/a2a/compat/v0_3/proto_utils.py (gRPC compat) — the same field appeared
    or disappeared depending on transport.
  • #1331 (open): a framework-written FAILED status carried no
    status.timestamp, and src/a2a/server/tasks/database_task_store.py:152-157
    derives last_updated from it, so the row persisted NULL and dropped out
    of ListTasks ordering.
  • #1188 (open) / #1409 (open): the handler resumes or returns from a snapshot
    that disagrees with what later reaches the store and the stream.
  • #1206 (closed as stale) → #1411 (open): contextId inference makes events
    disagree with the stored Task.
  • Review findings on #1346: stamping the local copy after
    task.status.CopyFrom(event.status) leaves the published event unstamped
    (src/a2a/server/tasks/task_manager.py:285), and the CANCELED paths at
    src/a2a/server/agent_execution/active_task.py:971-973 keep the previous
    state's timestamp. These were caught by review, not by any documented rule.

The same confusion shows up in the discussion forum, where it has no issue
tracker to land in: #248 ("Should Message events terminate…", 6 comments),
#435, #40 ("What's the purpose of EventQueue?"), and the multi-replica thread
#1224 / #336.

Describe the solution you'd like

A new skill, .agents/skills/task-state-invariants/SKILL.md, in the same
shape as mistake-reflection (trigger list → procedure → anti-patterns),
covering:

  1. the invariant set, each claim anchored to current main (terminal states
    need a timestamp; stamp the event before CopyFrom; CopyFrom inherits
    the old timestamp; push delivery is best-effort; zero events means a hung
    caller; store and stream must agree; v0.3 compat has two independent
    mappers; continuation identity is inferred per spec §3.4.3);
  2. a sibling-surface checklist to run before declaring such a change done
    (persisted store, streaming subscribers, push notification, cluster
    task_events table, both compat mappers);
  3. a test map naming the existing file per surface, so coverage lands where
    the surface is;
  4. the evidence a PR in this area should carry, consistent with
    docs/ai/evidence_rules.md.

Plus a one-line pointer in AGENTS.md "Mandatory workflow". That pointer
matters: AGENTS.md is the only file in the repo that routes to
.agents/skills/, so a skill without a route is never loaded.

Describe alternatives you considered
  • A docs/ai/ rules page. Rejected as the primary form: docs/ai/* is
    read at task start, while this knowledge is only useful at the moment you
    touch a status write
    — which is how mistake-reflection is structured.
    Happy to have both if maintainers prefer the rule text to live in docs/ai
    with the skill as a thin pointer.
  • Encoding it only in tests. Partially useful, but tests cannot tell a
    change agent which sibling surface they forgot.
  • Fixing each bug as it arrives. Six-plus in about six weeks suggests the
    per-bug loop is not converging.
Additional context

Scouting the rule layer, .agents/skills/ has exactly one skill today and it
was introduced internally by #1059 — I found no precedent for an externally
contributed skill, so raising this first rather than assuming. A draft
implementation (skill + the one-line router pointer, markdown-only, no
runtime code) is ready and filed as a PR linked to this issue. Easy to trim:
drop the AGENTS.md line, or scope the skill to the compat-mapper and
timestamp rules only.

Code of Conduct
  • I agree to follow this project's Code of Conduct
Langage dominant
Python
Étoiles
2.2k
Forks
528
Merge moyen
3 j 17 h
PR mergées (30 j)
43

Préparer son environnement

Par où commencer

  1. Lisez l'issue en entier, puis le guide de contribution du projet.
  2. Signalez en commentaire que vous la prenez — cela évite que deux personnes fassent le même travail.
  3. Forkez le dépôt et travaillez sur une branche.
  4. Ouvrez une pull request qui référence le numéro de l'issue.

Autres issues de a2aproject/a2a-python

Toutes les issues de a2aproject/a2a-python

Issues similaires

Plus d'issues Python

Recevez les nouvelles issues par e-mail

Un résumé court des issues GitHub adaptées aux débutants.