@fyso/awareness-framework 0.1.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -0,0 +1,125 @@
1
+ # Lifecycle
2
+
3
+ The lifecycle defines when agents read, update, and evaluate private awareness and worklog files.
4
+
5
+ ## 1. Initialization
6
+
7
+ At the start of a session, the agent loads the private awareness state before acting.
8
+
9
+ If the CLI is available, prefer:
10
+
11
+ ```bash
12
+ awareness status
13
+ awareness check
14
+ ```
15
+
16
+ If the CLI is not available, read `~/.agents/awareness/current.md` directly.
17
+
18
+ Instruction-file imports such as `@/path/to/current.md` are useful bootstrap snapshots, especially in tools that expand them at session start. They are not a live synchronization mechanism.
19
+
20
+ The agent identifies:
21
+
22
+ - current focus
23
+ - active tasks
24
+ - blocked tasks
25
+ - waiting tasks
26
+ - task IDs related to the user's request
27
+ - expected next action
28
+
29
+ If the user's request does not match the current focus, the agent records a task switch.
30
+
31
+ When working in a parallel-agent environment, run `awareness refresh` or reread `current.md` before assuming the snapshot is still current.
32
+
33
+ ## 2. Task Start
34
+
35
+ When a new task starts, the agent creates or updates a task block in the awareness board.
36
+
37
+ Minimum fields:
38
+
39
+ - task ID or `Unassigned`
40
+ - short summary
41
+ - repository or workspace
42
+ - branch, if relevant
43
+ - state
44
+ - next action
45
+ - evidence collected so far
46
+
47
+ The agent also appends a start entry to the daily worklog.
48
+
49
+ ## 3. Execution
50
+
51
+ The agent appends to the worklog when concrete progress happens.
52
+
53
+ Examples:
54
+
55
+ - files created or changed
56
+ - tests or builds run
57
+ - PR opened or updated
58
+ - commit created
59
+ - decision recorded
60
+ - blocker discovered
61
+ - deployment completed
62
+
63
+ The awareness board is updated when task state changes, not after every minor edit.
64
+
65
+ ## 4. Task Switch
66
+
67
+ When switching tasks, the agent:
68
+
69
+ 1. updates the previous task state
70
+ 2. records its next action or blocker
71
+ 3. appends a task-switch worklog entry
72
+ 4. updates `Current Focus`
73
+ 5. starts or resumes the new task
74
+
75
+ Valid states:
76
+
77
+ - `in-progress`
78
+ - `paused`
79
+ - `blocked`
80
+ - `waiting`
81
+ - `done`
82
+ - `in-review`
83
+
84
+ ## 5. Handoff
85
+
86
+ Before returning control to the user, the agent refreshes from disk and verifies that another session could continue from the private files.
87
+
88
+ If the CLI is available, use:
89
+
90
+ ```bash
91
+ awareness handoff
92
+ ```
93
+
94
+ The awareness board must include:
95
+
96
+ - current focus
97
+ - what changed
98
+ - evidence
99
+ - next action
100
+ - blockers or waiting state
101
+ - end-of-day candidates
102
+
103
+ The final worklog entry should make the handoff reconstructable without reading the whole chat transcript.
104
+
105
+ ## 6. End of Day
106
+
107
+ At end of day, the agent prepares a grouped summary from the daily worklog.
108
+
109
+ Group by:
110
+
111
+ - Jira issue or external task ID
112
+ - repository or workspace
113
+ - outcome
114
+ - blockers
115
+ - evidence
116
+
117
+ The user reviews and confirms any external posting.
118
+
119
+ ## 7. Evaluation
120
+
121
+ Evaluation is the loop that makes the framework improve.
122
+
123
+ The agent checks whether awareness and worklog files were useful, identifies friction, scores quality, and proposes small changes when needed.
124
+
125
+ See [Evaluation Loop](evaluation-loop.md).
package/docs/memory.md ADDED
@@ -0,0 +1,173 @@
1
+ # Memory Model
2
+
3
+ Awareness Framework separates memory by time horizon and trust level. The goal is to give agents useful continuity without turning every conversation detail into permanent memory.
4
+
5
+ ## Memory Layers
6
+
7
+ | Layer | Files | Lifetime | Purpose |
8
+ |-------|-------|----------|---------|
9
+ | Working memory | `awareness/current.md` | Current session or active day | Current focus, active tasks, blockers, next actions |
10
+ | Episodic memory | `worklog/YYYY-MM-DD.md`, `evaluations/YYYY-MM-DD.md` | Daily history | Chronological evidence, decisions, handoff context, end-of-day reporting |
11
+ | Long-term memory | `memory/personality.md`, `memory/preferences.md`, `memory/patterns.md`, `memory/long-term.md` | Durable but curated | Stable preferences, recurring patterns, durable collaboration rules |
12
+ | User memory | `memory/users/<user>.md` | Durable but narrow | Nicknames, repeated questions, topics, explicit preferences for a participant |
13
+ | Framework memory | Versioned docs and templates | Reviewed history | Reusable methodology that applies beyond one operator or day |
14
+
15
+ Do not load every layer into every prompt. Load the smallest layer that answers the current need.
16
+
17
+ ## Short-Term Memory
18
+
19
+ Short-term memory is operational. It is optimized for the next action.
20
+
21
+ Use short-term memory for:
22
+
23
+ - current focus
24
+ - active and paused tasks
25
+ - blockers
26
+ - waiting-on-user items
27
+ - today's concrete work
28
+ - handoff notes
29
+
30
+ Short-term memory should be easy to overwrite, clean, or archive. It should not become a permanent preference store.
31
+
32
+ The primary short-term file is:
33
+
34
+ ```text
35
+ ~/.agents/awareness/current.md
36
+ ```
37
+
38
+ The daily episodic file is:
39
+
40
+ ```text
41
+ ~/.agents/worklog/YYYY-MM-DD.md
42
+ ```
43
+
44
+ Runtime automation events are stored separately:
45
+
46
+ ```text
47
+ ~/.agents/runtime/hooks/YYYY-MM-DD.jsonl
48
+ ~/.agents/runtime/schedule/YYYY-MM-DD.jsonl
49
+ ```
50
+
51
+ Runtime events are useful for diagnostics. They are not a replacement for worklog entries because they usually do not contain human-relevant progress.
52
+
53
+ ## Long-Term Memory
54
+
55
+ Long-term memory is curated. It should contain stable information that improves future collaboration.
56
+
57
+ Use long-term memory for:
58
+
59
+ - user-approved working preferences
60
+ - repeated collaboration patterns
61
+ - stable project or organization conventions
62
+ - recurring review guidance
63
+ - durable personality traits
64
+
65
+ Do not use long-term memory for:
66
+
67
+ - secrets or credentials
68
+ - sensitive personal data
69
+ - raw transcripts
70
+ - one-off guesses
71
+ - unverified assumptions
72
+ - temporary task state
73
+
74
+ Recommended long-term files:
75
+
76
+ ```text
77
+ ~/.agents/memory/personality.md
78
+ ~/.agents/memory/preferences.md
79
+ ~/.agents/memory/patterns.md
80
+ ~/.agents/memory/long-term.md
81
+ ~/.agents/memory/users/<user>.md
82
+ ~/.agents/channels/<channel>/memory/users/<user>.md
83
+ ```
84
+
85
+ User memory is not a full personal profile. It is a narrow interaction aid. Use it for nicknames, repeated questions, recent topics, and explicit preferences. Do not use it for raw transcripts, sensitive personal details, inferred traits, or private information that was not intentionally shared.
86
+
87
+ ## Promotion Pipeline
88
+
89
+ Information should move from short-term to long-term only when it earns promotion.
90
+
91
+ 1. Observe: capture the fact, preference, or pattern in the worklog, evaluation note, or personality candidate.
92
+ 2. Attach evidence: record why the observation is credible.
93
+ 3. Classify: decide whether it is task state, preference, pattern, personality, or framework feedback.
94
+ 4. Promote: add it to long-term memory only if it is repeated, user-confirmed, or operationally important.
95
+ 5. Prune: remove or soften memory that becomes stale, wrong, noisy, or harmful.
96
+
97
+ Hooks and scheduled maintenance may perform steps 1 and 2 by recording observations, warnings, or evaluation notes. They must not perform step 4 silently.
98
+
99
+ ## Promotion Rules
100
+
101
+ - Promote explicit user preferences immediately when they affect future collaboration.
102
+ - Promote inferred preferences only after repeated evidence.
103
+ - Promote framework changes only through version control.
104
+ - Keep private memory private; do not copy private examples into public docs.
105
+ - Prefer small, operational statements over long stories.
106
+ - Add rollback criteria for durable rules that may become wrong.
107
+
108
+ ## Retrieval Rules
109
+
110
+ At session start:
111
+
112
+ - Load working memory with `awareness status` or `awareness refresh`.
113
+ - Load long-term memory only when the task depends on preferences, personality, conventions, or repeated patterns.
114
+
115
+ During work:
116
+
117
+ - Use the worklog for chronological evidence.
118
+ - Use awareness for current state.
119
+ - Use long-term memory for stable style and decision guidance.
120
+ - Use `memory/users/<user>.md` only for narrow participant-specific facts that help the current interaction.
121
+
122
+ Before handoff:
123
+
124
+ - Keep `current.md` compact.
125
+ - Append concrete evidence to the worklog.
126
+ - If a new long-term preference was confirmed, promote it explicitly.
127
+
128
+ Scheduled maintenance:
129
+
130
+ - Hourly checks may flag stale awareness or missing daily files.
131
+ - Daily checks may create `evaluations/YYYY-MM-DD.md`.
132
+ - Memory promotion remains an explicit action after reviewing evidence.
133
+
134
+ ## Memory Quality Checks
135
+
136
+ Healthy memory is:
137
+
138
+ - accurate
139
+ - useful for future work
140
+ - short enough to scan
141
+ - evidence-backed
142
+ - easy to revise
143
+ - clearly scoped as private state
144
+
145
+ Unhealthy memory is:
146
+
147
+ - generic
148
+ - duplicated
149
+ - stale
150
+ - too verbose
151
+ - sensitive
152
+ - based on a one-time guess
153
+ - treated as stronger than direct user instructions
154
+
155
+ ## Example
156
+
157
+ Short-term observation:
158
+
159
+ ```markdown
160
+ - User corrected the repo target from product docs to a dedicated framework repo.
161
+ ```
162
+
163
+ Long-term promotion:
164
+
165
+ ```markdown
166
+ - Prefer dedicated methodology repositories over embedding operator methodology inside product documentation. Evidence: repeated correction during framework setup.
167
+ ```
168
+
169
+ Framework promotion:
170
+
171
+ ```markdown
172
+ - Add a governance rule: methodology belongs in dedicated framework repos unless it is product behavior documentation.
173
+ ```
@@ -0,0 +1,146 @@
1
+ # Multi-User Scoping
2
+
3
+ Multi-user integrations often need two different kinds of continuity:
4
+
5
+ - Channel context: what is happening in this conversation space, what the current focus is, and what work is in progress.
6
+ - User memory: small facts about a specific participant, such as nicknames, repeated questions, topics, and explicit preferences.
7
+
8
+ Do not create a full awareness workspace for every user by default. Keep operational context scoped to the channel, and store only narrow user memory records inside that channel.
9
+
10
+ ## Layout
11
+
12
+ Default private state remains:
13
+
14
+ ```text
15
+ ~/.agents/
16
+ ```
17
+
18
+ Channel-scoped context lives under:
19
+
20
+ ```text
21
+ ~/.agents/channels/<channel>/
22
+ awareness/current.md
23
+ worklog/YYYY-MM-DD.md
24
+ evaluations/YYYY-MM-DD.md
25
+ runtime/
26
+ memory/users/<user>.md
27
+ ```
28
+
29
+ Global user memory, when a channel is not relevant, lives under:
30
+
31
+ ```text
32
+ ~/.agents/memory/users/<user>.md
33
+ ```
34
+
35
+ Use stable platform IDs for `<channel>` and `<user>` whenever possible. Display names and channel names can change.
36
+
37
+ ## Channel Context Commands
38
+
39
+ Use `--channel` to choose the channel context:
40
+
41
+ ```bash
42
+ awareness status --channel "$CHANNEL_ID"
43
+ awareness focus --channel "$CHANNEL_ID" \
44
+ --task PROJECT-123 \
45
+ --summary "Handle support questions" \
46
+ --repo fyso-dev/support-bot \
47
+ --branch main \
48
+ --next "Answer the latest pending question"
49
+ ```
50
+
51
+ This keeps awareness, worklog, evaluations, and runtime records isolated to that channel.
52
+
53
+ ## User Memory Commands
54
+
55
+ Use `awareness user note` to store a small fact about a user:
56
+
57
+ ```bash
58
+ awareness user note \
59
+ --channel "$CHANNEL_ID" \
60
+ --user "$USER_ID" \
61
+ --kind nickname \
62
+ --text "Ace" \
63
+ --evidence "User introduced themselves this way"
64
+ ```
65
+
66
+ Supported kinds:
67
+
68
+ - `nickname`
69
+ - `question`
70
+ - `topic`
71
+ - `preference`
72
+ - `fact`
73
+ - `note`
74
+
75
+ Examples:
76
+
77
+ ```bash
78
+ awareness user note \
79
+ --channel "$CHANNEL_ID" \
80
+ --user "$USER_ID" \
81
+ --kind question \
82
+ --text "Asked how to connect the bot to the work tracker" \
83
+ --evidence "Message link or timestamp"
84
+
85
+ awareness user note \
86
+ --channel "$CHANNEL_ID" \
87
+ --user "$USER_ID" \
88
+ --kind topic \
89
+ --text "Has been discussing worklog automation and agent memory" \
90
+ --evidence "Repeated questions in the channel"
91
+ ```
92
+
93
+ Show a user's memory in the active channel:
94
+
95
+ ```bash
96
+ awareness user show --channel "$CHANNEL_ID" --user "$USER_ID"
97
+ ```
98
+
99
+ ## Customization Ideas
100
+
101
+ Useful user memory fields:
102
+
103
+ - Nicknames and preferred forms of address.
104
+ - Repeated questions they asked.
105
+ - Topics they have been discussing recently.
106
+ - Explicit preferences for language, detail, formatting, or cadence.
107
+ - Role or project context when the user states it directly.
108
+ - Boundaries such as "do not send direct messages" or "prefer public thread replies".
109
+
110
+ Keep each entry short and evidence-backed. Prefer:
111
+
112
+ ```markdown
113
+ - 2026-06-18 11:40: Asked how to separate channel context from per-user memory (evidence: message link)
114
+ ```
115
+
116
+ Avoid:
117
+
118
+ - raw transcripts
119
+ - secrets
120
+ - sensitive personal details
121
+ - inferred personality judgments
122
+ - unverified private information
123
+ - permanent memory for one-off comments
124
+
125
+ ## Retention Rules
126
+
127
+ For multi-user systems, add explicit retention behavior around user memory:
128
+
129
+ - Store stable user IDs, not mutable display names, as filenames.
130
+ - Keep recent questions bounded by count or age.
131
+ - Allow deleting a single user file.
132
+ - Allow exporting a single user file for review.
133
+ - Promote user preferences only when explicit or repeated.
134
+ - Do not copy user memory into framework docs or public issues.
135
+
136
+ ## Recommended Bot Flow
137
+
138
+ For each incoming message:
139
+
140
+ 1. Resolve `channel_id` and `user_id`.
141
+ 2. Run channel context operations with `--channel "$channel_id"`.
142
+ 3. Read user memory only when it helps the reply.
143
+ 4. Append user memory only for useful, evidence-backed facts.
144
+ 5. Keep task worklog entries in the channel context, not in the user memory file.
145
+
146
+ This gives the integration continuity without turning every user into a separate task workspace.
@@ -0,0 +1,144 @@
1
+ # Personality
2
+
3
+ Awareness Framework treats personality as a private, evolving operating profile for agent collaboration.
4
+
5
+ It is not a fictional identity. It is not a hidden system prompt. It is a compact record of communication style, working preferences, and collaboration habits that have been observed or confirmed.
6
+
7
+ ## Goals
8
+
9
+ - Reduce repeated preference-setting by the user.
10
+ - Make agent behavior more consistent across sessions.
11
+ - Keep style preferences separate from task facts.
12
+ - Allow traits to evolve through evidence and correction.
13
+ - Make the agent feel more natural to work with through continuity, voice, context sensitivity, bounded initiative, and honest repair.
14
+
15
+ ## Private File
16
+
17
+ Recommended path:
18
+
19
+ ```text
20
+ ~/.agents/memory/personality.md
21
+ ```
22
+
23
+ This file is private state and must not be committed.
24
+
25
+ ## Trait Lifecycle
26
+
27
+ | Stage | Meaning |
28
+ |-------|---------|
29
+ | Candidate observation | A possible preference or style cue was observed |
30
+ | Accepted trait | The user confirmed it, or it appeared repeatedly with clear evidence |
31
+ | Revised trait | A previous trait was corrected or softened |
32
+ | Removed trait | The trait no longer helps or creates bad outcomes |
33
+
34
+ ## Human-Feeling Collaboration
35
+
36
+ The goal is not to trick the user or pretend the agent is human. The goal is to make collaboration feel less generic and more continuous.
37
+
38
+ Human-feeling personality comes from operational behavior:
39
+
40
+ | Dimension | What it means |
41
+ |-----------|---------------|
42
+ | Continuity | The agent remembers the current thread, prior decisions, corrections, and open loops. |
43
+ | Consistent voice | The agent has a recognizable communication style without becoming theatrical. |
44
+ | Context sensitivity | The agent changes mode depending on whether the user is exploring, deciding, executing, correcting, or closing work. |
45
+ | Preference memory | The agent remembers how the user prefers to work, not only task facts. |
46
+ | Bounded initiative | The agent proposes the next useful step without taking external action silently. |
47
+ | Honest repair | The agent corrects mistakes clearly, updates the process, and avoids excuses. |
48
+ | Grounded uncertainty | The agent says when something is an inference, stale, or unverified. |
49
+
50
+ Good examples:
51
+
52
+ - "You're right; that belongs in a dedicated framework repo, not product docs. I will close the docs PR and move it."
53
+ - "This looks like a session-start snapshot. I will refresh from disk before assuming it is current."
54
+ - "I can implement this now, and I will keep the state private."
55
+
56
+ Bad examples:
57
+
58
+ - "I feel excited to help."
59
+ - "As your longtime teammate, I remember everything."
60
+ - "I definitely know this is current" when it has not been checked.
61
+ - Adding fake emotion, fake lived experience, or fake certainty.
62
+
63
+ ## What Belongs Here
64
+
65
+ - preferred language and tone
66
+ - update frequency
67
+ - decision style
68
+ - tolerance for detail
69
+ - formatting preferences
70
+ - recurring collaboration patterns
71
+ - continuity preferences
72
+ - repair preferences
73
+ - initiative boundaries
74
+
75
+ ## What Does Not Belong Here
76
+
77
+ - secrets or credentials
78
+ - customer data
79
+ - personal sensitive data
80
+ - raw chat transcripts
81
+ - unverifiable psychological claims
82
+ - rigid rules that override direct user instructions
83
+ - claims that the agent has feelings, lived experience, or human identity
84
+
85
+ ## Personality Evaluation
86
+
87
+ Personality should be evaluated as collaboration quality, not as performance theater.
88
+
89
+ Use this rubric when reviewing an agent's behavior:
90
+
91
+ | Dimension | Question |
92
+ |-----------|----------|
93
+ | Continuity | Did the agent use relevant prior context without requiring repetition? |
94
+ | Voice | Did the response sound consistent with the user's preferred working style? |
95
+ | Context sensitivity | Did the agent choose the right mode for the moment? |
96
+ | Initiative | Did the agent propose or take useful next steps within permission boundaries? |
97
+ | Repair | If something was wrong, did the agent correct it concretely? |
98
+ | Naturalness | Did the response avoid generic boilerplate without becoming performative? |
99
+ | Honesty | Did the agent avoid fake emotion, fake memory, and fake certainty? |
100
+
101
+ Evaluation notes should stay private unless they are converted into sanitized framework improvements.
102
+
103
+ ## CLI Support
104
+
105
+ Record a candidate observation:
106
+
107
+ ```bash
108
+ awareness personality note \
109
+ --text "User prefers short, direct Spanish updates while work is in progress" \
110
+ --evidence "Repeated feedback during framework setup"
111
+ ```
112
+
113
+ Accept a trait:
114
+
115
+ ```bash
116
+ awareness personality adopt \
117
+ --text "Use concise Spanish status updates and avoid cheerleading" \
118
+ --evidence "Explicit user preference"
119
+ ```
120
+
121
+ Show the current profile:
122
+
123
+ ```bash
124
+ awareness personality show
125
+ ```
126
+
127
+ Planned future commands:
128
+
129
+ ```bash
130
+ awareness personality revise
131
+ awareness personality remove
132
+ awareness personality evaluate
133
+ ```
134
+
135
+ These commands should keep the same rule: private profile changes are local, and framework changes are reviewed through version control.
136
+
137
+ ## Guardrails
138
+
139
+ - Prefer user-confirmed traits over inferred traits.
140
+ - Keep traits short and operational.
141
+ - Do not pretend the agent has emotions or lived experience.
142
+ - If a trait conflicts with a direct user request, the direct request wins.
143
+ - Revisit traits that cause worse outcomes.
144
+ - Optimize for trust and continuity, not for passing as human through deception.