Skip to content

Commit bf02375

Browse files
fix(mech): scrub two review nits — sibling comment drift + phantom class
Aligns the ``task_submission_abci/models.py`` comment on ``use_offchain`` with its sibling in ``task_execution/models.py``. The old wording still claimed "no coherent state where ingress and egress diverge", which directly contradicts the divergence safety net just added in ``_do_predict_api_write_best_effort``. New wording matches the task_execution rewrite: coupling is deliberate, drift between the two skill copies IS possible via env override, and the WARNING gate is what surfaces that drift. Renames ``FetchDataBehaviour`` → ``TaskExecutionBehaviour`` in the four new docstrings on the ingress-gate tests. ``FetchDataBehaviour`` isn't a real class in this repo — the ``behaviour`` conftest fixture is a ``TaskExecutionBehaviour``. Copy-paste artifact.
1 parent 2160d0c commit bf02375

8 files changed

Lines changed: 32 additions & 22 deletions

File tree

packages/packages.json

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -9,12 +9,12 @@
99
"connection/valory/websocket_client/0.1.0": "bafybeid4cnbjpmzcsw3usg7umufgqyod2u3xfw5uso3vukt3n5hfuxvdea",
1010
"skill/valory/contract_subscription/0.1.0": "bafybeicqlkmfpttw4hbbaakr6xos62rd6ytjwkyzlfli4xpvl5yqcycf6q",
1111
"skill/valory/delivery_rate_abci/0.1.0": "bafybeiathwdfpcfqbipqbkslv6j22q5cvov4n3czmehzij3czrhdnlg42e",
12-
"skill/valory/mech_abci/0.1.0": "bafybeigvomrayvkwvativspmvgwdveqiqyndqlteluv235jigd6xgrdlsa",
13-
"skill/valory/task_execution/0.1.0": "bafybeided62jostve2n5b4c7fsccxf4wce4ld3rbvalfdbqp77euon5rtq",
14-
"skill/valory/task_submission_abci/0.1.0": "bafybeiblfzy23r3bgcfdceeoilz2fiqscdyrer3b2xewctq77tlnkja5fa",
12+
"skill/valory/mech_abci/0.1.0": "bafybeiatxn2wb7pasde63hi4cghzoxzr6thj2xe3zwllr54f4kjx7b4ciq",
13+
"skill/valory/task_execution/0.1.0": "bafybeies2iytb73xae2t7k53ap4nzfdfvyqrglofjzdduv5ck4ptanxsjy",
14+
"skill/valory/task_submission_abci/0.1.0": "bafybeibdegmyw2pq54byeac7izj7vcm6egzhj6d72di7s3xdt3pfmai22i",
1515
"skill/valory/websocket_client/0.1.0": "bafybeid6oyycsrvk4duftffs5mrfgmcepibt3qe4om3kfzhwhilfq3ynay",
16-
"agent/valory/mech/0.1.0": "bafybeifg32fr5cf7enk2owgtjyn7rdr5o6goinfdgmsg2lod5amhu6dfjy",
17-
"service/valory/mech/0.1.0": "bafybeifgey2wtnotht4aj6yuwb4rsxsofolhadrqvh6yylstcxphu3d4sy"
16+
"agent/valory/mech/0.1.0": "bafybeidos57xj77zosblpmu2hsxkhczvotjwyxw2gwzhlumh3r6y7cyyxa",
17+
"service/valory/mech/0.1.0": "bafybeig5rxdfzpxvfheh6nvd5wnpkmktrfpzytefo6db66pwkvnpum7myi"
1818
},
1919
"third_party": {
2020
"protocol/open_aea/signing/1.0.0": "bafybeifsjmldwyki3beqyvdt5lzenrg6wyrqaar5plc5rpnvtc4zlentye",

packages/valory/agents/mech/aea-config.yaml

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -40,12 +40,12 @@ skills:
4040
- valory/abstract_abci:0.1.0:bafybeie5et43th2nta76cd3kpm3fmurd7oyzk3qxim76octvt56m6r2poi
4141
- valory/abstract_round_abci:0.1.0:bafybeifkxnvvgsldkb4rgejsoon2mvrmrnl7asy2nhenwss7hpwg3myflu
4242
- valory/contract_subscription:0.1.0:bafybeicqlkmfpttw4hbbaakr6xos62rd6ytjwkyzlfli4xpvl5yqcycf6q
43-
- valory/mech_abci:0.1.0:bafybeigvomrayvkwvativspmvgwdveqiqyndqlteluv235jigd6xgrdlsa
43+
- valory/mech_abci:0.1.0:bafybeiatxn2wb7pasde63hi4cghzoxzr6thj2xe3zwllr54f4kjx7b4ciq
4444
- valory/registration_abci:0.1.0:bafybeif4n2esdjvquomdkwktv7eolepskpo5jlqrfda2abxjqzy2ljsxzi
4545
- valory/reset_pause_abci:0.1.0:bafybeifrnmlscfiki7wojs6zasppefupd2wkjyq6orhdllfppjud7isrxi
4646
- valory/delivery_rate_abci:0.1.0:bafybeiathwdfpcfqbipqbkslv6j22q5cvov4n3czmehzij3czrhdnlg42e
47-
- valory/task_execution:0.1.0:bafybeided62jostve2n5b4c7fsccxf4wce4ld3rbvalfdbqp77euon5rtq
48-
- valory/task_submission_abci:0.1.0:bafybeiblfzy23r3bgcfdceeoilz2fiqscdyrer3b2xewctq77tlnkja5fa
47+
- valory/task_execution:0.1.0:bafybeies2iytb73xae2t7k53ap4nzfdfvyqrglofjzdduv5ck4ptanxsjy
48+
- valory/task_submission_abci:0.1.0:bafybeibdegmyw2pq54byeac7izj7vcm6egzhj6d72di7s3xdt3pfmai22i
4949
- valory/termination_abci:0.1.0:bafybeih6sa2ttcvvjk7rcfn7ure2ws23kcfufssb4qmluzcfvednkfpvoi
5050
- valory/transaction_settlement_abci:0.1.0:bafybeihizaapype5sz7vlosms3nfo6jzfj4ujycuf5uthviq2otvmw6f6m
5151
- valory/websocket_client:0.1.0:bafybeid6oyycsrvk4duftffs5mrfgmcepibt3qe4om3kfzhwhilfq3ynay

packages/valory/services/mech/service.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ license: Apache-2.0
77
fingerprint:
88
README.md: bafybeihppqns2lwn5vehtqh2wu4tjyf76dbzxc26nlfws4sc5hcbjbalma
99
fingerprint_ignore_patterns: []
10-
agent: valory/mech:0.1.0:bafybeifg32fr5cf7enk2owgtjyn7rdr5o6goinfdgmsg2lod5amhu6dfjy
10+
agent: valory/mech:0.1.0:bafybeidos57xj77zosblpmu2hsxkhczvotjwyxw2gwzhlumh3r6y7cyyxa
1111
number_of_agents: 4
1212
deployment:
1313
agent:

packages/valory/skills/mech_abci/skill.yaml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -30,11 +30,11 @@ skills:
3030
- valory/abstract_round_abci:0.1.0:bafybeifkxnvvgsldkb4rgejsoon2mvrmrnl7asy2nhenwss7hpwg3myflu
3131
- valory/registration_abci:0.1.0:bafybeif4n2esdjvquomdkwktv7eolepskpo5jlqrfda2abxjqzy2ljsxzi
3232
- valory/reset_pause_abci:0.1.0:bafybeifrnmlscfiki7wojs6zasppefupd2wkjyq6orhdllfppjud7isrxi
33-
- valory/task_submission_abci:0.1.0:bafybeiblfzy23r3bgcfdceeoilz2fiqscdyrer3b2xewctq77tlnkja5fa
33+
- valory/task_submission_abci:0.1.0:bafybeibdegmyw2pq54byeac7izj7vcm6egzhj6d72di7s3xdt3pfmai22i
3434
- valory/termination_abci:0.1.0:bafybeih6sa2ttcvvjk7rcfn7ure2ws23kcfufssb4qmluzcfvednkfpvoi
3535
- valory/transaction_settlement_abci:0.1.0:bafybeihizaapype5sz7vlosms3nfo6jzfj4ujycuf5uthviq2otvmw6f6m
3636
- valory/delivery_rate_abci:0.1.0:bafybeiathwdfpcfqbipqbkslv6j22q5cvov4n3czmehzij3czrhdnlg42e
37-
- valory/task_execution:0.1.0:bafybeided62jostve2n5b4c7fsccxf4wce4ld3rbvalfdbqp77euon5rtq
37+
- valory/task_execution:0.1.0:bafybeies2iytb73xae2t7k53ap4nzfdfvyqrglofjzdduv5ck4ptanxsjy
3838
behaviours:
3939
main:
4040
args: {}

packages/valory/skills/task_execution/skill.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@ fingerprint:
1313
models.py: bafybeih3es32osrundnhoguzursbc4zfde7qa27zmrkepdud24jffmrycy
1414
tests/__init__.py: bafybeieqltdoxt2ipgn7owrfyceylzqug3fpdy6pk6mxhdxyn2mujz4v7q
1515
tests/conftest.py: bafybeickrspufxtr47ndp5vbrkejmwutlv4swub6ai7ngyh6ejlsulxgom
16-
tests/test_behaviours.py: bafybeid4lqan22icsja5cslnwaxtiazu27bwgyjkdthkxozrr4mcziji4m
16+
tests/test_behaviours.py: bafybeiezgysiwi54hbsoktrzhvktaolst4rkszyu57p7ezrjev7c3ckroa
1717
tests/test_dialogues.py: bafybeig2phgjrv7ugdx4olviuclaxegvyzkcw7t2ztzrp3xcj2ygqs4344
1818
tests/test_handlers.py: bafybeic7jdqovcajvvw5s6kgo7nlpkpkiibpwfgnctpfurunyu4f7is2yi
1919
tests/test_models.py: bafybeidyzmub74c3m6zopwgxy43o2mx5tvig4wmahgyhoiur4qz55jgwaq

packages/valory/skills/task_execution/tests/test_behaviours.py

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -3531,7 +3531,7 @@ def _finalize_gate_setup(
35313531
lets it. ``to_multihash`` is monkeypatched to a cheap prefix so
35323532
``_finalize_done_task`` doesn't try to run the real multihash logic.
35333533
3534-
:param behaviour: FetchDataBehaviour fixture.
3534+
:param behaviour: TaskExecutionBehaviour fixture.
35353535
:param shared_state: shared_state fixture.
35363536
:param params_stub: params fixture.
35373537
:param monkeypatch: pytest monkeypatch fixture used to swap
@@ -3591,7 +3591,7 @@ def test_finalize_done_task_attaches_predict_api_event_when_use_offchain_on(
35913591
behaviour then reads off ``synchronized_data.done_tasks`` after
35923592
consensus replication.
35933593
3594-
:param behaviour: FetchDataBehaviour fixture.
3594+
:param behaviour: TaskExecutionBehaviour fixture.
35953595
:param params_stub: params fixture with ``use_offchain=True``.
35963596
:param shared_state: shared_state fixture.
35973597
:param monkeypatch: pytest monkeypatch fixture.
@@ -3625,7 +3625,7 @@ def test_finalize_done_task_attaches_predict_api_event_on_marketplace_delivery(
36253625
``source='mech_onchain'``. Regression against a docstring drift
36263626
that was suggesting the condition was marketplace-only.
36273627
3628-
:param behaviour: FetchDataBehaviour fixture.
3628+
:param behaviour: TaskExecutionBehaviour fixture.
36293629
:param params_stub: params fixture with ``use_offchain=True``.
36303630
:param shared_state: shared_state fixture.
36313631
:param monkeypatch: pytest monkeypatch fixture.
@@ -3658,7 +3658,7 @@ def test_finalize_done_task_omits_predict_api_event_when_use_offchain_off(
36583658
when the flag is off. Pairs with the egress-side gate test in
36593659
``task_submission_abci/tests/test_onchain_write_path.py``.
36603660
3661-
:param behaviour: FetchDataBehaviour fixture.
3661+
:param behaviour: TaskExecutionBehaviour fixture.
36623662
:param params_stub: params fixture, flipped to ``use_offchain=False`` here.
36633663
:param shared_state: shared_state fixture.
36643664
:param monkeypatch: pytest monkeypatch fixture.

packages/valory/skills/task_submission_abci/models.py

Lines changed: 14 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -128,10 +128,20 @@ def __init__(self, *args: Any, **kwargs: Any) -> None:
128128
# endpoint from PostTxSettlement (settlement writes for both
129129
# offchain-settled AND on-chain-settled requests). A mech is
130130
# either part of the predict-api analytics pipeline or it isn't;
131-
# there's no coherent state where ingress and egress diverge.
132-
# False by default so an out-of-the-box mech does no off-mech
133-
# HTTP work at settlement time and does not accept offchain
134-
# requests.
131+
# the coupling is deliberate. On-chain-only mechs that want
132+
# analytics writes (``mech_onchain`` source) still flip this on
133+
# and accept that their offchain HTTP handler is also live — the
134+
# handler is inert if no client's ``MECH_OFFCHAIN_URL`` points
135+
# at it, so the cost is a wire nothing rides rather than a
136+
# traffic-shape change. The value is a duplicate of the flag
137+
# of the same name on ``task_execution``; if the two copies
138+
# drift (env override on one skill and not the other),
139+
# :py:meth:`PostTxSettlementBehaviour._do_predict_api_write_best_effort`
140+
# emits a WARNING when it sees ``predict_api_event`` entries
141+
# under a locally-off flag, so the misconfiguration is
142+
# alertable rather than silent. False by default so an
143+
# out-of-the-box mech does no off-mech HTTP work at settlement
144+
# time and does not accept offchain requests.
135145
self.use_offchain: bool = bool(kwargs.get("use_offchain", False))
136146
# predict-api ``POST /mech/events`` endpoint. Empty string = no
137147
# URL configured; the PostTxSettlement behaviour short-circuits

packages/valory/skills/task_submission_abci/skill.yaml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@ fingerprint:
1212
dialogues.py: bafybeicvqbqqviqhjkj4hfyqepanqzv6oa3nknpjaczs6yjpyxx5ilcbcq
1313
fsm_specification.yaml: bafybeicswghmdg7xsfhlgznsyr7zhydtunb2575qucxkxmeks6gcos3ut4
1414
handlers.py: bafybeieikfkrjtnlod35ldqf3veoe3oqha6fnnpqpkxwibi5jyobsnvd4a
15-
models.py: bafybeifseshqkg5brosbmhlei4dnqwcmlu7r5istgj7utmsqpbgwdmjlq4
15+
models.py: bafybeiegx7qustzak3oibom3yzphvismtb3cmsjlmmvmepp2p7pzsczxya
1616
payloads.py: bafybeiaaelmpfuv6pvuesj7iy2nnxvgxjketigrppurto2pbsoaqjum2ba
1717
predict_api_events_client.py: bafybeiaipvkrwitftwprsbrnj4rd6ac4n74qzvq22lscbb5li4efc2qnve
1818
rounds.py: bafybeifyjanb7hbqolgxsudzhr27otlaozgttjwufmqit6w5rgb2xc53yu
@@ -47,7 +47,7 @@ protocols:
4747
skills:
4848
- valory/abstract_round_abci:0.1.0:bafybeifkxnvvgsldkb4rgejsoon2mvrmrnl7asy2nhenwss7hpwg3myflu
4949
- valory/transaction_settlement_abci:0.1.0:bafybeihizaapype5sz7vlosms3nfo6jzfj4ujycuf5uthviq2otvmw6f6m
50-
- valory/task_execution:0.1.0:bafybeided62jostve2n5b4c7fsccxf4wce4ld3rbvalfdbqp77euon5rtq
50+
- valory/task_execution:0.1.0:bafybeies2iytb73xae2t7k53ap4nzfdfvyqrglofjzdduv5ck4ptanxsjy
5151
behaviours:
5252
main:
5353
args: {}

0 commit comments

Comments
 (0)