clock_due_unreadable
A clock's due function can't give a date for the Service's own example order: it throws, or returns something that isn't a date. On a real order the clock would never open, and the owner console would alarm.
| Fix | Fails in | Suggests | Exit |
|---|---|---|---|
| Return a civil date such as '2027-04-15' from what the order has, or nothing until it has it. | services/translation.ts:7 · clocks.deliver_by.due | clocks.deliver_by.due: job => job.input.<a date input>, such as '2027-04-15' | 1 |
Owned by Clocks: the page that explains what this gate holds.
✗ A clock's due function can't give a date for the Service's own example order: it throws, or returns something that isn't a date. On a real order the clock would never open, and the owner console would alarm. Return a civil date such as '2027-04-15' from what the order has, or nothing until it has it. clocks.deliver_by.due threw on the Service's example order: Cannot read properties of undefined (reading 'name').
at services/translation.ts:7 · clocks.deliver_by.due
✗ 1 to fiximport { Service } from 'services.dev'
export default Service({
name: 'Translation',
input: { document: 'file', to: 'language: a BCP 47 tag, such as fr-CA' },
output: { document: 'file' },
clocks: { deliver_by: { due: job => `${job.output.document.name.slice(0, 10)}`, owner: 'buyer' } },
price: 49,
})diff --git a/services/translation.ts b/services/translation.ts
index 6eaf669..e60fa29 100644
--- a/services/translation.ts
+++ b/services/translation.ts
@@ -2,8 +2,8 @@ import { Service } from 'services.dev'
export default Service({
name: 'Translation',
- input: { document: 'file', to: 'language: a BCP 47 tag, such as fr-CA' },
+ input: { document: 'file', to: 'language: a BCP 47 tag, such as fr-CA', needed_by: 'date: such as 2026-12-01' },
output: { document: 'file' },
- clocks: { deliver_by: { due: job => `${job.output.document.name.slice(0, 10)}`, owner: 'buyer' } },
+ clocks: { deliver_by: { due: job => job.input.needed_by, owner: 'buyer' } },
price: 49,
})✓ ready to sell · 1 Service · AI delivers it alone · it keeps at least 80% of every jobHow the tax example passes this gate, in lines read from its files.
/** When the year's return is due in each jurisdiction: the statute's date, or a later one an extension the client already filed set. The calendar rolls it. */
export const fileDue = (job: AnyView, j: string) => [statutory(job, j), String(job.input.extended_to ?? '')].sort()[1] || statutory(job, j)
// …
/** The earliest date any carryforward expires: the subject's clock for them, from the job's own figures or what the taxpayer keeps. */
export const earliestExpiry = (job: AnyView) => ((job.output.carryforwards as Carryforward[] | undefined) ?? job.subject.fact<Carryforward[]>('carryforwards') ?? []).flatMap(c => (c.expires ? [c.expires] : [])).sort()[0] ?? ''clocks: {
file: { due: fileDue, each: { of: 'jurisdictions' }, owner: 'of_record', rungs: ['notice 90d', 'notice 30d', 'run tentative 3d', 'ack daily 5d'], moves: { extend: '6mo after due' } },
// …
expiring: { due: earliestExpiry, owner: 'of_record', lives_on: 'subject', rungs: ['notice 180d'] },Read them in context: Two clocks, Annual return.
{
"code": "clock_due_unreadable",
"reason": "A clock's due function can't give a date for the Service's own example order: it throws, or returns something that isn't a date. On a real order the clock would never open, and the owner console would alarm.",
"next": "Return a civil date such as '2027-04-15' from what the order has, or nothing until it has it. clocks.deliver_by.due threw on the Service's example order: Cannot read properties of undefined (reading 'name').",
"doc_url": "https://services.dev/docs/reference/check/clock_due_unreadable",
"file": "services/translation.ts",
"line": 7,
"path": "clocks.deliver_by.due",
"suggest": {
"path": "clocks.deliver_by.due",
"value": "job => job.input.<a date input>, such as '2027-04-15'"
}
}The whole document check --json prints
{
"ai": {
"cents_per_call": 42,
"simulated": true
},
"mcp": {
"tools": 13,
"tokens": 4486,
"sandbox": 9,
"budget": 8000
},
"services": [
{
"path": "services/translation.ts",
"lines": 5,
"steps": "draft · ai → review · ai · adversarial",
"ok": false,
"price": "$49 per job, within 48 hours, charged on delivery.",
"who": "AI delivers every job.",
"clocks": [