rhachet-roles-ehmpathy 1.2.0 → 1.4.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.
- package/dist/.test/genContextStitchTrail.d.ts +1 -2
- package/dist/.test/genContextStitchTrail.js +2 -4
- package/dist/.test/genContextStitchTrail.js.map +1 -1
- package/dist/logic/artifact/genStepArtDel.d.ts +17 -0
- package/dist/logic/artifact/genStepArtDel.js +29 -0
- package/dist/logic/artifact/genStepArtDel.js.map +1 -0
- package/dist/logic/artifact/genStepGrabCallerFeedbackToArtifact.js +9 -0
- package/dist/logic/artifact/genStepGrabCallerFeedbackToArtifact.js.map +1 -1
- package/dist/logic/artifact/setSkillOutputSrc.d.ts +32 -0
- package/dist/logic/artifact/setSkillOutputSrc.js +99 -0
- package/dist/logic/artifact/setSkillOutputSrc.js.map +1 -0
- package/dist/logic/context/genStitchStreamToDisk.d.ts +13 -0
- package/dist/logic/context/genStitchStreamToDisk.js +73 -0
- package/dist/logic/context/genStitchStreamToDisk.js.map +1 -0
- package/dist/logic/roles/bhrain/.briefs/cognition/cog021.metaphor.galactic_spacetravel.[article].md +42 -0
- package/dist/logic/roles/bhrain/.briefs/cognition/cog021.metaphor.galactic_spacetravel.[lesson].md +60 -0
- package/dist/logic/roles/bhrain/.briefs/grammar/gerunds.1.why.common.[article].md +32 -0
- package/dist/logic/roles/bhrain/.briefs/grammar/gerunds.1.why.term_smells.[article].md +36 -0
- package/dist/logic/roles/bhrain/.briefs/grammar/gerunds.1.why.term_smells.detection.[lesson].md +73 -0
- package/dist/logic/roles/bhrain/.briefs/grammar/gerunds.2.tactic.eliminate.[article].md +55 -0
- package/dist/logic/roles/bhrain/.briefs/grammar/gerunds.2.tactic.eliminate.[lesson].md +41 -0
- package/dist/logic/roles/bhrain/.briefs/grammar/gerunds.3.eliminator.[trait]._.md +66 -0
- package/dist/logic/roles/bhrain/.briefs/grammar/gerunds.3.eliminator.[trait].balance.md +36 -0
- package/dist/logic/roles/bhrain/.briefs/grammar/gerunds.3.eliminator.[trait].bane.md +34 -0
- package/dist/logic/roles/bhrain/.briefs/grammar/gerunds.3.eliminator.[trait].boon.md +35 -0
- package/dist/logic/roles/bhrain/.briefs/knowledge/kno501.doc.enbrief.catalog.structure1.[lesson].template.md +3 -3
- package/dist/logic/roles/bhrain/.briefs/logistics/term.logistics.[article].md +21 -0
- package/dist/logic/roles/bhrain/.briefs/logistics/term.logistics.of_information.[article].md +22 -0
- package/dist/logic/roles/bhrain/.briefs/logistics/term.logistics.of_knowledge.[article].md +29 -0
- package/dist/logic/roles/bhrain/.briefs/tactician/tactics.compose.traits_and_skills.[article].md +76 -0
- package/dist/logic/roles/bhrain/.briefs/tactician/trait.articulation.[article].md +67 -0
- package/dist/logic/roles/bhrain/.briefs/tactician/trait.purpose.[article].md +56 -0
- package/dist/logic/roles/bhrain/.briefs/tactician/trait.vs_skill.[article].md +55 -0
- package/dist/logic/roles/bhrain/.briefs/tactician/trait.vs_tactic.[article].md +70 -0
- package/dist/logic/roles/bhrain/brief.articulate/stepArticulate.d.ts +0 -2
- package/dist/logic/roles/bhrain/brief.articulate/stepArticulate.integration.test.js +1 -5
- package/dist/logic/roles/bhrain/brief.articulate/stepArticulate.integration.test.js.map +1 -1
- package/dist/logic/roles/bhrain/brief.articulate/stepArticulate.js +6 -3
- package/dist/logic/roles/bhrain/brief.articulate/stepArticulate.js.map +1 -1
- package/dist/logic/roles/bhrain/brief.articulate/stepArticulate.skill.d.ts +0 -1
- package/dist/logic/roles/bhrain/brief.articulate/stepArticulate.skill.js +14 -26
- package/dist/logic/roles/bhrain/brief.articulate/stepArticulate.skill.js.map +1 -1
- package/dist/logic/roles/bhrain/brief.articulate/stepArticulate.template.md +0 -9
- package/dist/logic/roles/bhrain/brief.catalogize/stepCatalogize.d.ts +7 -8
- package/dist/logic/roles/bhrain/brief.catalogize/stepCatalogize.js +7 -5
- package/dist/logic/roles/bhrain/brief.catalogize/stepCatalogize.js.map +1 -1
- package/dist/logic/roles/bhrain/brief.catalogize/stepCatalogize.skill.js +13 -8
- package/dist/logic/roles/bhrain/brief.catalogize/stepCatalogize.skill.js.map +1 -1
- package/dist/logic/roles/bhrain/getBhrainBrief.Options.codegen.d.ts +1 -1
- package/dist/logic/roles/bhrain/getBhrainBrief.Options.codegen.js +58 -36
- package/dist/logic/roles/bhrain/getBhrainBrief.Options.codegen.js.map +1 -1
- package/dist/logic/roles/bhrain/getBhrainRole.js +8 -0
- package/dist/logic/roles/bhrain/getBhrainRole.js.map +1 -1
- package/dist/logic/roles/bhrain/khue.instantiate/stepInstantiate.js +1 -1
- package/dist/logic/roles/bhrain/khue.instantiate/stepInstantiate.js.map +1 -1
- package/dist/logic/roles/bhrain/khue.instantiate/stepInstantiate.skill.js +22 -2
- package/dist/logic/roles/bhrain/khue.instantiate/stepInstantiate.skill.js.map +1 -1
- package/dist/logic/roles/bhrain/khue.triage/stepTriage.js +1 -1
- package/dist/logic/roles/bhrain/khue.triage/stepTriage.js.map +1 -1
- package/dist/logic/roles/ecologist/getEcologistBrief.Options.codegen.d.ts +1 -1
- package/dist/logic/roles/ecologist/getEcologistBrief.Options.codegen.js +14 -14
- package/dist/logic/roles/ecologist/getEcologistBrief.Options.codegen.js.map +1 -1
- package/dist/logic/roles/mechanic/.briefs/codestyle/flow.transformers_over_conditionals.[lesson].md +97 -0
- package/dist/logic/roles/mechanic/.briefs/terms/plan.exec_vs_apply.md +45 -0
- package/dist/logic/roles/mechanic/getMechanicBrief.Options.codegen.d.ts +1 -1
- package/dist/logic/roles/mechanic/getMechanicBrief.Options.codegen.js +1 -0
- package/dist/logic/roles/mechanic/getMechanicBrief.Options.codegen.js.map +1 -1
- package/package.json +4 -2
- package/dist/_topublish/rhachet-roles-bhrain/src/domain/objects/PonderCatalog.d.ts +0 -9
- package/dist/_topublish/rhachet-roles-bhrain/src/domain/objects/PonderCatalog.js +0 -3
- package/dist/_topublish/rhachet-roles-bhrain/src/domain/objects/PonderCatalog.js.map +0 -1
- package/dist/logic/roles/bhrain/.briefs/librarian.tactics/<articulate>.TriageCatalog.[gallery][example].structure.md +0 -18
|
@@ -1,2 +1 @@
|
|
|
1
|
-
|
|
2
|
-
export declare const genContextStitchTrail: () => ContextStitchTrail;
|
|
1
|
+
export { genContextStitchTrail } from 'rhachet';
|
|
@@ -1,8 +1,6 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
exports.genContextStitchTrail = void 0;
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
});
|
|
7
|
-
exports.genContextStitchTrail = genContextStitchTrail;
|
|
4
|
+
var rhachet_1 = require("rhachet");
|
|
5
|
+
Object.defineProperty(exports, "genContextStitchTrail", { enumerable: true, get: function () { return rhachet_1.genContextStitchTrail; } });
|
|
8
6
|
//# sourceMappingURL=genContextStitchTrail.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"genContextStitchTrail.js","sourceRoot":"","sources":["../../src/.test/genContextStitchTrail.ts"],"names":[],"mappings":";;;
|
|
1
|
+
{"version":3,"file":"genContextStitchTrail.js","sourceRoot":"","sources":["../../src/.test/genContextStitchTrail.ts"],"names":[],"mappings":";;;AAAA,mCAAgD;AAAvC,gHAAA,qBAAqB,OAAA"}
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
import { GStitcher, StitchStepCompute, Threads, RoleContext } from 'rhachet';
|
|
2
|
+
import { Artifact } from 'rhachet-artifact';
|
|
3
|
+
import { GitFile } from 'rhachet-artifact-git';
|
|
4
|
+
/**
|
|
5
|
+
* .what = creates a compute step that deletes the contents of an artifact
|
|
6
|
+
* .why = allows composer routes to purge the state of any artifact
|
|
7
|
+
*/
|
|
8
|
+
export declare const genStepArtDel: <TStitchee extends string, TArtee extends string, TThreads extends Threads<{ [K in TStitchee]: RoleContext<K, {
|
|
9
|
+
art: { [P in TArtee]: Artifact<typeof GitFile, string>; };
|
|
10
|
+
}>; }>>({ stitchee, artee, mode, ...input }: {
|
|
11
|
+
stitchee: TStitchee;
|
|
12
|
+
artee: TArtee;
|
|
13
|
+
mode?: 'delete';
|
|
14
|
+
condition?: ({ threads }: {
|
|
15
|
+
threads: TThreads;
|
|
16
|
+
}) => 'SKIP' | 'EXEC';
|
|
17
|
+
}) => StitchStepCompute<GStitcher<TThreads, import("simple-log-methods").ContextLogTrail & import("rhachet").ContextStitchTrail, "SKIP" | "EXEC">>;
|
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.genStepArtDel = void 0;
|
|
4
|
+
const rhachet_1 = require("rhachet");
|
|
5
|
+
const rhachet_artifact_git_1 = require("rhachet-artifact-git");
|
|
6
|
+
/**
|
|
7
|
+
* .what = creates a compute step that deletes the contents of an artifact
|
|
8
|
+
* .why = allows composer routes to purge the state of any artifact
|
|
9
|
+
*/
|
|
10
|
+
const genStepArtDel = ({ stitchee, artee, mode = 'delete', ...input }) => new rhachet_1.StitchStepCompute({
|
|
11
|
+
form: 'COMPUTE',
|
|
12
|
+
readme: null,
|
|
13
|
+
slug: `[${stitchee}]<artifact:del>[${artee}]`,
|
|
14
|
+
stitchee,
|
|
15
|
+
invoke: async ({ threads }) => {
|
|
16
|
+
const thread = threads[stitchee];
|
|
17
|
+
const artifact = thread.context.stash.art[artee];
|
|
18
|
+
// evaluate the condition, if one exists
|
|
19
|
+
const decision = input.condition?.({ threads }) ?? 'EXEC';
|
|
20
|
+
if (decision === 'SKIP')
|
|
21
|
+
return { input: { mode, artifact }, output: 'SKIP' };
|
|
22
|
+
// otherwise, execute the delete
|
|
23
|
+
await artifact.del();
|
|
24
|
+
console.log(`🎨️ art.${mode}ed, impacted ${artifact.ref.uri.replace(await (0, rhachet_artifact_git_1.getGitRepoRoot)({ from: process.cwd() }), '')}\n`);
|
|
25
|
+
return { input: { mode, artifact }, output: 'EXEC' };
|
|
26
|
+
},
|
|
27
|
+
});
|
|
28
|
+
exports.genStepArtDel = genStepArtDel;
|
|
29
|
+
//# sourceMappingURL=genStepArtDel.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"genStepArtDel.js","sourceRoot":"","sources":["../../../src/logic/artifact/genStepArtDel.ts"],"names":[],"mappings":";;;AAAA,qCAMiB;AAEjB,+DAA+D;AAE/D;;;GAGG;AACI,MAAM,aAAa,GAAG,CAa3B,EACA,QAAQ,EACR,KAAK,EACL,IAAI,GAAG,QAAQ,EACf,GAAG,KAAK,EAMT,EAAE,EAAE,CACH,IAAI,2BAAiB,CAEnB;IACA,IAAI,EAAE,SAAS;IACf,MAAM,EAAE,IAAI;IACZ,IAAI,EAAE,IAAI,QAAQ,mBAAmB,KAAK,GAAG;IAC7C,QAAQ;IACR,MAAM,EAAE,KAAK,EAAE,EAAE,OAAO,EAAE,EAAE,EAAE;QAC5B,MAAM,MAAM,GAAG,OAAO,CAAC,QAAQ,CAS9B,CAAC;QACF,MAAM,QAAQ,GAAG,MAAM,CAAC,OAAO,CAAC,KAAK,CAAC,GAAG,CAAC,KAAK,CAAC,CAAC;QAEjD,wCAAwC;QACxC,MAAM,QAAQ,GAAG,KAAK,CAAC,SAAS,EAAE,CAAC,EAAE,OAAO,EAAE,CAAC,IAAI,MAAM,CAAC;QAC1D,IAAI,QAAQ,KAAK,MAAM;YACrB,OAAO,EAAE,KAAK,EAAE,EAAE,IAAI,EAAE,QAAQ,EAAE,EAAE,MAAM,EAAE,MAAM,EAAE,CAAC;QAEvD,gCAAgC;QAChC,MAAM,QAAQ,CAAC,GAAG,EAAE,CAAC;QACrB,OAAO,CAAC,GAAG,CACT,YAAY,IAAI,gBAAgB,QAAQ,CAAC,GAAG,CAAC,GAAG,CAAC,OAAO,CACtD,MAAM,IAAA,qCAAc,EAAC,EAAE,IAAI,EAAE,OAAO,CAAC,GAAG,EAAE,EAAE,CAAC,EAC7C,EAAE,CACH,IAAI,CACN,CAAC;QACF,OAAO,EAAE,KAAK,EAAE,EAAE,IAAI,EAAE,QAAQ,EAAE,EAAE,MAAM,EAAE,MAAM,EAAE,CAAC;IACvD,CAAC;CACF,CAAC,CAAC;AA3DQ,QAAA,aAAa,iBA2DrB"}
|
|
@@ -23,6 +23,15 @@ const genStepGrabCallerFeedbackToArtifact = ({ stitchee, artee, }) => new rhache
|
|
|
23
23
|
.expect('isPresent');
|
|
24
24
|
// show the reviewer what they're reviewing
|
|
25
25
|
console.log(`\n📝 feedback target: ${target.uri}\n`);
|
|
26
|
+
// if this is running in an isolated attempt thread, then the user has no way to supply feedback
|
|
27
|
+
if (process.env.RHACHET_ATTEMPT)
|
|
28
|
+
return {
|
|
29
|
+
input: target,
|
|
30
|
+
output: {
|
|
31
|
+
feedback: null,
|
|
32
|
+
reason: 'in isolated attempt thread, no way to receive feedback',
|
|
33
|
+
},
|
|
34
|
+
};
|
|
26
35
|
// prompt to see if they want to leave notes
|
|
27
36
|
const { hasNotes } = await inquirer_1.default.prompt([
|
|
28
37
|
{
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"genStepGrabCallerFeedbackToArtifact.js","sourceRoot":"","sources":["../../../src/logic/artifact/genStepGrabCallerFeedbackToArtifact.ts"],"names":[],"mappings":";;;;;;AAAA,wDAAgC;AAChC,qCAMiB;AAIjB;;;GAGG;AACI,MAAM,mCAAmC,GAAG,CAWjD,EACA,QAAQ,EACR,KAAK,GAIN,EAAE,EAAE,CACH,IAAI,2BAAiB,CAEnB;IACA,IAAI,EAAE,SAAS;IACf,IAAI,EAAE,+BAA+B,QAAQ,IAAI,KAAK,GAAG;IACzD,MAAM,EAAE,+BAA+B,QAAQ,MAAM,KAAK,uCAAuC;IACjG,QAAQ,EAAE,QAAQ;IAClB,MAAM,EAAE,KAAK,EAAE,EAAE,OAAO,EAAE,EAAE,EAAE;QAC5B,8BAA8B;QAC9B,MAAM,aAAa,GAAG,OAAO,CAAC,QAAQ,CAKrC,CAAC;QACF,MAAM,MAAM,GAAG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C,OAAO,CAAC,MAAM,EAAE,IAAI,CAAC,CAAC;YAC1C,CAAC;YAED,kCAAkC;YAClC,MAAM,EAAE,UAAU,EAAE,GAAG,MAAM,kBAAQ,CAAC,MAAM,CAAyB;gBACnE;oBACE,IAAI,EAAE,QAAQ;oBACd,IAAI,EAAE,YAAY;oBAClB,OAAO,EAAE,2BAA2B;oBACpC,OAAO,EAAE,yCAAyC;iBACnD;aACF,CAAC,CAAC;YAEH,OAAO,UAAU,CAAC;QACpB,CAAC,CAAC,EAAE,CAAC;QAEL,4CAA4C;QAC5C,MAAM,OAAO,GAAG,MAAM,WAAW,CAAC,GAAG,CAAC;YACpC,OAAO,EAAE,QAAQ;SAClB,CAAC,CAAC;QAEH,OAAO,CAAC,GAAG,CAAC,EAAE,CAAC,CAAC;QAChB,OAAO,CAAC,GAAG,CAAC,wBAAwB,WAAW,CAAC,GAAG,CAAC,GAAG,EAAE,CAAC,CAAC;QAC3D,OAAO,CAAC,GAAG,CAAC,EAAE,CAAC,CAAC;QAChB,OAAO,CAAC,GAAG,CAAC,QAAQ,CAAC,CAAC;QACtB,OAAO,CAAC,GAAG,CAAC,EAAE,CAAC,CAAC;QAChB,OAAO,CAAC,GAAG,CAAC,YAAY,CAAC,CAAC;QAC1B,OAAO,CAAC,GAAG,CAAC,EAAE,CAAC,CAAC;QAEhB,2BAA2B;QAC3B,OAAO;YACL,KAAK,EAAE,MAAM;YACb,MAAM,EAAE,EAAE,QAAQ,EAAE,OAAO,EAAE;SAC9B,CAAC;IACJ,CAAC;CACF,CAAC,CAAC;
|
|
1
|
+
{"version":3,"file":"genStepGrabCallerFeedbackToArtifact.js","sourceRoot":"","sources":["../../../src/logic/artifact/genStepGrabCallerFeedbackToArtifact.ts"],"names":[],"mappings":";;;;;;AAAA,wDAAgC;AAChC,qCAMiB;AAIjB;;;GAGG;AACI,MAAM,mCAAmC,GAAG,CAWjD,EACA,QAAQ,EACR,KAAK,GAIN,EAAE,EAAE,CACH,IAAI,2BAAiB,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AAO,CAAC,GAAG,CAAC,YAAY,CAAC,CAAC;QAC1B,OAAO,CAAC,GAAG,CAAC,EAAE,CAAC,CAAC;QAEhB,2BAA2B;QAC3B,OAAO;YACL,KAAK,EAAE,MAAM;YACb,MAAM,EAAE,EAAE,QAAQ,EAAE,OAAO,EAAE;SAC9B,CAAC;IACJ,CAAC;CACF,CAAC,CAAC;AA5HQ,QAAA,mCAAmC,uCA4H3C"}
|
|
@@ -0,0 +1,32 @@
|
|
|
1
|
+
import { InvokeOpts } from 'rhachet';
|
|
2
|
+
/**
|
|
3
|
+
* .what = saves an artifact of the .src that created an output file
|
|
4
|
+
* .why =
|
|
5
|
+
* - a .src file helps callers trace the sequence that lead to some output. it makes outputs easier to repeat, since you always have the exact input at hand, for record
|
|
6
|
+
*/
|
|
7
|
+
export declare const setSkillOutputSrc: (input: {
|
|
8
|
+
skillUri: string;
|
|
9
|
+
opts: InvokeOpts<{
|
|
10
|
+
ask: string;
|
|
11
|
+
output: string;
|
|
12
|
+
}>;
|
|
13
|
+
}) => Promise<import("rhachet-artifact-git").GitFile>;
|
|
14
|
+
/**
|
|
15
|
+
* detect the trailing extension (with the dot), or null if none
|
|
16
|
+
*/
|
|
17
|
+
export declare const detectOutputExtension: (output: string) => string | null;
|
|
18
|
+
/**
|
|
19
|
+
* .what = removes the attempt value, regardless of extension
|
|
20
|
+
* - if there's a real extension: strip ".iN" before it
|
|
21
|
+
* - if no real extension but ends with ".iN": strip it
|
|
22
|
+
*/
|
|
23
|
+
export declare const asOutputWithoutAttempts: (output: string) => string;
|
|
24
|
+
/**
|
|
25
|
+
* .what = replaces the extension of an output file
|
|
26
|
+
* - if extension is real: replace it
|
|
27
|
+
* - if extension is ".iN": append new extension instead of replacing
|
|
28
|
+
*/
|
|
29
|
+
export declare const asOutputWithExtension: ({ output, extension, }: {
|
|
30
|
+
output: string;
|
|
31
|
+
extension: `.${string}`;
|
|
32
|
+
}) => string;
|
|
@@ -0,0 +1,99 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.asOutputWithExtension = exports.asOutputWithoutAttempts = exports.detectOutputExtension = exports.setSkillOutputSrc = void 0;
|
|
4
|
+
const node_path_1 = require("node:path");
|
|
5
|
+
const rhachet_artifact_git_1 = require("rhachet-artifact-git");
|
|
6
|
+
const type_fns_1 = require("type-fns");
|
|
7
|
+
/**
|
|
8
|
+
* .what = saves an artifact of the .src that created an output file
|
|
9
|
+
* .why =
|
|
10
|
+
* - a .src file helps callers trace the sequence that lead to some output. it makes outputs easier to repeat, since you always have the exact input at hand, for record
|
|
11
|
+
*/
|
|
12
|
+
const setSkillOutputSrc = async (input) => await (0, rhachet_artifact_git_1.genArtifactGitFile)({
|
|
13
|
+
uri: (0, exports.asOutputWithExtension)({
|
|
14
|
+
output: (0, exports.asOutputWithoutAttempts)(input.opts.output),
|
|
15
|
+
extension: '.src',
|
|
16
|
+
}),
|
|
17
|
+
}, { versions: true }).set({
|
|
18
|
+
content: castInvokeOptsToSrcFileContents(input),
|
|
19
|
+
});
|
|
20
|
+
exports.setSkillOutputSrc = setSkillOutputSrc;
|
|
21
|
+
/**
|
|
22
|
+
* .what = a procedure to cast from invoke opts into .src file contents
|
|
23
|
+
*/
|
|
24
|
+
const castInvokeOptsToSrcFileContents = (input) => {
|
|
25
|
+
// detect the attempt number
|
|
26
|
+
const attempts = process.env.RHACHET_ATTEMPTS ?? null;
|
|
27
|
+
const output = (0, exports.asOutputWithoutAttempts)(input.opts.output);
|
|
28
|
+
// rebuild the request
|
|
29
|
+
const sections = [
|
|
30
|
+
`
|
|
31
|
+
ASK=$(cat <<'ASK_EOF'
|
|
32
|
+
|
|
33
|
+
${input.opts.ask}
|
|
34
|
+
|
|
35
|
+
ASK_EOF
|
|
36
|
+
)
|
|
37
|
+
`.trim(),
|
|
38
|
+
`
|
|
39
|
+
npx rhachet act -s ${input.skillUri} \\
|
|
40
|
+
`.trim(),
|
|
41
|
+
attempts
|
|
42
|
+
? `
|
|
43
|
+
--attempts ${attempts} \\
|
|
44
|
+
`.trim()
|
|
45
|
+
: null,
|
|
46
|
+
`
|
|
47
|
+
--output '${output}' \\
|
|
48
|
+
`.trim(),
|
|
49
|
+
input.opts.references
|
|
50
|
+
? `
|
|
51
|
+
--references '${input.opts.references}' \\
|
|
52
|
+
`.trim()
|
|
53
|
+
: null,
|
|
54
|
+
...Object.entries((0, type_fns_1.omit)(input.opts, ['attempts', 'ask', 'output', 'references'])).map(([key, value]) => `
|
|
55
|
+
--${key} '${value}' \\
|
|
56
|
+
`.trim()),
|
|
57
|
+
`
|
|
58
|
+
--ask "$ASK";
|
|
59
|
+
`.trim(),
|
|
60
|
+
].filter(type_fns_1.isPresent);
|
|
61
|
+
return sections.join('\n');
|
|
62
|
+
};
|
|
63
|
+
/**
|
|
64
|
+
* detect the trailing extension (with the dot), or null if none
|
|
65
|
+
*/
|
|
66
|
+
const detectOutputExtension = (output) => {
|
|
67
|
+
const ext = (0, node_path_1.extname)(output);
|
|
68
|
+
return ext || null;
|
|
69
|
+
};
|
|
70
|
+
exports.detectOutputExtension = detectOutputExtension;
|
|
71
|
+
/**
|
|
72
|
+
* .what = removes the attempt value, regardless of extension
|
|
73
|
+
* - if there's a real extension: strip ".iN" before it
|
|
74
|
+
* - if no real extension but ends with ".iN": strip it
|
|
75
|
+
*/
|
|
76
|
+
const asOutputWithoutAttempts = (output) => {
|
|
77
|
+
const ext = (0, exports.detectOutputExtension)(output);
|
|
78
|
+
// case: has real extension (like .md, .json, etc.)
|
|
79
|
+
if (ext && !/\.i\d+$/.test(ext))
|
|
80
|
+
return output.replace(new RegExp(`\\.i\\d+${ext}$`), ext);
|
|
81
|
+
// case: no extension, or extension is itself ".iN"
|
|
82
|
+
return output.replace(/\.i\d+$/, '');
|
|
83
|
+
};
|
|
84
|
+
exports.asOutputWithoutAttempts = asOutputWithoutAttempts;
|
|
85
|
+
/**
|
|
86
|
+
* .what = replaces the extension of an output file
|
|
87
|
+
* - if extension is real: replace it
|
|
88
|
+
* - if extension is ".iN": append new extension instead of replacing
|
|
89
|
+
*/
|
|
90
|
+
const asOutputWithExtension = ({ output, extension, }) => {
|
|
91
|
+
const ext = (0, exports.detectOutputExtension)(output);
|
|
92
|
+
// if no original extension, just append this new one
|
|
93
|
+
if (!ext)
|
|
94
|
+
return output + extension;
|
|
95
|
+
// otherwise, replace the extension
|
|
96
|
+
return output.slice(0, -ext.length) + extension;
|
|
97
|
+
};
|
|
98
|
+
exports.asOutputWithExtension = asOutputWithExtension;
|
|
99
|
+
//# sourceMappingURL=setSkillOutputSrc.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"setSkillOutputSrc.js","sourceRoot":"","sources":["../../../src/logic/artifact/setSkillOutputSrc.ts"],"names":[],"mappings":";;;AAAA,yCAAoC;AAEpC,+DAA0D;AAC1D,uCAA2C;AAE3C;;;;GAIG;AACI,MAAM,iBAAiB,GAAG,KAAK,EAAE,KAGvC,EAAE,EAAE,CACH,MAAM,IAAA,yCAAkB,EACtB;IACE,GAAG,EAAE,IAAA,6BAAqB,EAAC;QACzB,MAAM,EAAE,IAAA,+BAAuB,EAAC,KAAK,CAAC,IAAI,CAAC,MAAM,CAAC;QAClD,SAAS,EAAE,MAAM;KAClB,CAAC;CACH,EACD,EAAE,QAAQ,EAAE,IAAI,EAAE,CACnB,CAAC,GAAG,CAAC;IACJ,OAAO,EAAE,+BAA+B,CAAC,KAAK,CAAC;CAChD,CAAC,CAAC;AAdQ,QAAA,iBAAiB,qBAczB;AAEL;;GAEG;AACH,MAAM,+BAA+B,GAAG,CAAC,KAGxC,EAAE,EAAE;IACH,4BAA4B;IAC5B,MAAM,QAAQ,GAAG,OAAO,CAAC,GAAG,CAAC,gBAAgB,IAAI,IAAI,CAAC;IACtD,MAAM,MAAM,GAAG,IAAA,+BAAuB,EAAC,KAAK,CAAC,IAAI,CAAC,MAAM,CAAC,CAAC;IAE1D,sBAAsB;IACtB,MAAM,Q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AAC;QAC7B,OAAO,MAAM,CAAC,OAAO,CAAC,IAAI,MAAM,CAAC,WAAW,GAAG,GAAG,CAAC,EAAE,GAAG,CAAC,CAAC;IAE5D,mDAAmD;IACnD,OAAO,MAAM,CAAC,OAAO,CAAC,SAAS,EAAE,EAAE,CAAC,CAAC;AACvC,CAAC,CAAC;AATW,QAAA,uBAAuB,2BASlC;AAEF;;;;GAIG;AACI,MAAM,qBAAqB,GAAG,CAAC,EACpC,MAAM,EACN,SAAS,GAIV,EAAU,EAAE;IACX,MAAM,GAAG,GAAG,IAAA,6BAAqB,EAAC,MAAM,CAAC,CAAC;IAE1C,qDAAqD;IACrD,IAAI,CAAC,GAAG;QAAE,OAAO,MAAM,GAAG,SAAS,CAAC;IAEpC,mCAAmC;IACnC,OAAO,MAAM,CAAC,KAAK,CAAC,CAAC,EAAE,CAAC,GAAG,CAAC,MAAM,CAAC,GAAG,SAAS,CAAC;AAClD,CAAC,CAAC;AAdW,QAAA,qBAAqB,yBAchC"}
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
import { ContextStitchTrail } from 'rhachet';
|
|
2
|
+
/**
|
|
3
|
+
* .what = an event stream consumer which streams emitted events to disk
|
|
4
|
+
* .how =
|
|
5
|
+
* - emits stitch set events observably to a standard .rhachet subdir, relative to the target dir
|
|
6
|
+
* - transforms the events for maximum observability in their serialized format
|
|
7
|
+
*/
|
|
8
|
+
export declare const genStitchStreamToDisk: (input: {
|
|
9
|
+
/**
|
|
10
|
+
* .what = the directory relative to which to instantiate the .rhachet stream sink
|
|
11
|
+
*/
|
|
12
|
+
dir: string;
|
|
13
|
+
}) => Required<ContextStitchTrail['stitch']>['stream'];
|
|
@@ -0,0 +1,73 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.genStitchStreamToDisk = void 0;
|
|
4
|
+
const uni_time_1 = require("@ehmpathy/uni-time");
|
|
5
|
+
const rhachet_1 = require("rhachet");
|
|
6
|
+
const rhachet_artifact_git_1 = require("rhachet-artifact-git");
|
|
7
|
+
const simple_in_memory_cache_1 = require("simple-in-memory-cache");
|
|
8
|
+
const type_fns_1 = require("type-fns");
|
|
9
|
+
const with_simple_caching_1 = require("with-simple-caching");
|
|
10
|
+
// todo: lift into string-fns or rhachet-artifact-git
|
|
11
|
+
const sanitizeForFilename = (input) => input
|
|
12
|
+
// replace invalid characters
|
|
13
|
+
.replace(/[<>:"/\\|?*\x00-\x1F]/g, '_')
|
|
14
|
+
// collapse whitespace into underscore
|
|
15
|
+
.replace(/\s+/g, '_')
|
|
16
|
+
// remove trailing dots or spaces
|
|
17
|
+
.replace(/[. ]+$/, '')
|
|
18
|
+
// make sure reserved names aren’t returned bare
|
|
19
|
+
.replace(/^(con|prn|aux|nul|com\d|lpt\d)$/i, '_$1');
|
|
20
|
+
// declare where the stream will be emitted to // todo: move via hook into rhachet to centralize; declaration of emitter != mount of emitter. ideally, log on mount
|
|
21
|
+
const onMount = (0, with_simple_caching_1.withSimpleCaching)((input) => {
|
|
22
|
+
console.log(`🪡 stitch set event stream can be monitored at this dir: ${input.sinkSubdir}`);
|
|
23
|
+
console.log(); // newline
|
|
24
|
+
}, { cache: (0, simple_in_memory_cache_1.createCache)() });
|
|
25
|
+
/**
|
|
26
|
+
* .what = an event stream consumer which streams emitted events to disk
|
|
27
|
+
* .how =
|
|
28
|
+
* - emits stitch set events observably to a standard .rhachet subdir, relative to the target dir
|
|
29
|
+
* - transforms the events for maximum observability in their serialized format
|
|
30
|
+
*/
|
|
31
|
+
const genStitchStreamToDisk = (input) => {
|
|
32
|
+
// declare the directory into which the events will be streamed
|
|
33
|
+
const sinkSupdir = (0, rhachet_artifact_git_1.getArtifactObsDir)({ uri: `${input.dir}/stream` }); // e.g., src/domain/ -> src/domain/stream -> src/domain/.rhachet/stream
|
|
34
|
+
const invokedAt = sanitizeForFilename((0, uni_time_1.asUniDateTime)(new Date()));
|
|
35
|
+
const sinkSubdir = `${sinkSupdir}/i${invokedAt}`;
|
|
36
|
+
// declare how to sink emitted events to that directory
|
|
37
|
+
const emit = async (event) => {
|
|
38
|
+
// mock the onmount hook
|
|
39
|
+
onMount({ sinkSubdir });
|
|
40
|
+
// compose the event path prefix
|
|
41
|
+
const uriPrefix = [
|
|
42
|
+
sinkSubdir,
|
|
43
|
+
sanitizeForFilename([
|
|
44
|
+
'at',
|
|
45
|
+
event.occurredAt,
|
|
46
|
+
event.stitch.stitcher?.slug ?? '___',
|
|
47
|
+
event.stitch.stitcher?.form ?? '___',
|
|
48
|
+
event.stitch.uuid,
|
|
49
|
+
]
|
|
50
|
+
.filter(type_fns_1.isPresent)
|
|
51
|
+
.join('.')),
|
|
52
|
+
].join('/');
|
|
53
|
+
// always emit the raw event; // todo: do we ever need this? seems to takeup disk space too rapidly
|
|
54
|
+
await (0, rhachet_artifact_git_1.genArtifactGitFile)({
|
|
55
|
+
uri: `${uriPrefix}.event.json`,
|
|
56
|
+
}).set({ content: JSON.stringify(event, null, 2) });
|
|
57
|
+
// if its an imagine event, then also separately emit the input and output for observability, if input and output had standard deprompt stitch
|
|
58
|
+
if (event.stitch.stitcher?.form === rhachet_1.StitcherForm.IMAGINE) {
|
|
59
|
+
if (typeof event.stitch.input?.prompt === 'string')
|
|
60
|
+
await (0, rhachet_artifact_git_1.genArtifactGitFile)({
|
|
61
|
+
uri: `${uriPrefix}.prompt.input.md`,
|
|
62
|
+
}).set({ content: event.stitch.input.prompt });
|
|
63
|
+
if (typeof event.stitch.output?.content === 'string')
|
|
64
|
+
await (0, rhachet_artifact_git_1.genArtifactGitFile)({
|
|
65
|
+
uri: `${uriPrefix}.prompt.output.md`,
|
|
66
|
+
}).set({ content: event.stitch.output.content });
|
|
67
|
+
}
|
|
68
|
+
};
|
|
69
|
+
// return the stream with observable to disk emitter
|
|
70
|
+
return { emit };
|
|
71
|
+
};
|
|
72
|
+
exports.genStitchStreamToDisk = genStitchStreamToDisk;
|
|
73
|
+
//# sourceMappingURL=genStitchStreamToDisk.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"genStitchStreamToDisk.js","sourceRoot":"","sources":["../../../src/logic/context/genStitchStreamToDisk.ts"],"names":[],"mappings":";;;AAAA,iDAAmD;AACnD,qCAA2E;AAC3E,+DAA6E;AAC7E,mEAAqD;AACrD,uCAAqC;AACrC,6DAAwD;AAExD,qDAAqD;AACrD,MAAM,mBAAmB,GAAG,CAAC,KAAa,EAAU,EAAE,CACpD,KAAK;IACH,6BAA6B;KAC5B,OAAO,CAAC,wBAAwB,EAAE,GAAG,CAAC;IACvC,sCAAsC;KACrC,OAAO,CAAC,MAAM,EAAE,GAAG,CAAC;IACrB,iCAAiC;KAChC,OAAO,CAAC,QAAQ,EAAE,EAAE,CAAC;IACtB,gDAAgD;KAC/C,OAAO,CAAC,kCAAkC,EAAE,KAAK,CAAC,CAAC;AAExD,mKAAmK;AACnK,MAAM,OAAO,GAAG,IAAA,uCAAiB,EAC/B,CAAC,KAA6B,EAAE,EAAE;IAChC,OAAO,CAAC,GAAG,CACT,6DAA6D,KAAK,CAAC,UAAU,EAAE,CAChF,CAAC;IACF,OAAO,CAAC,GAAG,EAAE,CAAC,CAAC,UAAU;AAC3B,CAAC,EACD,EAAE,KAAK,EAAE,IAAA,oCAAW,GAAE,EAAE,CACzB,CAAC;AAEF;;;;;GAKG;AACI,MAAM,qBAAqB,GAAG,CAAC,KAKrC,EAAoD,EAAE;IACrD,+DAA+D;IAC/D,MAAM,UAAU,GAAG,IAAA,wCAAiB,EAAC,EAAE,GAAG,EAAE,GAAG,KAAK,CAAC,GAAG,SAAS,EAAE,CAAC,CAAC,CAAC,uEAAuE;IAC7I,MAAM,SAAS,GAAG,mBAAmB,CAAC,IAAA,wBAAa,EAAC,IAAI,IAAI,EAAE,CAAC,CAAC,CAAC;IACjE,MAAM,UAAU,GAAG,GAAG,UAAU,KAAK,SAAS,EAAE,CAAC;IAEjD,uDAAuD;IACvD,MAAM,IAAI,GAA6D,K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,EAAE,OAAO,EAAE,KAAK,CAAC,MAAM,CAAC,MAAM,CAAC,OAAO,EAAE,CAAC,CAAC;QACrD,CAAC;IACH,CAAC,CAAC;IAEF,oDAAoD;IACpD,OAAO,EAAE,IAAI,EAAE,CAAC;AAClB,CAAC,CAAC;AAtDW,QAAA,qBAAqB,yBAsDhC"}
|
package/dist/logic/roles/bhrain/.briefs/cognition/cog021.metaphor.galactic_spacetravel.[article].md
ADDED
|
@@ -0,0 +1,42 @@
|
|
|
1
|
+
# 🌌 .brief: llms as spaceships in the concept universe
|
|
2
|
+
|
|
3
|
+
## 🪐 concept universe
|
|
4
|
+
- **concept space = galaxy**
|
|
5
|
+
- the center is the **root concept**, a dense singularity.
|
|
6
|
+
- **radial outward** = instantiations (concrete stars, planets, moons).
|
|
7
|
+
- **angular shells** = abstraction layers (orbits around the core).
|
|
8
|
+
- **concepts have gravity**
|
|
9
|
+
- dense, common, or familiar concepts exert strong pull.
|
|
10
|
+
- vague or imprecise addresses can get you **sucked into a local maximum** (orbiting around a nearby but wrong star).
|
|
11
|
+
|
|
12
|
+
---
|
|
13
|
+
|
|
14
|
+
## 🚀 llms as spaceships
|
|
15
|
+
- **llms = thought-spaceships**
|
|
16
|
+
- engines capable of near-instant jumps across the conceptual galaxy.
|
|
17
|
+
- their raw power is speed, not direction.
|
|
18
|
+
- **we = pilots**
|
|
19
|
+
- we chart the course and set the destination.
|
|
20
|
+
- piloting skill = crafting precise addresses that avoid gravitational traps.
|
|
21
|
+
- **questions = navigation coordinates**
|
|
22
|
+
- granular input that encodes the target star system.
|
|
23
|
+
- precision determines whether you land on the right planet or drift to a gravitational neighbor.
|
|
24
|
+
|
|
25
|
+
---
|
|
26
|
+
|
|
27
|
+
## ⚠️ challenges of navigation
|
|
28
|
+
1. **destination clarity**
|
|
29
|
+
- you must know *where in the galaxy you want to go*.
|
|
30
|
+
- without a clear conceptual map, your spaceship will default to the nearest strong pull.
|
|
31
|
+
|
|
32
|
+
2. **address precision**
|
|
33
|
+
- the coordinate (question) must be exact.
|
|
34
|
+
- imprecise questions lead to being trapped in nearby but irrelevant orbits.
|
|
35
|
+
- precision cuts through gravitational noise to hit the right star.
|
|
36
|
+
|
|
37
|
+
---
|
|
38
|
+
|
|
39
|
+
## 🎯 pilot’s insight
|
|
40
|
+
- **llms provide propulsion; humans provide navigation.**
|
|
41
|
+
- the art is not in moving (llms do that instantly) but in **deciding where to go** and **formulating coordinates to arrive there.**
|
|
42
|
+
- mastery = galactic cartography (understanding the shape of the universe) + piloting discipline (asking precise, gravitationally-aware questions).
|
package/dist/logic/roles/bhrain/.briefs/cognition/cog021.metaphor.galactic_spacetravel.[lesson].md
ADDED
|
@@ -0,0 +1,60 @@
|
|
|
1
|
+
# 🌌 .brief.lesson: piloting llms as spaceships in the concept universe
|
|
2
|
+
|
|
3
|
+
## 💡 concept
|
|
4
|
+
to use llms well, imagine them as **spaceships** traveling at lightspeed through a **conceptual galaxy**.
|
|
5
|
+
the galaxy contains infinite **concepts** arranged in spheres of abstraction. each concept exerts **gravity**, pulling you in if your navigation is imprecise.
|
|
6
|
+
your role as pilot is to chart the destination and give the ship accurate coordinates (questions).
|
|
7
|
+
|
|
8
|
+
---
|
|
9
|
+
|
|
10
|
+
## 📚 materials
|
|
11
|
+
- **map of the galaxy** → the mental model of concept space (root at center, abstractions in shells, instantiations outward).
|
|
12
|
+
- **spaceship (llm)** → fast, powerful engine but directionless without guidance.
|
|
13
|
+
- **pilot’s controls (questions/prompts)** → the interface for steering.
|
|
14
|
+
- **gravity awareness** → recognition that common or vague concepts will suck you into nearby orbits unless coordinates are exact.
|
|
15
|
+
|
|
16
|
+
---
|
|
17
|
+
|
|
18
|
+
## 🛠️ practice steps
|
|
19
|
+
1. **orient the galaxy**
|
|
20
|
+
- sketch your concept in its root form.
|
|
21
|
+
- note layers of abstraction (outer shells) and concrete instances (radial outward).
|
|
22
|
+
|
|
23
|
+
2. **define the destination**
|
|
24
|
+
- decide: are you heading to the core (abstract) or to an outer planet (specific case)?
|
|
25
|
+
- example: "justice" (core abstraction) vs. "traffic law fine in california" (outer instantiation).
|
|
26
|
+
|
|
27
|
+
3. **set coordinates (formulate question)**
|
|
28
|
+
- express the question with the right precision.
|
|
29
|
+
- avoid vague inputs that leave gravity to decide the landing.
|
|
30
|
+
|
|
31
|
+
4. **observe gravitational drift**
|
|
32
|
+
- check if the answer pulled you toward a nearby, high-gravity concept.
|
|
33
|
+
- if so, refine the coordinates.
|
|
34
|
+
|
|
35
|
+
5. **refine and relaunch**
|
|
36
|
+
- adjust the wording of the question to escape local maxima.
|
|
37
|
+
- iterate until you land on the intended star system.
|
|
38
|
+
|
|
39
|
+
---
|
|
40
|
+
|
|
41
|
+
## 🎯 examples
|
|
42
|
+
- **vague address** → "tell me about painting"
|
|
43
|
+
- gravity pulls to broad art history.
|
|
44
|
+
|
|
45
|
+
- **precise coordinates** → "explain preparation steps for interior wall painting in a rental apartment"
|
|
46
|
+
- lands directly on the desired planet.
|
|
47
|
+
|
|
48
|
+
- **mislanding correction**
|
|
49
|
+
- q: "how to fix leaks?" → sucked into plumbing.
|
|
50
|
+
- refine: "how to fix leaks in asphalt driveway sealant" → lands on the right surface.
|
|
51
|
+
|
|
52
|
+
---
|
|
53
|
+
|
|
54
|
+
## 🧭 pilot’s takeaway
|
|
55
|
+
- **llms are engines** → they can take you anywhere, instantly.
|
|
56
|
+
- **questions are star coordinates** → your precision determines the arrival point.
|
|
57
|
+
- **concepts exert gravity** → imprecision will trap you in strong but wrong orbits.
|
|
58
|
+
- **piloting skill = clarity + precision** → knowing where you want to go and addressing it sharply.
|
|
59
|
+
|
|
60
|
+
---
|
|
@@ -0,0 +1,32 @@
|
|
|
1
|
+
# 🧩 why gerunds are so common
|
|
2
|
+
|
|
3
|
+
## 🏗️ structural reasons
|
|
4
|
+
- **nominalization shortcut**
|
|
5
|
+
instead of inventing a whole new noun, you can just attach *-ing* and turn an action into a subject/object
|
|
6
|
+
*e.g., “running is fun” vs. needing a special word like “race”*.
|
|
7
|
+
- **versatility in syntax**
|
|
8
|
+
gerunds can function as subjects, objects, or complements without breaking grammar rules. this makes them handy “lego blocks” in sentence-building.
|
|
9
|
+
|
|
10
|
+
---
|
|
11
|
+
|
|
12
|
+
## 🔄 cognitive & communicative reasons
|
|
13
|
+
- **focus on process, not just event**
|
|
14
|
+
gerunds highlight the *ongoingness* or *essence* of an action, not a single instance.
|
|
15
|
+
*e.g., “i like swimming” emphasizes the general activity, not one swim*.
|
|
16
|
+
- **concept compression**
|
|
17
|
+
they condense complex actions into manageable noun-like units, letting us package experiences as “things” that can be talked about, compared, and reasoned with.
|
|
18
|
+
|
|
19
|
+
---
|
|
20
|
+
|
|
21
|
+
## 🌍 historical reasons
|
|
22
|
+
- **natural evolution of english**
|
|
23
|
+
english lost many inflections over time. the *-ing* ending became multifunctional (present participle *and* gerund), making it easy to spread.
|
|
24
|
+
- **cross-linguistic parallels**
|
|
25
|
+
most languages have some way of turning verbs into nouns (latin’s *-ndus*, spanish *-ar → -ando*, etc.). gerunds are english’s efficient version of that broader need.
|
|
26
|
+
|
|
27
|
+
---
|
|
28
|
+
|
|
29
|
+
## 📊 why “so common” in practice
|
|
30
|
+
- they appear in **everyday talk** (*liking, doing, going*).
|
|
31
|
+
- they’re needed for **abstract concepts** (*thinking, learning, understanding*).
|
|
32
|
+
- they often replace **formal nouns** (*“procrastinating”* instead of *“procrastination”*).
|
|
@@ -0,0 +1,36 @@
|
|
|
1
|
+
# 🧩 why gerunds can be "term smells"
|
|
2
|
+
|
|
3
|
+
## 🚩 what is a "term smell"
|
|
4
|
+
a **term smell** is like a code smell: a sign that a term may not be well-formed, clear, or fully thought through. it doesn’t always mean the term is wrong, but it hints at a lack of conceptual distillation.
|
|
5
|
+
|
|
6
|
+
---
|
|
7
|
+
|
|
8
|
+
## 🧩 why gerunds raise suspicion
|
|
9
|
+
- **process disguised as essence**
|
|
10
|
+
gerunds often point to *doing* rather than a distilled *thing*.
|
|
11
|
+
*e.g., “learning” as a noun refers to the act, but what we might mean is “knowledge” (the distilled outcome).*
|
|
12
|
+
|
|
13
|
+
- **vagueness of scope**
|
|
14
|
+
gerunds blur whether we mean one instance (*a running race*), the general process (*running in general*), or an abstract quality (*endurance*). this ambiguity can signal sloppy conceptualization.
|
|
15
|
+
|
|
16
|
+
- **placeholder convenience**
|
|
17
|
+
gerunds are easy to generate. instead of carefully naming the core concept, we default to *-ing*.
|
|
18
|
+
*e.g., “networking” instead of specifying “relationships,” “contacts,” or “repute.”*
|
|
19
|
+
|
|
20
|
+
---
|
|
21
|
+
|
|
22
|
+
## 🌀 signs of insufficient distillation
|
|
23
|
+
- the term **describes activity** but doesn’t identify the **underlying resource, structure, or outcome**.
|
|
24
|
+
*“teaching” vs. “education,” “building” vs. “structure,” “thinking” vs. “thought.”*
|
|
25
|
+
|
|
26
|
+
- the term **feels broad or leaky**, covering multiple senses at once.
|
|
27
|
+
*“writing” could mean the act, the system, the product, or the skill.*
|
|
28
|
+
|
|
29
|
+
- the term **fails test of substitution**: if we try to define it without the *-ing* form, we get sharper distinctions.
|
|
30
|
+
*“planning” → could resolve to “plan” (artifact), “process of coordination” (activity), or “strategy” (essence).*
|
|
31
|
+
|
|
32
|
+
---
|
|
33
|
+
|
|
34
|
+
## 📌 takeaway
|
|
35
|
+
gerunds are common because they’re convenient.
|
|
36
|
+
they’re **term smells** because convenience can mask lack of distillation — using the *doing* form instead of naming the **essence** of what’s really meant.
|
package/dist/logic/roles/bhrain/.briefs/grammar/gerunds.1.why.term_smells.detection.[lesson].md
ADDED
|
@@ -0,0 +1,73 @@
|
|
|
1
|
+
# 🧩 .brief.lesson: `gerund smell test`
|
|
2
|
+
|
|
3
|
+
## 💡 concept
|
|
4
|
+
a **gerund smell test** helps detect when a concept named with *-ing* is really a sign of insufficient distillation. it forces us to sharpen fuzzy process-terms into precise nouns that capture the essence.
|
|
5
|
+
|
|
6
|
+
---
|
|
7
|
+
|
|
8
|
+
## 🎯 purpose
|
|
9
|
+
- prevent sloppy terminology by avoiding “process-as-thing” placeholders.
|
|
10
|
+
- guide thinkers toward more distilled, essential names.
|
|
11
|
+
- improve clarity and transferability of concepts in writing, design, or theory.
|
|
12
|
+
|
|
13
|
+
---
|
|
14
|
+
|
|
15
|
+
## 🧪 the smell test
|
|
16
|
+
|
|
17
|
+
### 1. substitution test
|
|
18
|
+
> can the gerund be replaced with a sharper noun?
|
|
19
|
+
|
|
20
|
+
- *“learning” → knowledge*
|
|
21
|
+
- *“building” → structure*
|
|
22
|
+
- *“teaching” → education*
|
|
23
|
+
- *“thinking” → thought*
|
|
24
|
+
|
|
25
|
+
if the substitution makes meaning clearer, the gerund is a smell.
|
|
26
|
+
|
|
27
|
+
---
|
|
28
|
+
|
|
29
|
+
### 2. scope clarity test
|
|
30
|
+
> does the gerund blur multiple senses?
|
|
31
|
+
|
|
32
|
+
- *“writing”* could mean:
|
|
33
|
+
- the act (scribbling on paper)
|
|
34
|
+
- the product (a text)
|
|
35
|
+
- the system (written language)
|
|
36
|
+
- the skill (literacy)
|
|
37
|
+
|
|
38
|
+
if it leaks across senses, the gerund is a smell.
|
|
39
|
+
|
|
40
|
+
---
|
|
41
|
+
|
|
42
|
+
### 3. outcome test
|
|
43
|
+
> does the gerund describe activity instead of the result?
|
|
44
|
+
|
|
45
|
+
- *“planning”* → could resolve into:
|
|
46
|
+
- **plan** (artifact)
|
|
47
|
+
- **strategy** (essence)
|
|
48
|
+
- **coordination** (process with defined outcome)
|
|
49
|
+
|
|
50
|
+
if the activity is masking a clearer outcome, the gerund is a smell.
|
|
51
|
+
|
|
52
|
+
---
|
|
53
|
+
|
|
54
|
+
### 4. convenience test
|
|
55
|
+
> is the gerund just the easiest way out?
|
|
56
|
+
|
|
57
|
+
- *“networking”* → a shortcut for “relationships,” “contacts,” or “repute.”
|
|
58
|
+
if the term looks like it was coined because *-ing* was handy, it’s a smell.
|
|
59
|
+
|
|
60
|
+
---
|
|
61
|
+
|
|
62
|
+
## 📚 practice exercise
|
|
63
|
+
take common gerunds and refine them:
|
|
64
|
+
- **thinking** → thought, cognition, reason
|
|
65
|
+
- **doing** → action, execution, behavior
|
|
66
|
+
- **training** → instruction, discipline, practice
|
|
67
|
+
- **meeting** → gathering, session, council
|
|
68
|
+
|
|
69
|
+
---
|
|
70
|
+
|
|
71
|
+
## 📌 takeaway
|
|
72
|
+
if a term ends in *-ing*, run it through the **gerund smell test**.
|
|
73
|
+
if it fails even one check, distill it to its essence. clarity improves, concepts sharpen, and your system of terms becomes more robust.
|
|
@@ -0,0 +1,55 @@
|
|
|
1
|
+
# 🧩 .brief.article: `eliminate gerunds in prose`
|
|
2
|
+
|
|
3
|
+
## 🌟 introduction
|
|
4
|
+
the removal of gerunds (*-ing* forms used as nouns) is a deliberate tactic to sharpen language. gerunds often act as **term smells** — signs that the concept has not been distilled to its essence. by replacement with precise nouns, prose becomes clearer, more direct, and more transferable.
|
|
5
|
+
|
|
6
|
+
---
|
|
7
|
+
|
|
8
|
+
## 🎯 purpose of the tactic
|
|
9
|
+
- **distill essence**: shift from description of activity to naming of outcome, resource, or structure.
|
|
10
|
+
- **remove ambiguity**: avoid blurred meanings (e.g., *“text”* vs. the act of inscription).
|
|
11
|
+
- **increase precision**: force the author to clarify whether they mean *plan*, *strategy*, *education*, *knowledge*, etc.
|
|
12
|
+
- **discipline thought**: strengthen conceptual rigor by avoiding convenient but vague shortcuts.
|
|
13
|
+
|
|
14
|
+
---
|
|
15
|
+
|
|
16
|
+
## 🔍 how the tactic works
|
|
17
|
+
1. **scan text for gerund forms** (*-ing words that function as nouns*).
|
|
18
|
+
- examples: *thought, plan, structure, network* as replacements.
|
|
19
|
+
2. **apply the smell test**: substitution, scope, outcome, and convenience.
|
|
20
|
+
3. **replace with distilled nouns** that capture the core meaning.
|
|
21
|
+
- *thought* instead of “thinking”
|
|
22
|
+
- *plan / strategy / coordination* instead of “planning”
|
|
23
|
+
- *relationships / contacts / repute* instead of “networking”
|
|
24
|
+
|
|
25
|
+
---
|
|
26
|
+
|
|
27
|
+
## 📚 examples
|
|
28
|
+
|
|
29
|
+
### before
|
|
30
|
+
- *“effective planning is key to success.”*
|
|
31
|
+
### after
|
|
32
|
+
- *“an effective plan is key to success.”*
|
|
33
|
+
- *“strategy is key to success.”*
|
|
34
|
+
|
|
35
|
+
---
|
|
36
|
+
|
|
37
|
+
### before
|
|
38
|
+
- *“her teaching inspired the students.”*
|
|
39
|
+
### after
|
|
40
|
+
- *“her instruction inspired the students.”*
|
|
41
|
+
- *“her education work inspired the students.”*
|
|
42
|
+
|
|
43
|
+
---
|
|
44
|
+
|
|
45
|
+
### before
|
|
46
|
+
- *“thinking shapes culture.”*
|
|
47
|
+
### after
|
|
48
|
+
- *“thought shapes culture.”*
|
|
49
|
+
- *“reason shapes culture.”*
|
|
50
|
+
|
|
51
|
+
---
|
|
52
|
+
|
|
53
|
+
## 📌 takeaway
|
|
54
|
+
the **tactic of gerund removal** forces every concept to pass through the fire of distillation. fuzzy process-terms yield to sharper essences, ambiguity reduces, and conceptual clarity strengthens.
|
|
55
|
+
in disciplined prose, *every gerund is guilty until proven otherwise*.
|