@adam0white/human-framework 2.2.0 → 2.2.1
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/README.md +3 -3
- package/dist/index.d.ts +1 -1
- package/dist/index.js +1 -1
- package/dist/methods/methods.d.ts +1 -1
- package/dist/methods/methods.js +6 -7
- package/dist/migrate.js +6 -1
- package/dist/types.d.ts +6 -2
- package/dist/types.js +6 -2
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -177,13 +177,13 @@ reference host: `createVillage`.
|
|
|
177
177
|
|
|
178
178
|
There are two version numbers, and they move independently.
|
|
179
179
|
|
|
180
|
-
- **The release version** is the package version (`package.json`, now `2.2.
|
|
180
|
+
- **The release version** is the package version (`package.json`, now `2.2.1`) and `FRAMEWORK_VERSION`, the same
|
|
181
181
|
string compiled into the build; a test keeps them equal. It versions the public API under
|
|
182
182
|
[semver](https://semver.org/): a breaking change to an exported name or signature bumps the major, a new
|
|
183
183
|
faculty or export the minor, a fix the patch. Each release is a tag `vX.Y.Z` and a GitHub release whose notes
|
|
184
184
|
are that version's section of the root [CHANGELOG.md](../../CHANGELOG.md), with the package tarball attached
|
|
185
185
|
(`npm run release`, run on a clean, pushed `main`).
|
|
186
|
-
- **`ENGINE_VERSION`** (exported; `2.
|
|
186
|
+
- **`ENGINE_VERSION`** (exported; `2.2.0` at release 2.2.1) versions simulation behaviour and the save format. It
|
|
187
187
|
changes when the same seed and inputs would give different decisions, or when person state changes shape.
|
|
188
188
|
`restore` upgrades saves from engine 1.4.0 and later through `migrate` and refuses older ones. Every release's notes name the
|
|
189
189
|
`ENGINE_VERSION` it ships, so a host can tell whether its saves still restore.
|
|
@@ -301,4 +301,4 @@ const evidence = methodEvidence(learner, 'send-north', 'new-parcel');
|
|
|
301
301
|
clearMethodContext(learner); // when leaving or switching the task
|
|
302
302
|
```
|
|
303
303
|
|
|
304
|
-
Import these functions from the package. Rules/evidence live in optional `Person.methods` and survive snapshots. Current cues expire after 120 minutes. A stable demonstration id avoids counting the same example twice within the retained 256-example history, even after its rule or evidence is evicted. Once an id has left both that history and retained rule evidence, it can be admitted again. Missing observations cannot satisfy a condition
|
|
304
|
+
Import these functions from the package. Rules/evidence live in optional `Person.methods` and survive snapshots. Current cues expire after 120 minutes. A stable demonstration id avoids counting the same example twice within the retained 256-example history, even after its rule or evidence is evicted. Once an id has left both that history and retained rule evidence, it can be admitted again. Missing observations cannot satisfy a condition. Failed demonstrations reduce support for that action. Successful alternatives retain their own support; ordinary cognition weighs the supported offers alongside other motives. A successful lecture does not certify reliable execution. [The routing control](examples/method-control.ts) demonstrates changed teaching, withheld teaching, a scalar-skill control and acquired-state ablation with two methods and an exception. [The alternatives control](examples/method-alternatives-control.ts) demonstrates two independently successful procedures under the same observations, failed practice, hunger and exact restore.
|
package/dist/index.d.ts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
/** Human Framework v1 public surface. */
|
|
2
|
-
export declare const FRAMEWORK_VERSION = "2.2.
|
|
2
|
+
export declare const FRAMEWORK_VERSION = "2.2.1";
|
|
3
3
|
export type { CrisisEvent, PracticeKind } from './affect/index.ts';
|
|
4
4
|
export { AFFECT_DEFAULTS, actionTendencies, advanceAffect, appraise, breakAllows, breakBehaviour, breakHazard, CRISIS_DEFAULTS, checkCrisis, createAffect, easeBreak, emotionLevel, enableBreaks, feel, inBreak, readAffect, regulate, release as releaseEmotion, skipCrisis, strain, tendencyEmotions, } from './affect/index.ts';
|
|
5
5
|
export type { GoalTemplate, PrayerCalendar, PrayerSchedule, PrayerTimes, Retimer, } from './agenda/index.ts';
|
package/dist/index.js
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
/** Human Framework v1 public surface. */
|
|
2
|
-
export const FRAMEWORK_VERSION = '2.2.
|
|
2
|
+
export const FRAMEWORK_VERSION = '2.2.1';
|
|
3
3
|
export { AFFECT_DEFAULTS, actionTendencies, advanceAffect, appraise, breakAllows, breakBehaviour, breakHazard, CRISIS_DEFAULTS, checkCrisis, createAffect, easeBreak, emotionLevel, enableBreaks, feel, inBreak, readAffect, regulate, release as releaseEmotion, skipCrisis, strain, tendencyEmotions, } from './affect/index.js';
|
|
4
4
|
// `agenda.release` collides with `affect.release`; the agenda one is re-exported under a clearer name.
|
|
5
5
|
export { AGENDA_DEFAULTS, abandonGoal, adoptGoal, advanceAgenda, agendaTerms, applyExemptions, CARE_DEFAULTS, calendarRetimer, careDuty, commitmentPressure, createAgenda, DEFAULT_PRAYER_TIMES, EID_PRAYER_IMPORTANCE, EXEMPTION_DEFAULTS, eidPrayer, eidWindow, fastWindow, iftarWindow, inMakruhTime, isUnderWay, MAKRUH_DEFAULTS, makruhWindows, missedExcuse, onFinished, owedMakeUps, PRAYER_IMPORTANCE, PURPOSE_DEFAULTS, prayerWindows, pressureReachedAt, promise, proposeGoals, RAMADAN_DEFAULTS, ramadanFast, ramadanMeals, release as releaseCommitment, retimeCommitments, revisePurposes, scheduleMakeUp, spanMeetsWindow, suhoorWindow, timesFor, violatesAbstention, } from './agenda/index.js';
|
|
@@ -27,7 +27,7 @@ export interface MethodDemonstration {
|
|
|
27
27
|
attention?: number;
|
|
28
28
|
}
|
|
29
29
|
export interface MethodEvidence {
|
|
30
|
-
/** Net matching evidence for this action, -1..1;
|
|
30
|
+
/** Net matching evidence for this action, -1..1; its failures reduce it. */
|
|
31
31
|
support: number;
|
|
32
32
|
terms: Term[];
|
|
33
33
|
matched: {
|
package/dist/methods/methods.js
CHANGED
|
@@ -4,8 +4,9 @@
|
|
|
4
4
|
* Successful and unsuccessful demonstrations become person-owned evidence; the
|
|
5
5
|
* same reader supplies host queries and ordinary cognition terms. Unknown cues
|
|
6
6
|
* do not mean false. Context identity prevents one task's observations being used
|
|
7
|
-
* for another task.
|
|
8
|
-
*
|
|
7
|
+
* for another task. Failed examples weaken that action without choosing a hidden
|
|
8
|
+
* correct answer. Successful alternatives retain their own support. Attention,
|
|
9
|
+
* source trust and recency grade evidence.
|
|
9
10
|
* These are explicit engineering choices, not fitted human learning parameters.
|
|
10
11
|
* This module does not infer cues, invent actions, plan sequences, certify skill,
|
|
11
12
|
* access host truth, compute religious worth, or guarantee that a person obeys.
|
|
@@ -155,15 +156,13 @@ export function methodEvidence(p, action, contextId) {
|
|
|
155
156
|
result.matched.push({ id: rule.id, action: rule.action, sourceId, support });
|
|
156
157
|
}
|
|
157
158
|
}
|
|
158
|
-
//
|
|
159
|
+
// A successful alternative is not evidence that this action failed. Each action
|
|
160
|
+
// retains its own signed support; ordinary cognition weighs all legal offers.
|
|
159
161
|
const strengths = new Map();
|
|
160
162
|
for (const match of result.matched)
|
|
161
163
|
strengths.set(match.action, (strengths.get(match.action) ?? 0) + match.support);
|
|
162
164
|
const own = strengths.get(action) ?? 0;
|
|
163
|
-
|
|
164
|
-
const total = Math.max(1, ...[...strengths.values()].map((v) => Math.abs(v)));
|
|
165
|
-
const net = own > 0 ? Math.max(0, own - rival) : own;
|
|
166
|
-
result.support = Math.max(-1, Math.min(1, net / total));
|
|
165
|
+
result.support = own / Math.max(1, Math.abs(own));
|
|
167
166
|
const scale = own === 0 ? 0 : result.support / own;
|
|
168
167
|
for (const match of result.matched) {
|
|
169
168
|
if (match.action !== action || match.support === 0)
|
package/dist/migrate.js
CHANGED
|
@@ -8,7 +8,7 @@
|
|
|
8
8
|
* field of the optional surroundings slice (`ambient.now` → `ambient.percept`) and changes no behaviour (the optional `social.impressions` and `social.reserve`, like `retention`, are optional and start
|
|
9
9
|
* absent in a migrated save); `restore` then fills and sanitizes
|
|
10
10
|
* the slices as for any save. 2.0.0 to 2.1.0 adds optional conditional method state, absent
|
|
11
|
-
* until explicitly used, so existing hosts retain their previous behavior; that step stamps the version. A migrated save continues under the current engine's rules: it restores and runs,
|
|
11
|
+
* until explicitly used, so existing hosts retain their previous behavior; that step stamps the version. 2.1.0 to 2.2.0 preserves optional method records and stamps the version; successful alternatives now retain independent support. A migrated save continues under the current engine's rules: it restores and runs,
|
|
12
12
|
* but it does not reproduce what the old engine would have done next where the rules changed (1.4.0 to 1.5.0
|
|
13
13
|
* changed how standing advice is heard; 1.8.0 to 1.9.0 changed the omission rule). Saves older than 1.4.0 and unknown versions are refused with an error.
|
|
14
14
|
*
|
|
@@ -58,6 +58,11 @@ export const MIGRATIONS = {
|
|
|
58
58
|
note: 'the surroundings field `ambient.now` is renamed `ambient.percept`; per-person retention is optional and starts absent; behaviour unchanged',
|
|
59
59
|
apply: renameAmbient,
|
|
60
60
|
},
|
|
61
|
+
'2.1.0': {
|
|
62
|
+
to: '2.2.0',
|
|
63
|
+
note: 'person shape unchanged; method evidence now grades each action independently, preserving successful alternatives',
|
|
64
|
+
apply: stamp,
|
|
65
|
+
},
|
|
61
66
|
'2.0.0': {
|
|
62
67
|
to: '2.1.0',
|
|
63
68
|
note: 'conditional method state and received cues are optional and start absent; existing host decisions unchanged',
|
package/dist/types.d.ts
CHANGED
|
@@ -787,7 +787,11 @@ export interface Activity {
|
|
|
787
787
|
}
|
|
788
788
|
export declare const PERSON_SCHEMA = "human/person@1";
|
|
789
789
|
/**
|
|
790
|
-
* Current: 2.
|
|
790
|
+
* Current: 2.2.0 (2026-10-14): method evidence grades each action independently.
|
|
791
|
+
* Successful alternatives no longer count as failures of another action. Person state shape is unchanged.
|
|
792
|
+
* 2.1.0 saves migrate by stamping the version.
|
|
793
|
+
*
|
|
794
|
+
* 2.1.0 (2026-10-10): optional acquired conditional methods and explicit received cue contexts.
|
|
791
795
|
* Normal cognition reads learned method evidence only on offers carrying the matching context.
|
|
792
796
|
* Existing hosts with no method state keep their previous decisions; 2.0.0 saves migrate by stamping the version.
|
|
793
797
|
*
|
|
@@ -818,7 +822,7 @@ export declare const PERSON_SCHEMA = "human/person@1";
|
|
|
818
822
|
* and an activity that would cover a closing stretch is reviewed when the stretch begins (`isUnderWay`,
|
|
819
823
|
* `dutyReviewAt`). Person shape unchanged.
|
|
820
824
|
*/
|
|
821
|
-
export declare const ENGINE_VERSION = "2.
|
|
825
|
+
export declare const ENGINE_VERSION = "2.2.0";
|
|
822
826
|
/** A pregnancy carried by this person (host-driven; see `family/`). */
|
|
823
827
|
export interface Pregnancy {
|
|
824
828
|
fatherId: PersonId;
|
package/dist/types.js
CHANGED
|
@@ -84,7 +84,11 @@ export const EMOTIONS = [
|
|
|
84
84
|
// ---------------------------------------------------------------------------------------------
|
|
85
85
|
export const PERSON_SCHEMA = 'human/person@1';
|
|
86
86
|
/**
|
|
87
|
-
* Current: 2.
|
|
87
|
+
* Current: 2.2.0 (2026-10-14): method evidence grades each action independently.
|
|
88
|
+
* Successful alternatives no longer count as failures of another action. Person state shape is unchanged.
|
|
89
|
+
* 2.1.0 saves migrate by stamping the version.
|
|
90
|
+
*
|
|
91
|
+
* 2.1.0 (2026-10-10): optional acquired conditional methods and explicit received cue contexts.
|
|
88
92
|
* Normal cognition reads learned method evidence only on offers carrying the matching context.
|
|
89
93
|
* Existing hosts with no method state keep their previous decisions; 2.0.0 saves migrate by stamping the version.
|
|
90
94
|
*
|
|
@@ -115,4 +119,4 @@ export const PERSON_SCHEMA = 'human/person@1';
|
|
|
115
119
|
* and an activity that would cover a closing stretch is reviewed when the stretch begins (`isUnderWay`,
|
|
116
120
|
* `dutyReviewAt`). Person shape unchanged.
|
|
117
121
|
*/
|
|
118
|
-
export const ENGINE_VERSION = '2.
|
|
122
|
+
export const ENGINE_VERSION = '2.2.0';
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@adam0white/human-framework",
|
|
3
|
-
"version": "2.2.
|
|
3
|
+
"version": "2.2.1",
|
|
4
4
|
"description": "Deterministic, explainable simulated people: body, needs, affect, memory, beliefs, skills, habits, relationships, values and a will that can refuse a suggestion",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"simulation",
|