Long-running-agent foundation -- wake schedules, fires, webhook subscriptions
Project description
3tears-agent-wake
Long-running-agent foundation for 3tears-based agents. This package ships the schema + Collection layer for three platform tables:
agent_wake_schedules-- one row per active wake schedule for a conversation (cron / one-shot / random-window / etc). Carries a nullableskill_idFK referencing the cross-packageagent_skills.skill_idstandalone UNIQUE.wake_fires-- one row per wake fire (history; status enum spans'fired','fired_silent','yielded','skipped_busy','skipped_rate_limit','skipped_cap','skipped_no_handler','failed').webhook_subscriptions-- one row per inbound HTTP webhook subscription. Carries nullabledefault_skill_idFK toagent_skills.skill_idand Fernet-encryptedsecret_ciphertext.
Plus three BaseEntity subclasses, three BaseCollection subclasses,
and an agent-scope migration registration declaring
depends_on=("conversations", "agent_skills").
No tick engine, no dispatch handler, no agent tools, and no Pydantic API models live in this package.
Partitioning
All three tables partition by conversation_id (wake operations are
conversation-scoped). The Collections expose partition_column = "conversation_id" so the workspace partition-column enforcement walker
audits every SQL string touching these tables for the predicate.
There is intentionally NO database-level FK on conversation_id ->
conversations(conversation_id). The 3tears conversations table
carries a composite PK (agent_id, conversation_id) and no standalone
UNIQUE (conversation_id) constraint, so a single-column FK is not
legal. The same precedent applies in packages/agent/tools/
(context_items.conversation_id) and packages/agent/skills/
(agent_skill_invocations.conversation_id). Conversation lifecycle is
governed by app-level cascade through ConversationsCollection.
Orphan-row implication. Because there is no DB-level FK, deleting a
row from conversations does NOT automatically remove the wake
schedules, fires, or webhook subscriptions for that conversation.
They become orphans (rows whose conversation_id no longer resolves).
The partition-column enforcement walker keeps the application blind to
orphans (every query is filtered by conversation_id so an orphan is
invisible at the read path), but the rows still occupy storage. This
is the same trade-off agent-tools and agent-skills make. A future
cross-package cleanup (a TRIGGER on conversations-delete that fans
out to dependent tables, or a periodic GC job in ConversationsCollection)
would close the gap; that work is intentionally cross-cutting and
out of scope for this package.
Migration registration
from threetears.agent.wake import register as register_wake
from threetears.core.data.migrations import MigrationRunner
runner = MigrationRunner()
register_wake(runner)
Migrations are agent-scoped and declare
depends_on=("conversations", "agent_skills") -- the canonical
MigrationRunner topologically orders the agent-scope pass so the
conversations + agent_skills migrations apply before any wake
table is created.
Design references
See docs/agent-wake/README.md for the package overview and the
locked design decisions.
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file 3tears_agent_wake-0.14.0.tar.gz.
File metadata
- Download URL: 3tears_agent_wake-0.14.0.tar.gz
- Upload date:
- Size: 160.8 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: uv/0.11.1 {"installer":{"name":"uv","version":"0.11.1","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"macOS","version":null,"id":null,"libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":null}
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
2158d34e774b29cf4ecd8dbfc78a9a5ce13064925c3946ed5b0cbf872ffe5c5d
|
|
| MD5 |
ef530ad13830cf97840fac442b40b2da
|
|
| BLAKE2b-256 |
5dedd39a18892b5061eed76aa491855c5e6e09be517e4d2a4d1a39a6027b7380
|
File details
Details for the file 3tears_agent_wake-0.14.0-py3-none-any.whl.
File metadata
- Download URL: 3tears_agent_wake-0.14.0-py3-none-any.whl
- Upload date:
- Size: 111.5 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: uv/0.11.1 {"installer":{"name":"uv","version":"0.11.1","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"macOS","version":null,"id":null,"libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":null}
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
e23e179cdf12af4c3b7dac3bb159d2835fe50a463d1497d7470cfd94d70e12b8
|
|
| MD5 |
e6487c235af5366ca8b2f0b37028b029
|
|
| BLAKE2b-256 |
92d2de5ac24871f4fbc7bf5ee6e3ef457d056c72fbf0bcd6a68d4a99be6511ae
|