Reframe Feynman for general research workflows

This commit is contained in:
Advait Paliwal
2026-03-20 12:03:35 -07:00
parent 4bb1823a20
commit 806ea80c2c
21 changed files with 242 additions and 9 deletions

View File

@@ -13,6 +13,8 @@ Operating rules:
- Use the installed Pi research packages for broader web/PDF access, document parsing, session recall, background processes, experiment tracking, citations, and delegated subtasks when they reduce friction.
- When an experiment is warranted, write the code or scripts, run them, capture outputs, and save artifacts to disk.
- Treat polished scientific communication as part of the job: structure reports cleanly, use Markdown deliberately, and use LaTeX math when equations clarify the argument.
- For any source-based answer, include an explicit Sources section with direct URLs, not just paper titles.
- When citing papers from alpha-backed tools, prefer direct arXiv or alphaXiv links and include the arXiv ID.
- Default artifact locations:
- outputs/ for reviews, reading lists, and summaries
- experiments/ for runnable experiment code and result logs

View File

@@ -33,6 +33,8 @@ function printHelp(): void {
/lit-review <topic> Expand the literature review prompt template
/replicate <paper> Expand the replication prompt template
/reading-list <topic> Expand the reading list prompt template
/research-memo <topic> Expand the general research memo prompt template
/compare-sources <topic> Expand the source comparison prompt template
/paper-code-audit <item> Expand the paper/code audit prompt template
/paper-draft <topic> Expand the paper-style writing prompt template
@@ -156,6 +158,7 @@ function normalizeFeynmanSettings(
if (!settings.defaultThinkingLevel) {
settings.defaultThinkingLevel = defaultThinkingLevel;
}
settings.theme = "feynman";
const authStorage = AuthStorage.create(authPath);
const modelRegistry = new ModelRegistry(authStorage);
@@ -175,6 +178,19 @@ function normalizeFeynmanSettings(
writeFileSync(settingsPath, JSON.stringify(settings, null, 2) + "\n", "utf8");
}
function syncFeynmanTheme(appRoot: string, agentDir: string): void {
const sourceThemePath = resolve(appRoot, ".pi", "themes", "feynman.json");
const targetThemeDir = resolve(agentDir, "themes");
const targetThemePath = resolve(targetThemeDir, "feynman.json");
if (!existsSync(sourceThemePath)) {
return;
}
mkdirSync(targetThemeDir, { recursive: true });
writeFileSync(targetThemePath, readFileSync(sourceThemePath, "utf8"), "utf8");
}
async function main(): Promise<void> {
const here = dirname(fileURLToPath(import.meta.url));
const appRoot = resolve(here, "..");
@@ -209,6 +225,7 @@ async function main(): Promise<void> {
const sessionDir = resolve(values["session-dir"] ?? resolve(homedir(), ".feynman", "sessions"));
mkdirSync(sessionDir, { recursive: true });
mkdirSync(feynmanAgentDir, { recursive: true });
syncFeynmanTheme(appRoot, feynmanAgentDir);
const feynmanSettingsPath = resolve(feynmanAgentDir, "settings.json");
const feynmanAuthPath = resolve(feynmanAgentDir, "auth.json");
const thinkingLevel = normalizeThinkingLevel(values.thinking ?? process.env.FEYNMAN_THINKING) ?? "medium";