Skip to content

SupratikB23/Daily-Deterministic-Reflection-Tree

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

6 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Daily Reflection Tree

A deterministic end-of-day reflection tool. No LLM at runtime — all intelligence is encoded in the tree structure.

Python No Dependencies Nodes


Overview

Walks an employee through a structured conversation at the end of their workday — three psychological axes, 9 questions with fixed choices, 8 possible reflection summaries.

Same answers → Same path. Always.

Axis Spectrum The Question
Axis 1 — Locus Victim ↔ Victor Did you operate as a victim or a victor today?
Axis 2 — Orientation Entitlement ↔ Contribution Did you give or expect today?
Axis 3 — Radius Self-Centric ↔ Altrocentric Did you think about just yourself, or something wider?

Quick Start

Requirements: Python 3.6+ · No external packages needed.

git clone https://github.com/SupratikB23/Daily-Deterministic-Reflection-Tree.git
cd Daily-Deterministic-Reflection-Tree
python agent/agent.py

The agent automatically loads tree/reflection-tree.json. That's it.


Project Structure

Daily-Deterministic-Reflection-Tree/
│
├── tree/
│   ├── reflection-tree.json      ← Part A: Complete tree (30 nodes, 8 summary variants)
│   └── tree-diagram.md           ← Part A: Mermaid flowchart (renders on GitHub)
│
├── agent/
│   └── agent.py                  ← Part B: CLI agent (~110 lines, zero dependencies)
│
├── transcripts/
│   ├── persona-1-transcript.md   ← Frustrated / Entitled / Self path
│   └── persona-2-transcript.md   ← Productive / Contributing / Altro path
│
├── write-up.md                   ← Design rationale & psychological grounding
├── PRD.md                        ← Product requirements
├── PLAN.md                       ← Implementation plan
└── README.md                     ← You are here

How the Tree Works

Node Types

The tree (reflection-tree.json) contains 30 nodes across 5 types:

Type Count Role
Question 9 Employee picks from 4 fixed options; answer is stored & signal tallied
Decision 9 Pure routing logic — evaluates conditions top-to-bottom, branches to first match
Reflection 6 Displays a psychological reframe, then auto-advances
Bridge 3 Transitions between axes, can reference earlier answers
Summary 1 Final personalised close — one of 8 variants, filled with interpolated state

Reading the Tree Manually

Every conversation path can be traced by hand:

  1. Start at node "id": "START" and follow "next"
  2. At question nodes — pick an option; it stores the answer and tallies a signal
  3. At decision nodes — evaluate "routing" rules top-to-bottom:
    • "A1_OPEN.answer=Productive|Mixed" → check stored answer for node A1_OPEN
    • "axis1.dominant=internal" → check which pole has the higher signal tally
    • "default" → catch-all, always matches
  4. At reflection / bridge nodes — follow "next" after display
  5. At summary — placeholders like {A1_OPEN.answer}, {axis1.dominant}, {summary_note} are filled from accumulated state; summary_note is looked up via the key axis1_dominant|axis2_dominant|axis3_dominant

Example: Tracing the "Frustrating / External / Self" Path

START
  └─▶ A1_OPEN       pick "Frustrating"          signal: –
        └─▶ A1_D1   answer = Frustrating         route: A1_Q_LOW
              └─▶ A1_Q_LOW   pick "Feel stuck"   signal: axis1:external
                    └─▶ A1_D3   dominant=external  route: A1_R_EXT
                          └─▶ A1_R_EXT ──▶ BRIDGE_1_2 ──▶ A2_OPEN
                                                  pick "effort not credited"
                                                  signal: axis2:entitlement
                          └─▶ A2_D1   dominant=entitlement  route: A2_Q_ENTIT
                                └─▶ A2_Q_ENTIT  pick "stayed quiet"
                                                signal: axis2:entitlement
                                      └─▶ A2_D3 ──▶ A2_R_ENTIT ──▶ BRIDGE_2_3
                                            └─▶ A3_OPEN  pick "mainly me"
                                                          signal: axis3:self
                                                  └─▶ A3_D1 ──▶ A3_Q_SELF
                                                        └─▶ A3_Q_SELF  pick "heads-down"
                                                                        signal: axis3:self
                                                              └─▶ A3_D2 ──▶ A3_R_SELF
                                                                    └─▶ BRIDGE_3_SUM ──▶ SUMMARY ──▶ END

  Summary variant: "external|entitlement|self"

Requirements Met

Requirement Minimum This Tree
Total nodes 25+ 30
Question nodes 8+ 9
Decision nodes 4+ 9
Reflection nodes 4+ 6
Bridge nodes 2+ 3
Summary node 1 1
Axes covered 3 3
Options per question 3–5 4
Summary variants 1+ 8

Psychological Frameworks

Framework Author Used In
Locus of Control Rotter (1954) Axis 1 — internal vs external attribution
Growth Mindset Dweck (2006) Axis 1 — fixed vs adaptive framing
Psychological Entitlement Campbell et al. (2004) Axis 2 — entitlement detection
Organizational Citizenship Behavior Organ (1988) Axis 2 — discretionary effort
Self-Transcendence Maslow (1969) Axis 3 — self to altrocentric
Perspective-Taking Batson (2011) Axis 3 — radius of concern

Design Rationale

See write-up.md for the full design rationale, including:

  • Why these specific questions were chosen per axis
  • The branching trade-offs made (two-track vs. single-layer)
  • How each psychological framework maps to the tree's structure
  • What would be improved with more time

Sample Transcripts

Two full transcripts showing the tree branching differently across opposite personas:

File Persona
persona-1-transcript.md Frustrated · Entitled · Self-centric
persona-2-transcript.md Productive · Contributing · Altrocentric

About

A psychologically-grounded employee reflection agent built on a fully deterministic decision tree

Topics

Resources

License

Stars

Watchers

Forks

Contributors

Languages