teimmo 0.0.0-stage → 0.7.8
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/LICENSE +201 -0
- package/NOTICE +30 -0
- package/README.md +292 -2
- package/artifacts.mjs +232 -0
- package/cli.mjs +757 -0
- package/context.mjs +45 -0
- package/dashboard-state.mjs +220 -0
- package/dashboard-ui.mjs +128 -0
- package/dashboard.mjs +133 -0
- package/domain.mjs +80 -0
- package/evidence.mjs +58 -0
- package/native-workspace.mjs +49 -0
- package/obligations.mjs +35 -0
- package/package.json +62 -4
- package/regression-supersession.mjs +65 -0
- package/replan.mjs +48 -0
- package/runners/unittest_evidence.py +59 -0
- package/runtime.mjs +181 -0
- package/skillpack.mjs +112 -0
- package/workspace-layout.mjs +39 -0
package/skillpack.mjs
ADDED
|
@@ -0,0 +1,112 @@
|
|
|
1
|
+
import fs from 'node:fs';
|
|
2
|
+
import {workspaceGuide} from './workspace-layout.mjs';
|
|
3
|
+
import path from 'node:path';
|
|
4
|
+
import {fileURLToPath} from 'node:url';
|
|
5
|
+
import {assert,readJson,relativeFile,write,digest,applyFiles} from './artifacts.mjs';
|
|
6
|
+
|
|
7
|
+
const modes={
|
|
8
|
+
brainstorm:{description:'Discuss a new product idea or clarify business behavior in TeImMo. Capture scope, sourced decisions and unresolved questions before implementation.',procedure:`Start by loading context if this project exists. If setup already prepared the workspace, do not run new or domain init again. For an uninitialized workspace use setup with the actual user idea. A Project discovery title is only a setup label: ask for the actual product idea and record it in brief and domain before defining scope. Discuss the problem, target actors, current alternatives and success criteria before choosing architecture. Ask at most three high-impact questions per turn, explain tradeoffs, and wait for answers. Do not answer business questions on the user's behalf. Small reversible technical defaults can be marked proposed.
|
|
9
|
+
|
|
10
|
+
Use the domain reference to record facts, vocabulary, actors, scope boundaries, business rules and Given/When/Then cases. Examine relevant state transitions, permission boundaries, failure and retry paths across the project; identify module dependencies without expanding the MVP. Mark irrelevant dimensions na with a reason. Leave unresolved dimensions unreviewed. Save known progress even when questions remain. Do not launch the unattended runner during brainstorming. End with what is confirmed, the most consequential unknowns and the next decision.`,next:'spec'},
|
|
11
|
+
spec:{description:'Turn confirmed TeImMo business decisions into measurable requirements and case coverage, without implementing product code.',procedure:`Read context and domain.json, including previously accepted behavior. Reconcile unresolved blocking questions before claiming specification readiness. Reuse existing IDs and sources; capture changes instead of silently rewriting confirmed policy. Each rule needs actor/preconditions/outcome and at least one observable case. Negative paths and boundaries need expected outcomes, not labels such as "handle errors".
|
|
12
|
+
|
|
13
|
+
When asked to generate specification artifacts, run the runner only through its planning boundary (run or discuss as appropriate); it stops at WAITING_APPROVAL. Review generated requirements against domain cases. Add case criteria/check mappings to the domain through domain save. Report contradictions as blocking questions and preserve the old records. Never run approve or implementation from this skill merely because planning succeeded.`,next:'plan'},
|
|
14
|
+
plan:{description:'Prepare a reviewable TeImMo implementation plan with dependencies, executable tests and business-to-test mapping.',procedure:`Read current context, project instructions and actual build/test tooling. Confirm that the requested scope is represented in the domain and that no blocking business question is being guessed. For a new plan, run planning from discussion; pass the user's actual answers with discuss. Do not replan an accepted implementation just to generate a task list.
|
|
15
|
+
|
|
16
|
+
Inspect requirements, design, tasks, checks and traceability. Match existing case IDs to real AC/check IDs in domain.json and save mappings. Check every applicable dimension, cross-module effect, migration and rollback behavior proportionally to scope. Run analyze and domain check. Read the actual test assertions; a referenced check alone does not demonstrate case coverage. Present the proposed commands, cases, assumptions and remaining gaps before approval. Respect earlier explicit approval; this skill does not invent an extra approval layer.`,next:'coverage'},
|
|
17
|
+
coverage:{description:'Audit TeImMo business-case coverage and identify missing assertions, unresolved decisions and unmapped rules before acceptance.',procedure:`Read context and run domain check and analyze when a plan exists. Inspect actual test assertions, fixtures and product code for the mapped cases. Compare roles/permissions, lifecycle transitions, forbidden transitions, boundaries, errors, concurrency/retries, integrations, data and compatibility with the domain. Check previous accepted behavior when this is a follow-up change.
|
|
18
|
+
|
|
19
|
+
Return a case-by-case table separating mapped, assertion-backed, executed and unverified. Structural READY is not test PASS or proof of completeness. Do not fabricate test results or turn unreviewed dimensions into na to get a green status. If the original contract needs correction, explain it and use replan only when the user has authorized that change. During implementation preserve frozen tests; missing regression cases can be added via the runner's supplemental-check protocol.`,next:'build'},
|
|
20
|
+
build:{description:'Execute an approved TeImMo plan through implementation, bounded test repair and separate reviews while preserving the acceptance contract.',procedure:`Read context, current routing and project instructions. Check for unrelated working changes and ongoing locks. At WAITING_APPROVAL, inspect actual spec/test commands and establish whether the user already approved this concrete plan; invoke approve only with that authorization. Do not change business policy to make tests pass.
|
|
21
|
+
|
|
22
|
+
Run the bounded loop with run, then inspect status and logs. Preserve frozen requirements, domain and tests. When blocked, distinguish provider/auth/tooling problems from code defects. Repair defects within authorized scope, stop at NO_PROGRESS or exhausted budget rather than silently increasing it. For a provider switch, pause, wait for PAUSED, use switch or route repair/review, then resume run. Stage overrides survive switch. Report source snapshot, executed evidence, remaining risks and next action. Do not auto-deploy or publish.`,next:'verify'},
|
|
23
|
+
verify:{description:'Re-run TeImMo acceptance and inspect evidence for a final delivery decision; distinguish stale, missing and executed checks.',procedure:`Read context and actual check commands. Run recheck when authorized to verify the project; this executes tests and two fresh agent reviews and may invoke repairs. If the user asks for a read-only assessment, inspect existing logs instead and label their age and snapshot. Never call review text alone a runtime test.
|
|
24
|
+
|
|
25
|
+
Run domain check and inspect assertion coverage. Summarize each stage, criteria/cases, commands and exit codes, reviewer findings, source hash, environment limitations and unresolved questions. Only claim acceptance when runner state is complete PASS and matches source, with business gaps resolved when enabled. If requested work is not represented by the contract, report it explicitly rather than treating PASS as total product correctness.`,next:'resume'},
|
|
26
|
+
resume:{description:'Restore TeImMo project context after a new chat, compaction or agent/model switch without relying on remembered conversation.',procedure:`Run context and status before taking action. Read linked spec files, domain facts/decisions/questions, current routes, latest findings, test logs and changed source relevant to the task. State the current objective, confirmed constraints, last durable stage and unresolved decisions. Distinguish recorded facts from assumptions and stale evidence.
|
|
27
|
+
|
|
28
|
+
Do not infer that a new chat approves a pending plan. Do not edit state.json manually or clear an active lock. If a crash left a dead lock, use recover; it checks ownership and rolls back pending transactions. Resume run only when execution is requested and authorized. If user only asks for context, stop after the concise handoff.`,next:'plan'},
|
|
29
|
+
change:{description:'Open the next TeImMo change from an accepted revision while preserving prior decisions and regression obligations.',procedure:`Read context and verify the current change is accepted and source matches the evidence. Use change with the user's request; this archives current spec/state and brings prior business records into the next discussion. If the current change is incomplete, clarify whether to revise it rather than silently discarding it.
|
|
30
|
+
|
|
31
|
+
Review changed scope, affected actors/rules/modules and all inherited cases. Resolve the generated blocking change-review question using actual user decisions and concrete source references. Re-map previous cases to the new acceptance suite and retain their behavior unless an explicit requirement supersedes it. Expand tests for new or changed behavior, discuss conflicts, and proceed to planning only after consequential questions are resolved.`,next:'brainstorm'}
|
|
32
|
+
};
|
|
33
|
+
export const skillNames=Object.keys(modes).map(mode=>'teimmo-'+mode);
|
|
34
|
+
const domainReference=`# Durable business record
|
|
35
|
+
|
|
36
|
+
Use harness-spec/domain.json as the structured project record, read through context before editing. Use node <skill-directory>/scripts/teimmo.mjs domain template for the exact schema. Write a complete candidate JSON in .harness/domain-candidate.json and pass it to domain save; this validates structure and honors the plan freeze. Do not edit the frozen domain directly. Do not use domain init to replace an existing record.
|
|
37
|
+
|
|
38
|
+
Keep stable IDs: A-01 actor, F-01 sourced fact, D-01 decision, Q-01 question, BR-01 rule, C-01 case. Fields:
|
|
39
|
+
- purpose: product problem/outcome, not a technology list.
|
|
40
|
+
- actors: [{id,description}]. Include permission boundaries when applicable.
|
|
41
|
+
- scope: {in:[...],out:[...]}; terms: [{term,meaning}].
|
|
42
|
+
- facts: [{id,statement,source}]. source names an inspected file or actual user answer; never invent citations.
|
|
43
|
+
- decisions: [{id,statement,source,status:"proposed"|"confirmed"}]. Only actual user decisions/authoritative requirements are confirmed business policy. A proposed choice stays proposed until resolved; technical conventions can cite an inspected project standard.
|
|
44
|
+
- questions: [{id,question,blocking,resolution,source}]. Unknown answers have empty resolution/source. Silence is not confirmation.
|
|
45
|
+
- rules: [{id,statement,source,actors:[actor IDs]}]. Capture conditions, ownership, allowed/forbidden transitions, invariants, observable outcome, timing and exceptions relevant to this rule.
|
|
46
|
+
- cases: [{id,rules:[rule IDs],kinds:[dimension IDs],given,when,then,criteria:[AC IDs],checks:[check IDs]}]. Before a plan exists mappings may be empty. After planning each case must map to a real AC and command in checks.json. Inspect assertions for the expected outcome.
|
|
47
|
+
- dimensions: [{id,status:"unreviewed"|"covered"|"na",rationale}]. IDs: happy,error,boundary,permission,state,concurrency,retry,integration,data,performance,compatibility. covered requires cases; na requires a specific reason. Happy path cannot be na. Scale depth to product risk; a pure function need not invent a login system or database.
|
|
48
|
+
|
|
49
|
+
For a multi-module project first map actors, modules, contracts, ownership and journeys in the brief/design. Then trace cross-module cases and failure recovery; do not claim exhaustive coverage based on this checklist. Record an unresolved blocking question when business semantics affect architecture or correctness. Source strings provide audit pointers, not machine proof that a human approved them.
|
|
50
|
+
|
|
51
|
+
The gate blocks unresolved questions, proposed decisions, unsourced rules, unreviewed dimensions and missing case/AC/check mappings. It does not judge assertion strength automatically. A frozen domain is included in the acceptance hash. Replan is required to revise it. After change, reconcile inherited cases before accepting new behavior.
|
|
52
|
+
`;
|
|
53
|
+
const runnerReference=`# TeImMo runner bridge
|
|
54
|
+
|
|
55
|
+
${workspaceGuide}
|
|
56
|
+
|
|
57
|
+
Run commands from the actual project root using:
|
|
58
|
+
|
|
59
|
+
node <absolute-skill-directory>/scripts/teimmo.mjs COMMAND
|
|
60
|
+
|
|
61
|
+
The bridge reads .harness/skills.json in the project root to locate the local TeImMo installation. If that installation moves or this is a teammate's checkout, reinstall skills from the local clone. Do not guess a global executable or another repository.
|
|
62
|
+
|
|
63
|
+
If shell/bridge execution is unavailable, use the host's file-reading tools to inspect .harness/state.json, .harness/config.json and harness-spec records directly. Report that live snapshot verification or commands were unavailable. Do not request broader permissions merely to restore conversational context. If the user asked for a read-only check, do not run a mutating fallback.
|
|
64
|
+
|
|
65
|
+
- setup [idea]: initialize discovery, business record and project skills together; safe to rerun without resetting existing contracts. No model calls or approval. Reload host skills or start a new chat afterward.
|
|
66
|
+
- new "idea": advanced initialization without automatic business/skill setup; never reset an existing project.
|
|
67
|
+
- domain init / domain template / domain save <candidate.json> / domain check: business record lifecycle.
|
|
68
|
+
- context: reload durable project state, business record and docs; it does not require past chat memory.
|
|
69
|
+
- context-manifest [focus-path...]: inspect included, partial and omitted project text. source <path> [start-line] [count] reads a Git-visible text range (maximum 400 lines). Missing context is not permission to guess. Scoped AGENTS/CLAUDE/GEMINI instructions apply only to their directories.
|
|
70
|
+
- run / discuss "actual answer": progress to input/approval boundary or continue an approved bounded loop.
|
|
71
|
+
- analyze: deterministic task/AC/check validation; domain check validates business-case links.
|
|
72
|
+
- approve: freeze reviewed plan and tests, record baseline. Only when authorized for the concrete plan.
|
|
73
|
+
- recheck: run tests/reviews again and allow bounded repairs; not read-only.
|
|
74
|
+
- pause / status / switch <agent> [model] / route <stage|review> <agent> [model]: checkpoint and routing. route review default removes override.
|
|
75
|
+
- replan: reopen current plan, keeping old test files; new versions need fresh test paths.
|
|
76
|
+
- change "request": archive accepted revision and start next scope with inherited business obligations.
|
|
77
|
+
- obligations: inspect frozen executable checks carried from accepted revisions. obligations retire <id> <reason> is a planning-only, explicit scope change; use only when the user authorized retiring the behavior and the concrete impact is explained. Approval records the revision, not authenticated human identity.
|
|
78
|
+
- recover: recover a dead process lock and interrupted file transactions. Never manually overwrite state to force PASS.
|
|
79
|
+
- doctor: executable/version only, not login/model/quota proof.
|
|
80
|
+
|
|
81
|
+
Version 0.6 checks need structured evidence: flat node:test TAP or the JSON adapter protocol in docs/EVIDENCE-v0.6.md in the TeImMo clone. Each AC and domain case binds to named tests, including criteria and cases in evidence.tests. Generic lint/build command checks cannot verify behavior. Missing/skipped tests block acceptance; a passing named test still requires assertion review. For Python use the packaged runners/unittest_evidence.py via python -B; copy it into the project if portability requires and include it in frozen check.files.
|
|
82
|
+
|
|
83
|
+
New projects use executionMode:tasks. Every trace task declares exact product files, check IDs and dependencies. Keep tasks small enough to verify independently. Do not assign a future-task test to a task that cannot pass it yet. Task acceptance is followed by full integration checks/reviews. maxCallsPerRun and maxRunMs bound each run; usage/cost is unknown unless provider evidence supplies it. Existing projects without executionMode keep change-level execution, but legacy exit-only checks must be replanned before acceptance.
|
|
84
|
+
|
|
85
|
+
Evidence is .harness/report.html, state.json, calls and logs; authored documents are harness-spec. Do not confuse legacy cc-sdd .kiro artifacts with the TeImMo runner. No global installation, commit, push or deployment is implied by a skill invocation. Honor explicit user scope and existing authorization.
|
|
86
|
+
`;
|
|
87
|
+
export function installSkills(root) {
|
|
88
|
+
const manifest=path.join(root,'.harness/skills.json');
|
|
89
|
+
const old=fs.existsSync(manifest)?readJson(manifest).owned:{};
|
|
90
|
+
const owned={},proposals=[];
|
|
91
|
+
const cli=fileURLToPath(new URL('./cli.mjs',import.meta.url));
|
|
92
|
+
for(const [mode,detail] of Object.entries(modes)) {
|
|
93
|
+
const name='teimmo-'+mode,folder='.agents/skills/'+name;
|
|
94
|
+
const files={
|
|
95
|
+
'SKILL.md':`---\nname: ${name}\ndescription: ${detail.description}\n---\n\n# TeImMo — ${mode}\n\nUse the user's language. This is the ${mode} workflow of TeImMo — The Immortal Moon. Preserve the user's chosen scope and supported decisions.\n\nRead [runner commands](references/runner.md) for executable operations and [business record](references/domain.md) when reading or recording domain decisions/cases. Load project context before continuing an existing project.\n\n${detail.procedure}\n\nNext relevant workflow: teimmo-${detail.next}; use it only when the user task calls for that stage.\n`,
|
|
96
|
+
'references/domain.md':domainReference,
|
|
97
|
+
'references/runner.md':runnerReference,
|
|
98
|
+
'agents/openai.yaml':`interface:\n display_name: "TeImMo ${mode}"\n short_description: "TeImMo ${mode} workflow with durable context"\n default_prompt: "Use $${name} for the current project."\n`,
|
|
99
|
+
'scripts/teimmo.mjs':`import {spawnSync} from 'node:child_process';\nimport fs from 'node:fs';\nimport path from 'node:path';\nlet cli;\ntry { cli=JSON.parse(fs.readFileSync(path.join(process.cwd(),'.harness/skills.json'),'utf8')).cli; } catch {}\nif(typeof cli!=='string'||!fs.existsSync(cli)){console.error('Run at project root and reinstall project skills from your local TeImMo clone.');process.exit(1);}\nconst result=spawnSync(process.execPath,[cli,...process.argv.slice(2)],{stdio:'inherit',windowsHide:true});\nif(result.error)console.error(result.error.message);\nprocess.exit(result.status ?? 1);\n`
|
|
100
|
+
};
|
|
101
|
+
for(const [file,content] of Object.entries(files)) {
|
|
102
|
+
const name=folder+'/'+file,target=relativeFile(root,name),hash=digest(content);
|
|
103
|
+
const present=fs.existsSync(target)?digest(fs.readFileSync(target)):null;
|
|
104
|
+
assert(!present||present===hash||present===old[name],'Customized skill file preserved; reconcile before installing: '+name);
|
|
105
|
+
owned[name]=hash;if(present!==hash)proposals.push({path:name,content});
|
|
106
|
+
}
|
|
107
|
+
}
|
|
108
|
+
if(proposals.length)applyFiles(root,'skill-install',proposals);
|
|
109
|
+
write(manifest,JSON.stringify({version:1,cli,owned},null,2));
|
|
110
|
+
const ignore=path.join(root,'.harness/.gitignore');if(!fs.existsSync(ignore))write(ignore,'*\n');
|
|
111
|
+
return {installed:skillNames,changedFiles:proposals.length,scope:'project',codex:'$teimmo-brainstorm',antigravity:'/teimmo-brainstorm',note:'Reload skills or open a new conversation; app autocomplete is host-controlled.'};
|
|
112
|
+
}
|
|
@@ -0,0 +1,39 @@
|
|
|
1
|
+
const callStages=['review-spec','review-quality','implementation','requirements','discussion','verification','analysis','repair','design','tasks'];
|
|
2
|
+
export function callGroup(id){return callStages.find(stage=>id.startsWith(stage+'-'))||'other';}
|
|
3
|
+
export const workspaceGuide=`# TeImMo workspace map
|
|
4
|
+
|
|
5
|
+
Keep business contracts, product code, executable acceptance and private execution evidence separate.
|
|
6
|
+
Existing repositories retain their established language/framework conventions. Do not create empty
|
|
7
|
+
folders or a product folder for each workflow stage. Design must show the chosen concrete file tree,
|
|
8
|
+
the responsibility of each module, and task/check ownership before implementation.
|
|
9
|
+
|
|
10
|
+
\`\`\`text
|
|
11
|
+
project/
|
|
12
|
+
harness-spec/ # durable, reviewable contract
|
|
13
|
+
WORKSPACE.md # this map
|
|
14
|
+
conversation.md, brief.md # 01 discussion: answers, scope and open questions
|
|
15
|
+
domain.json # business rules, sourced decisions, cases
|
|
16
|
+
requirements.md # 02 requirements: measurable AC IDs
|
|
17
|
+
design.md # 03 design: module/file tree and interfaces
|
|
18
|
+
tasks.md, checks.json # 04 tasks: bounded files and executable checks
|
|
19
|
+
analysis.md, traceability.json # 05 analysis: case/AC/task/check mapping
|
|
20
|
+
src/ # example product root; follow actual toolchain conventions
|
|
21
|
+
tests/ or acceptance/ # executable product checks, not planning prose
|
|
22
|
+
.agents/skills/teimmo-*/ # project-specific chat workflows
|
|
23
|
+
.harness/ # private local state; excluded from Git
|
|
24
|
+
config.json, state.json # routing, budgets, durable checkpoint
|
|
25
|
+
report.html, report.json # results across all stages
|
|
26
|
+
calls/<stage>/<call-id>.* # prompt, response and provider log per stage
|
|
27
|
+
logs/<check-id>-*.log # independently executed test evidence
|
|
28
|
+
native/<call-id>/workspace/ # optional isolated Codex source snapshot
|
|
29
|
+
archive/ # previous change records when change runs
|
|
30
|
+
\`\`\`
|
|
31
|
+
|
|
32
|
+
06 approval freezes the contract/tests. 07 implementation and repair change approved product files.
|
|
33
|
+
08 verification executes checks; 09 review-spec and review-quality assess the result; 10 acceptance
|
|
34
|
+
requires complete/PASS with evidence matching source. Every stage reports its actual artifact paths.
|
|
35
|
+
No folder name or generated document alone proves that stage passed.
|
|
36
|
+
|
|
37
|
+
New projects use stageFolders:true for calls. Existing projects keep their recorded paths;
|
|
38
|
+
opting into stageFolders changes only future call locations, not prior evidence.
|
|
39
|
+
`;
|