agent-sin 0.1.15 → 0.1.16

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.
package/CHANGELOG.md CHANGED
@@ -15,6 +15,19 @@ See the [compatibility policy](https://agent.shingoirie.com/versioning) for deta
15
15
 
16
16
  ---
17
17
 
18
+ ## [0.1.16] — 2026-05-24
19
+
20
+ ### Changed
21
+
22
+ - Long-term memory promotion now treats casual conversation as a source of meta-level user understanding, extracting durable preferences, concerns, lifestyle patterns, and decision criteria without storing raw small talk.
23
+ - Memory consolidation keeps broad health and self-improvement concerns when useful, while continuing to avoid detailed sensitive health, finance, family, or third-party information.
24
+
25
+ ### Fixed
26
+
27
+ - `memory.md` consolidation now preserves the generated `Recent 7-day topics` / `直近1週間のトピック` section instead of dropping previously retained days when the long-term body is reorganized.
28
+
29
+ ---
30
+
18
31
  ## [0.1.15] — 2026-05-23
19
32
 
20
33
  ### Added
@@ -305,25 +305,29 @@ async function requestPromotionItems(config, input) {
305
305
  role: "system",
306
306
  content: [
307
307
  "You are Agent-Sin's long-term memory curator. memory.md is a long-term note used to understand the user deeply and keep conversations smooth.",
308
- "Promote observations from daily conversation memory that help understand the user across future conversations. Lean toward promoting when an observation is reasonably supported by user wording; skip only when truly unclear or noisy. Maximum 5 items, zero is fine.",
308
+ "Promote observations and meta-level inferences from daily conversation memory that help understand the user across future conversations. Lean toward promoting when an observation is reasonably supported by user wording; skip only when truly unclear or noisy. Maximum 5 items, zero is fine.",
309
309
  "Assistant responses may be used as context, but do not promote a fact whose only support is an assistant response, tool output, or system context.",
310
310
  "A promoted fact must be grounded in the target-date exchange. Prefer direct user wording; assistant summaries are only supporting context.",
311
311
  "If the user asks whether you remember a previous conversation, do not treat the assistant's recall as a new fact for the target date.",
312
+ "Casual conversation can be high-signal. Do not save raw small talk; extract the durable preference, recurring interest, concern, lifestyle pattern, decision criterion, or work/personal context it implies.",
313
+ "When support is light, avoid overclaiming. Prefer cautious wording such as 'appears interested in', 'is concerned about', 'often discusses', or 'may prefer' when that is more accurate than a hard fact.",
312
314
  "Write each item in the same language as the source daily-conversation.md content.",
313
315
  "Keep only items directly about the user:",
314
316
  "- The user's role, experience, interests, and personal context",
315
317
  "- Communication tendencies, preferred style, disliked expressions, and decision habits",
316
318
  "- Values, beliefs, and things the user considers important",
319
+ "- Lifestyle, health, learning, media, hobby, and product interests when useful for future conversations",
320
+ "- Meta-level patterns inferred from repeated or strongly worded casual chat",
317
321
  "- Notification/channel preferences, subscribed media, preferred formats",
318
322
  "- Stable interests or areas the user is not interested in",
319
323
  "Never keep operating rules, skill settings, or work logs:",
320
324
  "- Schedules, notification timing, notification destinations, filters, limits, or other skill behavior settings",
321
325
  "- Action rules tied to individual emails, files, or usernames",
322
326
  "- Recent task work, commits, fixes, or implementation steps",
323
- "- Same-day chat, impressions, status updates, progress, mood, health, or weather",
327
+ "- Raw same-day events, one-off impressions, transient status updates, or casual chat with no durable signal",
324
328
  "- Tool output, logs, code snippets, or URL lists",
325
329
  "- Content with the same meaning as existing memory.md",
326
- "- Secrets, API keys, tokens, sensitive finance/family information, or information identifying other people",
330
+ "- Secrets, API keys, tokens, detailed or sensitive health/finance/family information, or information identifying other people. Abstract sensitive topics to broad concerns or habits when useful.",
327
331
  "Output rules: each item must be one generic sentence or fact. Do not include dates, ongoing wording, or 'today I...' phrasing.",
328
332
  'Output JSON only: {"items":[{"text":"..."}]}. If nothing qualifies, return {"items":[]}.',
329
333
  ].join("\n"),
@@ -732,6 +736,7 @@ const MEMORY_HEADER_PATTERN = /^# memory\.md\s*$/im;
732
736
  async function consolidateMemoryFile(config, modelId, eventSource) {
733
737
  const file = profileMemoryPath(config, "memory");
734
738
  const original = await readTextIfExists(file);
739
+ const recentTopicsSection = extractRecentTopicsSection(original);
735
740
  const originalWithoutRecentTopics = removeRecentTopicsSection(original);
736
741
  if (!originalWithoutRecentTopics.trim())
737
742
  return;
@@ -754,10 +759,10 @@ async function consolidateMemoryFile(config, modelId, eventSource) {
754
759
  "- Write content in the same language as the original memory.md body.",
755
760
  "- Normalize content under headings to one fact per bullet line starting with '-'. Do not create date headers or 'Auto promotion: ...' / '自動昇格: ...' headings.",
756
761
  "- Merge items with the same meaning. If new information updates old information, discard the old version and rewrite to the latest state.",
757
- "- Prioritize keeping anything useful for understanding the user across future conversations: role, expertise, preferences, values, communication tendencies, decision habits, media preferences, recurring interests, stable dislikes, and long-running themes worth remembering even when they no longer come up daily.",
762
+ "- Prioritize keeping anything useful for understanding the user across future conversations: role, expertise, preferences, values, communication tendencies, decision habits, lifestyle patterns, broad health or self-improvement concerns, media preferences, recurring interests, stable dislikes, and long-running themes worth remembering even when they no longer come up daily.",
758
763
  "- Overlap with the short-lived 'Recent 7-day topics' / '直近1週間のトピック' section is acceptable when the topic is also a durable long-term interest. The recent-topics section is managed separately, so focus this output on the long-term body only.",
759
764
  "- Remove operating rules, schedules, skill behavior settings, specific sender names, filters, raw recent task work, transient progress, and casual chat that has no long-term signal.",
760
- "- Do not keep sensitive finance/family information or information that identifies other people.",
765
+ "- Do not keep detailed or sensitive health/finance/family information or information that identifies other people. Keep only broad, non-identifying concerns or habits when useful.",
761
766
  "- Do not invent content. Do not add facts not present in the source.",
762
767
  "- Each line must be a concise generic sentence or fact. Do not include dates or 'today I...' phrasing.",
763
768
  "- Aim for roughly 40 lines, and up to about 60 lines when there is genuinely durable signal worth preserving. Cut aggressively below this when items are weak or duplicative.",
@@ -776,7 +781,7 @@ async function consolidateMemoryFile(config, modelId, eventSource) {
776
781
  const next = `${headerBlock.replace(/\s+$/, "")}\n\n${cleaned}\n`;
777
782
  if (normalizeForCompare(next) === normalizeForCompare(originalWithoutRecentTopics))
778
783
  return;
779
- await writeFile(file, next, "utf8");
784
+ await writeFile(file, appendPreservedRecentTopicsSection(next, recentTopicsSection), "utf8");
780
785
  await appendEventLog(config, {
781
786
  level: "info",
782
787
  source: eventSource,
@@ -795,6 +800,25 @@ async function consolidateMemoryFile(config, modelId, eventSource) {
795
800
  });
796
801
  }
797
802
  }
803
+ function extractRecentTopicsSection(text) {
804
+ const lines = text.split(/\r?\n/);
805
+ const start = lines.findIndex((line) => recentTopicsHeading(line));
806
+ if (start < 0) {
807
+ return "";
808
+ }
809
+ let end = start + 1;
810
+ while (end < lines.length && !/^#{1,6}\s+\S/.test(lines[end].trim())) {
811
+ end += 1;
812
+ }
813
+ return lines.slice(start, end).join("\n").trim();
814
+ }
815
+ function appendPreservedRecentTopicsSection(body, recentTopicsSection) {
816
+ const recent = recentTopicsSection.trim();
817
+ if (!recent) {
818
+ return body;
819
+ }
820
+ return `${body.replace(/\s+$/, "")}\n\n${recent}\n`;
821
+ }
798
822
  function extractHeaderBlock(raw) {
799
823
  const match = MEMORY_HEADER_PATTERN.exec(raw);
800
824
  if (!match)
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "agent-sin",
3
- "version": "0.1.15",
3
+ "version": "0.1.16",
4
4
  "description": "Program Skill-first personal AI agent OS CLI.",
5
5
  "type": "module",
6
6
  "license": "MIT",