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

cricks_unmixed4u

gissue-rolodex

Remix of cricks_unmixed4u/ai-prompted
Public
Like
gissue-rolodex
Home
Code
16
.cursor
1
backend
4
frontend
3
integrations
1
.cursorrules
.gitignore
.vtignore
README.md
Untitled
config.ts
deno.json
knowledge.md
C
main.cron.tsx
main.http.tsx
C
only-oldest-issues.cron.tsx
C
third-layer.cron.tsx
Environment variables
8
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
/
.cursor
/
plans
/
layer_refactor_0bd4d298.plan.md
Code
/
.cursor
/
plans
/
layer_refactor_0bd4d298.plan.md
Search
1/31/2026
layer_refactor_0bd4d298.plan.md
name:
Layer refactor
overview:
Refactor cron layers into shared, configurable primitives so each layer composes selection, gating (updated-since / stalest), and Beeminder dispatch without duplicating logic.
todos:
id:
layer-pipeline
content:
Create shared layer pipeline module + types
status:
completed
id:
state-generalize
content:
Generalize last-run and snapshot storage by jobId
status:
completed
id:
cron-refactor
content:
Refactor three cron files to use pipeline
status:
completed

Flexible Layer Design

Goals

  • Make layer behavior composable: selector (which issues), gate (when to count), and sink (Beeminder send + daily de-dupe) should be reusable.
  • Keep separate cron entrypoints while sharing logic and storage helpers.

Proposed Architecture

  • Introduce a small β€œlayer pipeline” module that exposes:
    • collectUpdatedIssues(...) (shared fetch + last-run handling)
    • filterByLabels(...) (subset selection for tagged rules)
    • gateByStalestPrefix(...) (oldest/stalest gating using snapshot table + temporal ordering)
    • sendBeeminderDatapoints(...) (daily de-dupe + comment + dispatch)
  • Keep each cron thin: define layer config (selector + gate + goal routing), then call the pipeline.

Targeted Code Touchpoints

  • New module: backend/layers/pipeline.ts for shared flow pieces.
  • Extend state helpers in backend/database/lastRunState.ts to support multiple jobs and optional β€œlast snapshot timestamp” for stalest gating.
  • Reuse stalest snapshot logic in backend/database/stalestSnapshot.ts as a generic β€œprefix snapshot” keyed by jobId to support stalest gating for multiple layers.
  • Refactor crons to use the pipeline:
    • main.cron.tsx uses collectUpdatedIssues + sendBeeminderDatapoints.
    • only-oldest-issues.cron.tsx uses collectUpdatedIssues + gateByStalestPrefix + sendBeeminderDatapoints.
    • third-layer.cron.tsx uses collectUpdatedIssues + filterByLabels + optional gateByStalestPrefix (for β€œonly-oldest” on subset) + sendBeeminderDatapoints.

Data Flow (Mermaid)

Rendering mermaid diagram...

Notes on Flexibility

  • Gate composition allows β€œonly-oldest” to apply to any selector (e.g., tagged subset) without duplicating query logic.
  • Snapshot storage becomes keyed by jobId so multiple layers can persist their own β€œstalest prefix”.
  • Stalest gating enforces temporal order using issue.updated_at: process the stalest prefix in order and only emit a contiguous run of updated issues (if the first stale item is unchanged, stop).

Risks

  • Table schema updates require new table names per Val Town rules; plan includes new tables (e.g., _1 suffix) where needed.
FeaturesVersion controlCode intelligenceCLIMCP
Use cases
TeamsAI agentsSlackGTM
DocsShowcaseTemplatesNewestTrendingAPI examplesNPM packages
PricingNewsletterBlogAboutCareers
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.