• Blog
  • Docs
  • Pricing
  • We’re hiring!
Log inSign up
dcm31

dcm31

yesno

Unlisted
Yes/No question prototype
Like
yesno
Home
Code
7
README.md
C
cron.ts
fatebook.ts
habits.ts
ingest.ts
H
main.ts
pipeline.ts
Connections
Environment variables
1
Branches
1
Pull requests
Remixes
History
Val Town is a collaborative website to build and scale JavaScript apps.
Deploy APIs, crons, & store data – all from the browser, and deployed in milliseconds.
Sign up now
Code
/
README.md
Code
/
README.md
Search
2/22/2026
Viewing readonly version of main branch: v23
View latest version
README.md

yesno — Daily Habit Prediction Pipeline

A yes/no device endpoint that walks through a daily pipeline of habits, each with a predict → confirm pair integrated with Fatebook for calibration tracking.

Flow

Each day the pipeline resets at 2am PST (7am São Paulo) and presents habits sequentially:

  1. yoga? (80%) → creates Fatebook prediction (80% if yes, 20% if no)
  2. did you yoga? → resolves prediction (auto-advances if Atom Matrix detected yoga)
  3. 18 burpees? (80%) → creates Fatebook prediction with today's goal
  4. did 18 burpees? → resolves prediction
  5. all done!

Device Endpoints

EndpointDescription
GET /questionCurrent question text (plain text, ≤30 chars)
GET /yesAnswer yes, advance pipeline
GET /noAnswer no, advance pipeline
GET /resetReset to step 0
GET /statusFull pipeline state (JSON)
GET /responsesAll logged answers (JSON)

Architecture

habits.ts     — Habit definitions (add new habits here)
pipeline.ts   — Generic state machine, auto-advance, auto-resolve
fatebook.ts   — Fatebook API client (graceful skip if no key)
main.ts       — HTTP handler (backward compatible)
cron.ts       — 2:15am PST auto-resolve unconfirmed predictions as NO

Adding a New Habit

Add an entry to the HABITS array in habits.ts. Each habit needs:

  • id, label, forecast, tags
  • getPredictText() — predict question (≤30 chars)
  • getConfirmText() — confirm question (≤30 chars)
  • getFatebookTitle() — full Fatebook question title
  • checkAutoComplete() — optional auto-detection from external source

Setup

Add FATEBOOK_API_KEY to this val's environment variables. Get your key at https://fatebook.io/api-setup

FeaturesVersion controlCode intelligenceCLIMCP
Use cases
TeamsAI agentsSlackGTM
DocsShowcaseTemplatesNewestTrendingAPI examplesNPM packages
AboutAlternativesPricingBlogNewsletterCareers
We’re hiring!
Brandhi@val.townStatus
X (Twitter)
Discord community
GitHub discussions
YouTube channel
Bluesky
Open Source Pledge
Terms of usePrivacy policyAbuse contact
© 2026 Val Town, Inc.