@techierathore/techieflow 1.0.4 → 1.1.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.
Files changed (98) hide show
  1. package/.claude/commands/TechieFlow/tasks/_owner-language.md +1 -0
  2. package/.claude/commands/TechieFlow/tasks/_status-update-gate.md +4 -3
  3. package/.claude/commands/TechieFlow/tasks/amend-docs.md +1 -1
  4. package/.claude/commands/TechieFlow/tasks/day1-brownfield.md +1 -1
  5. package/.claude/commands/TechieFlow/tasks/day1-greenfield.md +1 -1
  6. package/.claude/commands/TechieFlow/tasks/fix-issues.md +2 -2
  7. package/.claude/commands/TechieFlow/tasks/generate-html.md +2 -2
  8. package/.claude/commands/TechieFlow/tasks/handoff-phase.md +2 -2
  9. package/.claude/commands/TechieFlow/tasks/mockups.md +1 -1
  10. package/.claude/commands/TechieFlow/tasks/productguide.md +2 -2
  11. package/.claude/commands/TechieFlow/tasks/render-workflow-docs.md +1 -1
  12. package/.claude/commands/TechieFlow/tasks/triage-issues.md +2 -2
  13. package/.opencode/plugin/techieflow.js +179 -7
  14. package/.tfcore/hooks/block-git.sh +4 -2
  15. package/.tfcore/hooks/guard-build.sh +5 -1
  16. package/.tfcore/hooks/guard-db.sh +6 -4
  17. package/.tfcore/hooks/guard-status-html.sh +86 -2
  18. package/.tfcore/hooks/guard-verify.sh +8 -3
  19. package/.tfcore/hooks/sweep-artifacts.sh +46 -0
  20. package/.tfcore/standards/owner-words.txt +23 -0
  21. package/.tfcore/tasks/_owner-language.md +1 -0
  22. package/.tfcore/tasks/_status-update-gate.md +4 -3
  23. package/.tfcore/tasks/amend-docs.md +1 -1
  24. package/.tfcore/tasks/day1-brownfield.md +1 -1
  25. package/.tfcore/tasks/day1-greenfield.md +1 -1
  26. package/.tfcore/tasks/fix-issues.md +2 -2
  27. package/.tfcore/tasks/generate-html.md +2 -2
  28. package/.tfcore/tasks/handoff-phase.md +2 -2
  29. package/.tfcore/tasks/mockups.md +1 -1
  30. package/.tfcore/tasks/productguide.md +2 -2
  31. package/.tfcore/tasks/render-workflow-docs.md +1 -1
  32. package/.tfcore/tasks/triage-issues.md +2 -2
  33. package/.tfcore/telemetry/SCHEMA.md +4 -0
  34. package/.tfcore/telemetry/install-metrics.sh +3 -2
  35. package/.tfcore/telemetry/tf-metrics.sh +19 -2
  36. package/.tfcore/templates/v4custom/app-agents-md-tmpl.md +6 -0
  37. package/.tfcore/templates/v4custom/app-brd-tmpl.md +5 -3
  38. package/.tfcore/templates/v4custom/app-phase-brd-tmpl.md +94 -0
  39. package/.tfcore/templates/v4custom/app-phase-uidesign-tmpl.md +60 -0
  40. package/.tfcore/templates/v4custom/app-uidesign-tmpl.md +4 -2
  41. package/.tfcore/templates/v4custom/build-subagent-prompt.md +2 -2
  42. package/.tfcore/templates/v4custom/html-render-shell.md +4 -2
  43. package/.tfcore/utils/__pycache__/tf-devguide-list.cpython-312.pyc +0 -0
  44. package/.tfcore/utils/__pycache__/tf-doc-check.cpython-312.pyc +0 -0
  45. package/.tfcore/utils/__pycache__/tf-misses-md.cpython-312.pyc +0 -0
  46. package/.tfcore/utils/__pycache__/tf-render-html.cpython-312.pyc +0 -0
  47. package/.tfcore/utils/__pycache__/tf-split-brd.cpython-312.pyc +0 -0
  48. package/.tfcore/utils/__pycache__/tf-status-facts.cpython-312.pyc +0 -0
  49. package/.tfcore/utils/__pycache__/tf-triage.cpython-312.pyc +0 -0
  50. package/.tfcore/utils/__pycache__/tf-verify-list.cpython-312.pyc +0 -0
  51. package/.tfcore/utils/__pycache__/tf-verify-verdict.cpython-312.pyc +0 -0
  52. package/.tfcore/utils/tf-assets-browser.mjs +96 -0
  53. package/.tfcore/utils/tf-assets.sh +97 -12
  54. package/.tfcore/utils/tf-brd-status.py +14 -5
  55. package/.tfcore/utils/tf-build-list.py +80 -12
  56. package/.tfcore/utils/tf-build-list.sh +2 -1
  57. package/.tfcore/utils/tf-build.sh +88 -15
  58. package/.tfcore/utils/tf-ci-repro.py +685 -0
  59. package/.tfcore/utils/tf-ci-repro.sh +24 -0
  60. package/.tfcore/utils/tf-devguide-list.py +47 -22
  61. package/.tfcore/utils/tf-doc-check.py +136 -6
  62. package/.tfcore/utils/tf-doc-tests.sh +79 -0
  63. package/.tfcore/utils/tf-emit.sh +92 -35
  64. package/.tfcore/utils/tf-feedback.sh +13 -0
  65. package/.tfcore/utils/tf-fix-close.sh +79 -29
  66. package/.tfcore/utils/tf-goal.sh +12 -12
  67. package/.tfcore/utils/tf-harness.sh +9 -4
  68. package/.tfcore/utils/tf-lock.sh +29 -0
  69. package/.tfcore/utils/tf-log-miss.py +34 -8
  70. package/.tfcore/utils/tf-login.mjs +167 -0
  71. package/.tfcore/utils/tf-misses-md.py +10 -4
  72. package/.tfcore/utils/tf-mockup-parity.mjs +427 -63
  73. package/.tfcore/utils/tf-mockup-parity.sh +14 -2
  74. package/.tfcore/utils/tf-owner-text.py +233 -0
  75. package/.tfcore/utils/tf-owner-text.sh +14 -0
  76. package/.tfcore/utils/tf-phase.sh +15 -1
  77. package/.tfcore/utils/tf-portable.sh +230 -0
  78. package/.tfcore/utils/tf-render-html.py +60 -2
  79. package/.tfcore/utils/tf-selfcheck.sh +39 -6
  80. package/.tfcore/utils/tf-split-brd.py +11 -1
  81. package/.tfcore/utils/tf-status-evidence.sh +11 -9
  82. package/.tfcore/utils/tf-status-facts.py +72 -32
  83. package/.tfcore/utils/tf-triage.py +62 -16
  84. package/.tfcore/utils/tf-triage.sh +2 -0
  85. package/.tfcore/utils/tf-verify-boot.sh +263 -43
  86. package/.tfcore/utils/tf-verify-emit.sh +20 -0
  87. package/.tfcore/utils/tf-verify-env.sh +33 -4
  88. package/.tfcore/utils/tf-verify-list.py +75 -8
  89. package/.tfcore/utils/tf-verify-screens.mjs +171 -32
  90. package/.tfcore/utils/tf-verify-screens.sh +8 -3
  91. package/.tfcore/utils/tf-verify-tests.sh +215 -14
  92. package/.tfcore/utils/tf-verify-verdict.py +48 -9
  93. package/.tfcore/utils/tf_defect.py +27 -0
  94. package/.tfcore/utils/tf_feedback.py +209 -0
  95. package/.tfcore/utils/tf_roadmap.py +35 -0
  96. package/README.md +4 -0
  97. package/docs/TechieFlow-Installation.md +5 -3
  98. package/package.json +1 -1
@@ -0,0 +1,167 @@
1
+ // TechieFlow — the one sign-in recipe the browser-driven checks share (AppManager TF-011, 2026-09-14).
2
+ //
3
+ // tf-verify-screens.mjs learned to sign in through a page's own form (TF-033, TF-044) and to reach a
4
+ // screen whose document answers 401 because the sign-in lives in the page, not in a cookie
5
+ // (AppManager TF-006). tf-mockup-parity.mjs and tf-assets took only --cookie, so on such an app they
6
+ // could not get past the sign-in at all. The recipe lives here so every check reaches a screen the
7
+ // same way, and a lesson learned in one is learned in all.
8
+ //
9
+ // signIn(page, o) -> { attempted, ok, url, attempts, error }
10
+ // signedOut(page, o) -> true when the page is the sign-in page
11
+ // navigateInApp(page, o, route) -> true when the page drew something different
12
+ // reach(page, o, route) -> { status, url, reached, signedOut, error }: open a route, signed in
13
+ //
14
+ // o = { base, loginPath, user, password, attr = 'data-testid', settle = 1500, renderWait = 5000 }
15
+
16
+ // The first visible, usable match, trying the selectors IN ORDER. `.first()` over one selector list
17
+ // takes whichever match comes first in the page, so `input[type="text"]` at the end of the list
18
+ // picked a header search box standing before the email field (TF-044).
19
+ export async function pick(scope, selectors) {
20
+ for (const sel of selectors) {
21
+ const c = scope.locator(sel).first();
22
+ if (await c.count() && await c.isVisible().catch(() => false)) return c;
23
+ }
24
+ return null;
25
+ }
26
+
27
+ const LOGIN_ATTEMPTS = 4;
28
+ const opts = (o) => ({ attr: 'data-testid', settle: 1500, renderWait: 5000, ...o, base: (o.base || '').replace(/\/$/, '') });
29
+
30
+ export async function signIn(page, o) {
31
+ const { base, loginPath, user, password, attr, settle } = opts(o);
32
+ if (!loginPath || !user) return { attempted: false };
33
+ const onLogin = () => page.url().startsWith(base + loginPath);
34
+ try {
35
+ await page.goto(base + loginPath, { waitUntil: 'domcontentloaded', timeout: 30000 });
36
+ await page.waitForLoadState('networkidle', { timeout: 10000 }).catch(() => {});
37
+ // a page that draws its form a moment after it arrives has no field to pick yet
38
+ await page.waitForSelector('input', { state: 'visible', timeout: 15000 }).catch(() => {});
39
+ const INPUT = ':is(input, textarea)';
40
+ const USER_FIELD = [`${INPUT}[${attr}*="email" i]`, `${INPUT}[${attr}*="user" i]`, 'input[type="email"]', 'input[autocomplete="username"]',
41
+ 'input[name*="email" i]', 'input[name*="user" i]', 'input[id*="email" i]', 'input[id*="user" i]', 'form input[type="text"]'];
42
+ const PASS_FIELD = ['input[type="password"]', `${INPUT}[${attr}*="pass" i]`];
43
+ // The button, never a field: "login-email" and "login-pass" contain "login" too, and taking the
44
+ // first test id with "login" in it clicked the email box, so sign-in never submitted (TF-033).
45
+ const BTN = `:is(button, a, [role="button"], input[type="submit"], input[type="button"])`;
46
+ const BUTTON = ['button[type="submit"]', 'input[type="submit"]', `${BTN}[${attr}*="submit" i]`, `${BTN}[${attr}*="signin" i]`,
47
+ `${BTN}[${attr}*="sign-in" i]`, `${BTN}[${attr}*="login" i]`, 'button'];
48
+ // A page drawn on the server first and made interactive a moment later replaces its fields when
49
+ // it becomes interactive: what was typed before that is gone, and a press before it does nothing.
50
+ // Waiting for the network proves neither, and every stack takes its own time. So the test is the
51
+ // result: the typed values are still in the fields when the button is pressed, and the page then
52
+ // leaves the sign-in address. Otherwise type again and press again. TfLens, 2026-09-12: the email
53
+ // read back empty the instant after it was typed, and the second attempt signed in (TF-044).
54
+ let why = 'the typed values did not stay in the fields';
55
+ for (let attempt = 1; attempt <= LOGIN_ATTEMPTS; attempt++) {
56
+ if (!onLogin()) break;
57
+ const u = await pick(page, USER_FIELD);
58
+ if (!u) return { attempted: true, ok: false, error: 'no user or email field found on the sign-in page' };
59
+ const p = await pick(page, PASS_FIELD);
60
+ try {
61
+ await u.fill(user, { timeout: 10000 });
62
+ if (p) await p.fill(password || '', { timeout: 10000 });
63
+ await page.waitForTimeout(400);
64
+ const kept = (await u.inputValue()) === user && (!p || (await p.inputValue()) === (password || ''));
65
+ if (!kept) { why = 'the typed values did not stay in the fields'; continue; }
66
+ const form = u.locator('xpath=ancestor::form[1]');
67
+ const btn = (await form.count() ? await pick(form, BUTTON) : null) || await pick(page, BUTTON);
68
+ if (!btn) return { attempted: true, ok: false, error: 'no sign-in button found (a submit button, or a button whose test id says submit, signin or login)' };
69
+ await btn.click({ timeout: 10000 });
70
+ await page.waitForURL((x) => !x.href.startsWith(base + loginPath), { timeout: 6000 }).catch(() => {});
71
+ why = 'the form was submitted with the values in place and the page stayed on the sign-in address';
72
+ } catch (e) {
73
+ if (onLogin()) why = e.message.split('\n')[0];
74
+ }
75
+ if (!onLogin()) {
76
+ await page.waitForLoadState('networkidle', { timeout: 15000 }).catch(() => {});
77
+ await page.waitForTimeout(settle);
78
+ return { attempted: true, ok: true, url: page.url(), attempts: attempt };
79
+ }
80
+ }
81
+ if (!onLogin()) return { attempted: true, ok: true, url: page.url(), attempts: 1 };
82
+ return { attempted: true, ok: false, url: page.url(), attempts: LOGIN_ATTEMPTS, error: `still on the sign-in page after ${LOGIN_ATTEMPTS} attempts: ${why}` };
83
+ } catch (e) {
84
+ return { attempted: true, ok: false, error: e.message.split('\n')[0] };
85
+ }
86
+ }
87
+
88
+ // The page is signed out when it sits on the sign-in address, or when it draws a sign-in form: a
89
+ // password field WITH a button that says sign in / log in beside it. A password field alone is not
90
+ // the sign-in page — AppManager's signed-in "Create user" form has one for the new account, and
91
+ // reading it as the sign-in page graded that screen unreachable (AppManager TF-012).
92
+ export async function signedOut(page, o) {
93
+ const { loginPath, attr } = opts(o);
94
+ try {
95
+ if (loginPath && new URL(page.url()).pathname.startsWith(loginPath)) return true;
96
+ const pw = page.locator('input[type="password"]').first();
97
+ if (!(await pw.count()) || !(await pw.isVisible().catch(() => false))) return false;
98
+ const form = pw.locator('xpath=ancestor::form[1]');
99
+ const scope = (await form.count()) ? form : page;
100
+ const BTN = ':is(button, a, [role="button"], input[type="submit"], input[type="button"])';
101
+ const said = scope.locator(`${BTN}:visible`).filter({ hasText: /^\s*(sign\s*in|log\s*in|login|signin)\s*$/i }).first();
102
+ if (await said.count()) return true;
103
+ const named = scope.locator(`${BTN}[${attr}*="signin" i], ${BTN}[${attr}*="sign-in" i], ${BTN}[${attr}*="login" i]`).first();
104
+ return (await named.count()) > 0 && (await named.isVisible().catch(() => false));
105
+ } catch (e) { return true; }
106
+ }
107
+
108
+ // Open a route from inside the page, the way its own links do, so a sign-in held by the page survives.
109
+ // It counts only when the page drew something different: a server-drawn page has no router to answer
110
+ // the event, and grading the page it was already on under another screen's name would be a false pass.
111
+ export async function navigateInApp(page, o, route) {
112
+ const { settle } = opts(o);
113
+ try {
114
+ const before = await page.evaluate(() => document.body ? document.body.innerText : '');
115
+ await page.evaluate((r) => { history.pushState({}, '', r); window.dispatchEvent(new PopStateEvent('popstate', { state: {} })); }, route);
116
+ await page.waitForLoadState('networkidle', { timeout: 10000 }).catch(() => {});
117
+ await page.waitForTimeout(settle);
118
+ const after = await page.evaluate(() => document.body ? document.body.innerText : '');
119
+ return after !== before;
120
+ } catch (e) { return false; }
121
+ }
122
+
123
+ // Wait for the page to draw something: an anchored control, text, or a form control (TF-021).
124
+ export async function waitForRender(page, o, anchors = []) {
125
+ const { attr, renderWait } = opts(o);
126
+ if (renderWait <= 0) return 0;
127
+ const t0 = Date.now();
128
+ try {
129
+ await page.waitForFunction(({ anchors, attr }) => {
130
+ if (anchors && anchors.length) return anchors.some((id) => document.querySelector(`[${attr}="${CSS.escape(id)}"]`));
131
+ return (document.body && (document.body.innerText || '').trim().length > 0)
132
+ || document.querySelectorAll('input, select, textarea, img, svg, canvas, video').length > 0;
133
+ }, { anchors, attr }, { timeout: renderWait, polling: 100 });
134
+ } catch (e) { /* nothing appeared in time: grade what is there */ }
135
+ return Date.now() - t0;
136
+ }
137
+
138
+ // Open a route signed in. The document of a signed-in screen may answer 401 or 403 when the sign-in
139
+ // lives in the page's own connection and not in a cookie (AppManager TF-006): then the page is judged
140
+ // by what it draws. Signed in, the screen is reached and `reached` says how. Still signed out, the
141
+ // tool signs in again and opens the screen from inside the page. Returns the status to grade on:
142
+ // 200 when the page drew the screen signed in, whatever the document answered.
143
+ export async function reach(page, o, route) {
144
+ const { base, loginPath, user, settle } = opts(o);
145
+ let status = 0, url = '', error = '';
146
+ try {
147
+ const resp = await page.goto(base + route, { waitUntil: 'domcontentloaded', timeout: 30000 });
148
+ await page.waitForLoadState('networkidle', { timeout: 10000 }).catch(() => {});
149
+ await page.waitForTimeout(settle);
150
+ status = resp ? resp.status() : 0; url = page.url();
151
+ } catch (e) { return { status: 0, url: '', reached: '', signedOut: false, error: e.message.split('\n')[0] }; }
152
+ const out = { status, document_status: status, url, reached: '', signedOut: false, error };
153
+ if (loginPath && user && (status === 401 || status === 403)) {
154
+ await waitForRender(page, o);
155
+ let how = `answered HTTP ${status}, then drew the screen signed in`;
156
+ if (await signedOut(page, o)) {
157
+ how = '';
158
+ const again = await signIn(page, o);
159
+ if (again.ok && await navigateInApp(page, o, route) && !(await signedOut(page, o))) how = `answered HTTP ${status}; opened from inside the page after signing in`;
160
+ }
161
+ if (how) { out.reached = how; out.status = 200; out.url = page.url(); }
162
+ else out.signedOut = true;
163
+ } else if (loginPath && url && new URL(url).pathname.startsWith(loginPath) && !route.startsWith(loginPath)) {
164
+ out.signedOut = true;
165
+ }
166
+ return out;
167
+ }
@@ -4,7 +4,7 @@
4
4
  python3 .tfcore/utils/tf-misses-md.py [--root <repo>] [--app <App>] [--quiet]
5
5
 
6
6
  Rebuilds docs/<App>-Misses.md from docs/metrics/misses.jsonl: one row per `miss` record, newest first,
7
- in three tables (open, fixed, will not fix), each row holding the miss id, the owning row, when and
7
+ in up to four tables (open, fixed, will not fix, withdrawn by a miss-void), each row holding the miss id, the owning row, when and
8
8
  by whom it was found, whose gap it was (the `sort` field, folded from any miss-amend) and the `what`
9
9
  sentence. Markdown only — there is no HTML sibling: the miss log is read by agents and by the owner
10
10
  in markdown, and tf-render-html.py refuses it (owner, 2026-09-08; an HTML copy nobody opened was
@@ -108,11 +108,15 @@ def build(root, app):
108
108
  if prev is None or (f.get("ts") or "") >= (prev.get("ts") or ""):
109
109
  latest[f["miss_id"]] = f
110
110
 
111
+ voids = {r.get("miss_id"): r for r in recs if r.get("kind") == "miss-void"}
112
+
111
113
  def state(m):
114
+ if m["miss_id"] in voids:
115
+ return "withdrawn"
112
116
  v = (latest.get(m["miss_id"]) or {}).get("verdict_after")
113
117
  return "fixed" if v == "Verified" else "wont-fix" if v == "wont-fix" else "open"
114
118
 
115
- groups = {"open": [], "fixed": [], "wont-fix": []}
119
+ groups = {"open": [], "fixed": [], "wont-fix": [], "withdrawn": []}
116
120
  for m in sorted(by_id.values(), key=lambda r: (r.get("miss_id") or "", r.get("ts") or ""), reverse=True):
117
121
  groups[state(m)].append(m)
118
122
 
@@ -138,12 +142,12 @@ def build(root, app):
138
142
  today = datetime.datetime.now(datetime.timezone.utc).strftime("%Y-%m-%d")
139
143
  n = len(by_id)
140
144
  lines = [f"# {app} — Misses", "", "| | |", "|---|---|", f"| App | {app} |",
141
- f"| Count | {n} logged: {len(groups['open'])} open, {len(groups['fixed'])} fixed, {len(groups['wont-fix'])} will not fix |",
145
+ f"| Count | {n} logged: {len(groups['open'])} open, {len(groups['fixed'])} fixed, {len(groups['wont-fix'])} will not fix" + (f", {len(groups['withdrawn'])} withdrawn" if groups["withdrawn"] else "") + " |",
142
146
  "| Source | `docs/metrics/misses.jsonl`, one row per miss record. Rewritten by `tf-misses-md.sh` on every new record. Never edit it: a wrong row is corrected by a new record. |",
143
147
  f"| Updated | {today} |", "", SORT_LEGEND, ""]
144
148
  if not n:
145
149
  lines += ["No miss has been logged yet.", ""]
146
- for key, title in (("open", "Open"), ("fixed", "Fixed"), ("wont-fix", "Will not fix")):
150
+ for key, title in (("open", "Open"), ("fixed", "Fixed"), ("wont-fix", "Will not fix"), ("withdrawn", "Withdrawn — logged in error")):
147
151
  rows = groups[key]
148
152
  if not rows:
149
153
  continue
@@ -157,6 +161,8 @@ def build(root, app):
157
161
  for m in rows:
158
162
  f = latest.get(m["miss_id"]) or {}
159
163
  closed = day(f.get("ts")) + (f" by {f['fix_cmd']}" if f.get("fix_cmd") else "")
164
+ if key == "withdrawn":
165
+ closed = f"{day(voids[m['miss_id']].get('ts'))}: {cell(voids[m['miss_id']].get('reason'))}"
160
166
  lines.append(f"| {ident(m)} | {found(m)} | {closed} | {gap(m)} | {what(m)} |")
161
167
  lines.append("")
162
168
  return "\n".join(lines), n