Merge branch 'worktree-agent-a3bd292551395dda0'

# Conflicts:
#	app/storage/schema.py
This commit is contained in:
Wolf committed 2026-09-29 14:16:35 +02:00
commit 43773efc53
8 files changed
+338 -34

No files matched your search

+8 -5
View File
@@ -17,7 +17,7 @@ roles out of extract's reach for good.
fit cos(role vector, intent vector), min-max scaled across
the roles this agent scores in this run: the closest is 1,
the farthest 0, a lone role 1
recency 0.5 ** (days since first_seen / 14)
recency 0.5 ** (days since posted_at / 14)
affinity (the agent's affinity for the company + 1) / 3
taste cos(role vector, liked direction), min-max scaled like fit,
where the direction is mean(liked vectors) - mean(passed vectors)
@@ -66,10 +66,13 @@ SEEDED = "agents:seeded"
# ------------------------------------------------------------------- terms
def recency(first_seen: str, now: datetime) -> float:
"""1.0 for a role first seen now, halving every `HALF_LIFE_DAYS`."""
def recency(posted_at: str, now: datetime) -> float:
"""1.0 for a role posted now, halving every `HALF_LIFE_DAYS`. `posted_at`
is `app.models.posted_at`: the earlier of when the app first saw the role
and, for a trusted host, when the board says it was posted — so a
months-old backlog a newly added board brings in does not start at 1.0."""
try:
seen = datetime.fromisoformat(first_seen)
seen = datetime.fromisoformat(posted_at)
except ValueError:
return 0.0
days = max((now - seen).total_seconds(), 0.0) / 86400
@@ -165,7 +168,7 @@ def score_one(candidate: Candidate, gates: Sequence[Gate], weights: Weights,
if failed := failed_gates(candidate, gates):
return 0.0, ", ".join(failed)
terms = [(weights.recency, recency(candidate.first_seen, now)),
terms = [(weights.recency, recency(candidate.posted_at, now)),
(weights.affinity, affinity_term(candidate.affinity))]
terms += [(g.weight, 1.0 if state == 1 else 0.0)
for g, state in zip(gates, candidate.gates, strict=True) if g.mode == "prefer"]