Ajeya95 commited on
Commit
0eb8142
·
verified ·
1 Parent(s): 385cf23

Refocus README for Thousand Token Wood track

Browse files
Files changed (1) hide show
  1. README.md +81 -124
README.md CHANGED
@@ -28,87 +28,72 @@ tags:
28
 
29
  # LifeChoice Simulator
30
 
31
- LifeChoice Simulator turns a difficult real-life dilemma into a short, consequential future that a user can play through. It is built for reflection, not prediction or advice: the app shows how tradeoffs can compound across money, fulfillment, social validation, stress, and family pressure.
 
 
32
 
33
  ![Architecture](docs/architecture.svg)
34
 
35
- ## Live Demo
36
 
37
  - Live Space: [build-small-hackathon/LifeChoice-Simulator](https://huggingface.co/spaces/build-small-hackathon/LifeChoice-Simulator)
38
- - Agent build trace: [lifechoice-simulator-trace](https://huggingface.co/datasets/build-small-hackathon/lifechoice-simulator-trace)
39
- - Public demo video: [watch the 22-second walkthrough](https://github.com/Ajey95/LifeChoice-Simulator-Hackathon/raw/main/docs/lifechoice-demo.mp4)
40
- - Social post draft: [docs/social-post.md](docs/social-post.md)
41
- - Demo script: [docs/demo-script.md](docs/demo-script.md)
42
-
43
- ## Record A Demo
44
-
45
- The submission includes a demo recording plan so judges can evaluate the app even if live API limits, model latency, or runtime availability affect the Space during review.
46
-
47
  - Demo script: [docs/demo-script.md](docs/demo-script.md)
48
- - Existing walkthrough video: [docs/lifechoice-demo.mp4](docs/lifechoice-demo.mp4)
49
- - Suggested length: 45-90 seconds
50
- - Required coverage: setup flow, first deterministic scene, at least one committed choice, metric changes, world/character state, and final report or cascade if time allows
51
-
52
- The demo should make the core product claim visible: LifeChoice is a stateful causal simulation with deterministic consequences, not a one-shot advice chatbot.
53
 
54
- ## Post It
55
 
56
- The submission also includes a ready-to-use social media post script that links back to the live Space and public build trace.
57
-
58
- - Social post script: [docs/social-post.md](docs/social-post.md)
59
- - Live Space: [build-small-hackathon/LifeChoice-Simulator](https://huggingface.co/spaces/build-small-hackathon/LifeChoice-Simulator)
60
- - Public trace dataset: [lifechoice-simulator-trace](https://huggingface.co/datasets/build-small-hackathon/lifechoice-simulator-trace)
61
 
62
- The post highlights the app, the hackathon track, the Codex-assisted build process, and the public trace dataset for the `Sharing is Caring` badge.
 
 
 
 
 
 
63
 
64
- ## What It Does
65
 
66
- The user enters a fork in the road, chooses one path to simulate, adds one real constraint, and selects a persona voice. LifeChoice then uses a 7B language model to help generate adaptive future scenarios inside an eight-node simulation where every decision changes the state of the world and creates durable consequences.
67
 
68
- Unlike a normal chatbot, the LLM is not asked to improvise the whole product from scratch on every turn. It is the narrative scenario engine for the adaptive experience, while deterministic code provides the structure around it: arithmetic, state transitions, facts, obligations, closed options, cascade moments, safety boundaries, and the final report.
69
 
70
- ## Why It Is Not Just A Chatbot
 
 
 
 
 
71
 
72
- A chatbot responds turn by turn with prose. LifeChoice runs a stateful simulation engine:
73
 
74
- - Every choice changes five deterministic metrics.
75
- - Choices create durable facts, obligations, and closed options.
76
- - Later scenes must respect causal records and metric thresholds.
77
- - Earlier choices return through three cascade moments.
78
- - The visual environment changes among `thriving`, `stable`, and `struggling`.
79
- - The player sprite changes among `neutral`, `stressed`, and `confident`.
80
- - A bounded context packet prevents token growth across the simulation.
81
- - The final report is computed from actual behavior, not a conversational impression.
82
 
83
- The LLM generates and adapts the scenario text inside bounded decision nodes. Deterministic code handles scoring, state transitions, safety limits, and simulation completion so the model's creativity stays grounded in a consistent causal system.
84
 
85
- ## Product Design
86
 
87
- LifeChoice is designed around fast entry, bounded generation, and visible consequences.
 
 
 
 
88
 
89
- | Capability | Design |
90
- |---|---|
91
- | Fast onboarding | Dilemma, path selection, one calibration answer, and persona selection |
92
- | Immediate play | The opening node is deterministic and available without model latency |
93
- | Efficient generation | One future node is generated at a time and prefetched in the background |
94
- | Bounded context | Last 3 choices, 8 facts, 5 obligations, and 5 closed options only |
95
- | Stable characters | Characters remain static session data, not regenerated every turn |
96
- | Consistent world state | Threshold facts and narrative validation enforce visible pressure |
97
- | Meaningful choices | Every choice mutates facts, obligations, closed options, and metrics |
98
- | Persona continuity | Reactions appear at opening, selected later nodes, and critical thresholds |
99
- | Delayed consequences | Small echo at node 2, major consequence at node 5, final payoff at node 7 |
100
- | Reactive visuals | Environment image, metric panel, and sprite expression update after decisions |
101
 
102
  ## Architecture
103
 
104
- 1. Gradio captures a dilemma, chosen path, calibration fact, and persona.
105
- 2. The engine returns an immediate deterministic opening scene.
106
- 3. A background worker generates future scenario nodes with the 7B model.
107
- 4. The deterministic state engine applies deltas and updates the causal ledger.
108
- 5. Narrative validation rejects generated scenes that contradict critical metrics.
109
- 6. The environment derives its visual state from all five metrics.
110
- 7. Persona reactions and cascade events reuse the causal ledger.
111
- 8. The final report summarizes observed behavior inside the simulation.
112
 
113
  ## Model Compliance
114
 
@@ -118,44 +103,50 @@ Only one model is configured.
118
  |---|---:|---|
119
  | [`Qwen/Qwen2.5-7B-Instruct`](https://huggingface.co/Qwen/Qwen2.5-7B-Instruct) | 7.616B | Bounded adaptive scenario generation |
120
 
121
- Hugging Face repository metadata reports `7,615,616,512` parameters. No secondary model is configured, and no model at or above 32B is used. The submitted experience is LLM-centered: the model is what makes later scenarios adaptive to the user's dilemma and prior choices. Deterministic authored nodes remain as a reliability fallback for demos and outages, but they are not the core creative experience.
122
 
123
- Run the compliance test:
124
 
125
- ```bash
126
- pytest tests/test_model_compliance.py
127
- ```
 
 
 
 
 
 
128
 
129
  ## Safety
130
 
131
- LifeChoice is a reflective simulation, not medical, legal, financial, mental-health, or career advice. Its futures are fictional hypotheses rather than predictions. Users should not enter secrets or sensitive personal data. High-stakes decisions should be discussed with qualified people who understand the real situation.
132
 
133
  Safety controls include:
134
 
135
- - Deterministic metric arithmetic and clamping to `0..100`
136
- - Bounded model context
137
- - Strict model-output schema validation
138
- - Deterministic fallback for outages or invalid model output
139
- - No autonomous real-world action
140
- - No recommendation of a "correct" path
141
- - Explicit uncertainty and disclaimer text in the UI
142
 
143
  ## Built With Codex
144
 
145
- This submission was developed with Codex as an implementation partner, not just as a code autocomplete tool. Codex was used across product design, architecture, implementation, verification, documentation, and deployment preparation.
146
 
147
- Codex helped turn the initial hackathon concept into a production-shaped system:
148
 
149
- - Converted the idea into a modular simulation architecture with deterministic state ownership.
150
- - Implemented the Gradio application, custom interface, scenario rendering, persona panel, sprite state, metrics, and report view.
151
- - Designed the causal ledger model: facts, obligations, closed options, recent choices, and delayed cascade moments.
152
- - Integrated Hugging Face `InferenceClient` so the 7B model can generate bounded adaptive scenarios while deterministic code validates and scores the simulation.
153
- - Built validation logic so generated scenes cannot ignore critical stress, money, or family thresholds.
154
- - Created compliance artifacts for model-size limits, safety posture, architecture, screenshots, demo flow, and submission evidence.
155
- - Verified live Space access, runtime state, repository files, world-state transitions, and character-state transitions.
156
- - Published a public agent build trace for transparency and the `Sharing is Caring` badge.
157
 
158
- The workflow stayed human-directed: the project owner selected the product direction, reviewed behavior in the running Space, chose badge claims, and guided final submission positioning. Codex handled implementation details, consistency checks, and documentation polish so the build could move from prototype to submission-ready artifact quickly.
159
 
160
  Codex-attributed commits use:
161
 
@@ -165,54 +156,22 @@ Author: Codex <codex@openai.com>
165
 
166
  ## Bonus Badges
167
 
168
- - **Off-Brand**: custom game-style Gradio frontend instead of default Gradio presentation.
169
  - **Field Notes**: README, architecture diagram, demo script, compliance checklist, screenshots, and submission notes.
170
  - **Sharing is Caring**: public [agent build trace dataset](https://huggingface.co/datasets/build-small-hackathon/lifechoice-simulator-trace) with 26 event rows.
171
 
172
  This submission does not claim Tiny Titan, OpenBMB, NVIDIA, Modal credits, Off the Grid, Well-Tuned, or Llama Champion.
173
 
174
- ## Tech Stack
175
 
176
  - Python 3.10+
177
  - Gradio 5
178
  - Hugging Face Hub `InferenceClient`
179
- - `Qwen/Qwen2.5-7B-Instruct` (7B)
180
  - Thread-pool prefetching
181
- - Pytest
182
  - Pixel-art environment assets
183
-
184
- ## Run Locally
185
-
186
- ```bash
187
- python -m venv .venv
188
- .\.venv\Scripts\activate
189
- pip install -r requirements.txt
190
- python app.py
191
- ```
192
-
193
- `HF_TOKEN` should be configured for the submitted experience. The fallback path exists only to avoid a blank demo during outages; it is not the intended model-driven product mode.
194
-
195
- ## Tests
196
-
197
- ```bash
198
- pytest -q
199
- ```
200
-
201
- The suite covers model-size compliance, bounded context, branch divergence, world-state clamping, state-to-narrative consistency, cascades, persona cadence, and metric-driven environment changes.
202
-
203
- ## Deployment
204
-
205
- Authenticate as an account with write permission in `build-small-hackathon`, then upload the Space files to:
206
-
207
- ```text
208
- build-small-hackathon/LifeChoice-Simulator
209
- ```
210
-
211
- The current public Space is available at:
212
-
213
- ```text
214
- https://huggingface.co/spaces/build-small-hackathon/LifeChoice-Simulator
215
- ```
216
 
217
  ## Screenshots
218
 
@@ -228,8 +187,6 @@ https://huggingface.co/spaces/build-small-hackathon/LifeChoice-Simulator
228
 
229
  ![Causal final report](docs/screenshots/report.png)
230
 
231
- ## Submission Status
232
-
233
- Code, Space metadata, model compliance, safety documentation, architecture, screenshots, demo script, public trace dataset, and badge evidence are included.
234
 
235
- See the dated [compliance checklist](docs/compliance-checklist.md) for requirement-by-requirement evidence.
 
28
 
29
  # LifeChoice Simulator
30
 
31
+ LifeChoice Simulator is an LLM-powered interactive future game for the **Thousand Token Wood** track. It turns a real fork in the road into a strange, playable eight-node future where choices change the world, the character, the pressure, and the ending report.
32
+
33
+ The experience sits between a text-adventure dungeon master, a decision simulator, and a pocket-sized alternate-life RPG. A 7B model dreams up adaptive scenarios; deterministic game state keeps those dreams consequential.
34
 
35
  ![Architecture](docs/architecture.svg)
36
 
37
+ ## Live Links
38
 
39
  - Live Space: [build-small-hackathon/LifeChoice-Simulator](https://huggingface.co/spaces/build-small-hackathon/LifeChoice-Simulator)
40
+ - Demo video: [22-second walkthrough](https://github.com/Ajey95/LifeChoice-Simulator-Hackathon/raw/main/docs/lifechoice-demo.mp4)
41
+ - Public build trace: [lifechoice-simulator-trace](https://huggingface.co/datasets/build-small-hackathon/lifechoice-simulator-trace)
42
+ - Social post script: [docs/social-post.md](docs/social-post.md)
 
 
 
 
 
 
43
  - Demo script: [docs/demo-script.md](docs/demo-script.md)
44
+ - Compliance checklist: [docs/compliance-checklist.md](docs/compliance-checklist.md)
 
 
 
 
45
 
46
+ ## Thousand Token Wood Fit
47
 
48
+ LifeChoice is built for the whimsical track: a playful, AI-native interaction that lets a small model wander somewhere stranger than a normal productivity app.
 
 
 
 
49
 
50
+ | Track Signal | How LifeChoice Fits |
51
+ |---|---|
52
+ | Interactive AI game | Eight playable decision nodes, persistent stats, branching consequences, persona reactions, and final report |
53
+ | Out-of-the-box entertainment | A serious life dilemma becomes an alternate-future game with pixel-art scenes and a reactive character |
54
+ | Small model imagination | `Qwen/Qwen2.5-7B-Instruct` generates bounded future scenarios from the user's fork, pressure, and past choices |
55
+ | Text-adventure energy | The model acts like a constrained future narrator while the state engine remembers what the player did |
56
+ | Delightful presentation | Custom Gradio UI, cinematic scenario cards, world-state badges, metric bars, and pixel-art backgrounds |
57
 
58
+ ## Experience
59
 
60
+ The player enters a dilemma such as `MTech vs Software Job`, chooses one path to enter, adds the pressure that makes the decision real, and selects a voice that follows them through the simulation.
61
 
62
+ Each turn combines:
63
 
64
+ - an LLM-generated scenario constrained by the current causal state
65
+ - three consequential choices
66
+ - five changing metrics: financial security, fulfillment, validation, stress, and family satisfaction
67
+ - durable facts, obligations, and closed options
68
+ - a reactive world state: `stable`, `thriving`, or `struggling`
69
+ - a character expression: `neutral`, `stressed`, or `confident`
70
 
71
+ The result is not a prediction engine and not an advice bot. It is a playable mirror: a fictional system for feeling how tradeoffs compound.
72
 
73
+ ## AI Role
 
 
 
 
 
 
 
74
 
75
+ The LLM is central to the project. It generates the adaptive future scenarios that make each run feel personal to the player's dilemma, chosen path, calibration pressure, and earlier decisions.
76
 
77
+ The deterministic layer gives the model a game board:
78
 
79
+ - state transitions and metric arithmetic
80
+ - causal memory through facts, obligations, and closed options
81
+ - narrative validation for stress, money, and family-pressure thresholds
82
+ - fallback resilience during model outages
83
+ - final report generation from the recorded causal ledger
84
 
85
+ This split keeps the app AI-native without turning it into an unconstrained chat transcript.
 
 
 
 
 
 
 
 
 
 
 
86
 
87
  ## Architecture
88
 
89
+ 1. Gradio captures the dilemma, chosen path, calibration fact, and persona.
90
+ 2. The first scene appears immediately to keep the game responsive.
91
+ 3. A background worker prepares future scenario nodes with the 7B model.
92
+ 4. The state engine applies choice deltas and updates the causal ledger.
93
+ 5. Narrative validation keeps generated scenes aligned with critical metrics.
94
+ 6. The visual environment updates from all five metrics.
95
+ 7. Earlier decisions return through cascade moments.
96
+ 8. The final report summarizes the observed playthrough.
97
 
98
  ## Model Compliance
99
 
 
103
  |---|---:|---|
104
  | [`Qwen/Qwen2.5-7B-Instruct`](https://huggingface.co/Qwen/Qwen2.5-7B-Instruct) | 7.616B | Bounded adaptive scenario generation |
105
 
106
+ Hugging Face model metadata reports `7,615,616,512` parameters. No secondary model is configured, and no model at or above 32B is used. Deterministic authored content exists only as a resilience path if inference is unavailable; the submitted product experience is centered on model-generated scenarios.
107
 
108
+ ## Product Design
109
 
110
+ | Capability | Design |
111
+ |---|---|
112
+ | Fast start | The game opens without waiting on model latency |
113
+ | Adaptive scenario loop | Later nodes are generated by the 7B model from bounded causal context |
114
+ | Bounded memory | Recent choices, facts, obligations, and closed options are carried forward |
115
+ | Consequential choices | Every decision mutates metrics and the causal ledger |
116
+ | Delayed consequences | Prior decisions return at cascade moments instead of disappearing |
117
+ | Reactive visuals | Backgrounds, metrics, world label, and sprite expression change with state |
118
+ | Final report | The ending is computed from what happened in the playthrough |
119
 
120
  ## Safety
121
 
122
+ LifeChoice is framed as reflective fiction. It does not provide medical, legal, financial, mental-health, or career advice, and it does not claim to predict the user's future.
123
 
124
  Safety controls include:
125
 
126
+ - bounded model context
127
+ - strict generated-node schema validation
128
+ - deterministic metric arithmetic
129
+ - no autonomous real-world actions
130
+ - no recommendation of a single correct path
131
+ - visible disclaimer text in the UI
132
+ - final report grounded in the simulated ledger, not external claims
133
 
134
  ## Built With Codex
135
 
136
+ Codex was used as an implementation partner across product design, architecture, code, validation, documentation, and deployment polish.
137
 
138
+ Codex contributed to:
139
 
140
+ - translating the hackathon concept into a modular LLM-powered simulation architecture
141
+ - implementing the Gradio interface, custom game UI, scenario cards, metric panel, persona panel, sprite state, and final report view
142
+ - designing the causal ledger with facts, obligations, closed options, recent choices, and delayed cascade moments
143
+ - integrating Hugging Face `InferenceClient` for bounded 7B scenario generation
144
+ - adding validation so generated scenes respect critical stress, money, and family thresholds
145
+ - documenting model compliance, safety posture, architecture, screenshots, demo flow, and badge evidence
146
+ - verifying live Space access, runtime metadata, world-state transitions, and character-state transitions
147
+ - publishing the public agent build trace for transparency
148
 
149
+ The workflow stayed human-directed: the project owner shaped the concept, evaluated the running Space, selected badge claims, and guided final submission positioning. Codex handled implementation depth, consistency checks, and documentation polish.
150
 
151
  Codex-attributed commits use:
152
 
 
156
 
157
  ## Bonus Badges
158
 
159
+ - **Off-Brand**: custom game-style Gradio frontend instead of the default Gradio look.
160
  - **Field Notes**: README, architecture diagram, demo script, compliance checklist, screenshots, and submission notes.
161
  - **Sharing is Caring**: public [agent build trace dataset](https://huggingface.co/datasets/build-small-hackathon/lifechoice-simulator-trace) with 26 event rows.
162
 
163
  This submission does not claim Tiny Titan, OpenBMB, NVIDIA, Modal credits, Off the Grid, Well-Tuned, or Llama Champion.
164
 
165
+ ## Technical Snapshot
166
 
167
  - Python 3.10+
168
  - Gradio 5
169
  - Hugging Face Hub `InferenceClient`
170
+ - `Qwen/Qwen2.5-7B-Instruct` at 7.616B parameters
171
  - Thread-pool prefetching
172
+ - Deterministic state engine
173
  - Pixel-art environment assets
174
+ - Public Hugging Face Space deployment
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
175
 
176
  ## Screenshots
177
 
 
187
 
188
  ![Causal final report](docs/screenshots/report.png)
189
 
190
+ ## Submission Evidence
 
 
191
 
192
+ Code, Space metadata, model compliance, safety documentation, architecture, screenshots, demo script, public trace dataset, social post script, and badge evidence are included in the repository.