-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathRakefile
More file actions
857 lines (706 loc) · 24.7 KB
/
Copy pathRakefile
File metadata and controls
857 lines (706 loc) · 24.7 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
764
765
766
767
768
769
770
771
772
773
774
775
776
777
778
779
780
781
782
783
784
785
786
787
788
789
790
791
792
793
794
795
796
797
798
799
800
801
802
803
804
805
806
807
808
809
810
811
812
813
814
815
816
817
818
819
820
821
822
823
824
825
826
827
828
829
830
831
832
833
834
835
836
837
838
839
840
841
842
843
844
845
846
847
848
849
850
851
852
853
854
855
856
857
# frozen_string_literal: true
require 'rake'
require 'fileutils'
require 'shellwords'
desc 'Run local generation, tests, and ordered validation'
task ci: ['validate:fast', 'test', 'build', 'validate']
desc 'Verify committed artifacts with ordered validation and no regeneration'
task verify: ['validate:fast', 'test', 'build:committed', 'validate']
desc 'Audit the canonical archive relationship graph'
task :knowledge_graph do
sh 'ruby ./bin/generate_knowledge_graph.rb'
sh 'ruby ./bin/audit_knowledge_graph.rb'
end
desc 'Build the site (generate + jekyll build)'
task build: ['generate:all'] do
sh 'ruby ./bin/generate_last_modified.rb'
ENV['JEKYLL_ENV'] = 'production'
sh 'bundle exec jekyll clean --verbose'
sh 'bundle exec jekyll build --verbose'
rm_f '_site/AGENTS.html'
rm_f '_site/AGENTS.md'
end
desc 'Build the site from committed sources and generated artifacts'
task :'build:committed' do
ENV['JEKYLL_ENV'] = 'production'
ENV['SKIP_IMAGE_OPTIMIZATION'] = 'true'
sh 'bundle exec jekyll clean --verbose'
sh 'bundle exec jekyll build --verbose'
rm_f '_site/AGENTS.html'
rm_f '_site/AGENTS.md'
end
desc 'Regenerate data-driven site sources'
task generate: ['generate:all']
desc 'Run RSpec tests'
task :test do
sh 'bundle exec rspec'
end
desc 'Validate the built site'
task validate: ['validate:all']
namespace :generate do
desc 'Run all generation scripts (Legacy disk-based scripts are mostly deprecated by plugins)'
task all: [
:sync_links,
:context_summaries,
:video_completeness,
:archive_status,
:topics,
:interviewees,
:community_stories,
:resume_positions,
:archetype_resumes,
:career_datalake,
:executive_briefs,
:brief_pdfs,
:content_opportunities
]
task :career_datalake do
sh 'ruby ./bin/generate_career_datalake.rb'
end
task :archetype_resumes do
sh 'ruby ./bin/generate_archetype_resumes.rb'
end
task :executive_briefs do
sh 'ruby ./bin/generate_executive_brief_pages.rb'
end
task :brief_pdfs do
sh 'node ./bin/export_brief_pdfs.js'
end
task :content_opportunities do
sh 'ruby ./bin/generate_content_opportunities.rb'
end
task :sync_links do
sh './bin/sync_interview_asset_links.rb'
end
task :context_summaries do
sh 'ruby ./bin/generate_context_summaries.rb'
end
task :video_completeness do
sh 'ruby ./bin/generate_video_metadata_completeness.rb'
end
task :archive_status do
sh 'ruby ./bin/generate_archive_status.rb'
end
task :topics do
sh 'ruby ./bin/generate_interview_topics_page.rb'
end
task :interviewees do
sh 'ruby ./bin/generate_interviewees_page.rb'
end
task :community_stories do
sh 'ruby ./bin/generate_community_stories_page.rb'
end
task :resume_positions do
sh 'ruby ./bin/generate_resume_position_pages.rb'
end
task :blog_inventory do
sh 'ruby ./bin/generate_blog_import_inventory.rb'
end
task :wayback_pages do
sh 'ruby ./bin/generate_wayback_pages.rb'
end
task :wbm_backlog do
sh 'ruby ./bin/generate_wbm_asset_backlog.rb'
end
end
namespace :validate do
desc 'Run all validation scripts in increasing cost order'
task all: [:fast, :artifacts, :content, :rendered_site]
desc 'Run the fastest fail-fast hygiene and syntax checks'
task :fast => [:repo_hygiene, :markdown_lint, :data_uniqueness, :data_integrity]
desc 'Validate committed generated data before expensive prose and site checks'
task :artifacts => [
:last_modified_output,
:generated_freshness,
:resources_output,
:taxonomy_output,
:archive_surfaces,
:audit_transcripts
]
desc 'Run content, semantic, and narrative checks'
task :content => [
:ai_disclosures,
:metadata_completeness,
:position_dates,
:timeline_links,
:prose_humanity,
:vale,
:semantic_output,
:resume_claims
]
desc 'Run rendered-site, resume, SEO, and link checks'
task :rendered_site => [
:surface_exposure,
:public_positioning,
:'audit:public_surface',
:public_index_mode,
:seo_output,
:export_parity,
:resume_quality,
:ats_benchmarks,
:report_seo,
:seo_metadata_budget,
:htmlproofer
]
task :resume_quality do
sh 'ruby ./bin/validate_resume_quality.rb'
end
task :ats_benchmarks do
sh 'ruby ./bin/benchmark_ats_keywords.rb --fail-under=85.0 --min-archetype=75.0'
end
task :surface_exposure do
sh 'ruby ./bin/audit_surface_exposure.rb'
end
task :public_positioning do
sh 'ruby ./bin/validate_public_positioning.rb'
end
task :prose_humanity do
sh 'ruby ./bin/audit_prose_humanity.rb'
end
task :ai_disclosures do
sh 'ruby ./bin/validate_ai_disclosures.rb'
end
task :vale do
if system('which vale > /dev/null 2>&1')
vale_posts = Dir.glob('_posts/2026-*.md').reject do |path|
path.end_with?('2026-09-02-the-archive-i-could-finally-build.md')
end
vale_inputs = (vale_posts + ['case-studies/', 'docs/']).map(&:shellescape)
# Vale 3.20 panics on a Mermaid/table combination in this archive essay.
# Other prose and the separate prose audits still cover the published file.
sh "vale #{vale_inputs.join(' ')}"
else
puts 'Skipping Vale audit: vale binary not found on PATH.'
end
end
task :export_parity do
sh 'ruby ./bin/validate_exports.rb'
end
task :position_dates do
sh 'ruby ./bin/validate_position_dates.rb'
end
task :timeline_links do
sh 'ruby ./bin/validate_timeline_links.rb'
end
# Provenance gate: quantified career claims must resolve to a position file
# or a case_study block. Generated prose invents numbers -- three published
# posts claimed a 214-interview archive that has always held 207.
task :resume_claims do
sh 'ruby ./bin/validate_resume_claims.rb'
end
task :data_uniqueness do
sh 'ruby ./bin/validate_data_uniqueness.rb'
end
task :data_integrity do
sh 'ruby ./bin/validate_data.rb'
end
task :audit_transcripts => 'transcript:audit'
task :resources_output do
sh 'ruby ./bin/validate_resources_output.rb'
end
task :taxonomy_output do
sh 'ruby ./bin/validate_taxonomy_output.rb'
end
task :archive_surfaces do
sh 'ruby ./bin/validate_archive_surfaces.rb'
end
task :last_modified_output do
sh 'ruby ./bin/validate_last_modified_output.rb'
end
task :generated_freshness do
sh 'ruby ./bin/validate_generated_freshness.rb'
end
task :repo_hygiene do
sh 'ruby ./bin/validate_repo_hygiene.rb'
end
task :markdown_lint do
sh 'ruby ./bin/validate_markdown_lint.rb'
end
task :youtube_sync do
sh 'ruby ./bin/publish_youtube_metadata.rb --dry-run'
end
task :semantic_links do
sh 'ruby ./bin/generate_semantic_cross_links.rb'
end
task :linkedin_series do
sh 'ruby ./bin/generate_linkedin_series.rb'
end
task :metadata_completeness do
sh 'ruby ./bin/validate_metadata_completeness_budget.rb'
end
task :seo_output do
sh 'ruby ./bin/validate_seo_output.rb'
end
task :public_index_mode do
sh 'ruby ./bin/validate_public_index_mode.rb'
end
task :semantic_output do
sh 'ruby ./bin/validate_semantic_output.rb'
end
task :report_seo do
sh 'ruby ./bin/report_seo_metadata.rb'
end
task :seo_metadata_budget do
sh 'ruby ./bin/validate_seo_metadata_budget.rb'
end
task :htmlproofer do
require 'html-proofer'
options = {
assume_extension: true,
disable_external: true,
ignore_files: [/AGENTS\.html$/, %r{^/backlog/}, %r{^backlog/}],
ignore_urls: [%r{^https://www\.linkedin\.com/}, %r{^/backlog/}, %r{^mailto:\?}],
}
HTMLProofer.check_directory('./_site', options).run
end
end
namespace :import do
task :frogsbrain do
sh 'ruby ./bin/import_frogsbrain_local_snapshots.rb'
end
task :ironlanguages do
sh 'ruby ./bin/import_ironlanguages_local_snapshots.rb'
end
task :linkedin do
sh 'ruby ./bin/import_linkedin_articles.rb'
end
task :transcripts do
sh 'ruby ./bin/import_transcripts_from_outbox.rb'
end
task :wayback_blogger do
sh 'ruby ./bin/import_wayback_blogger_posts.rb'
end
task :wayback_ironlanguages do
sh 'ruby ./bin/import_wayback_ironlanguages_posts.rb'
end
task :wayback_wordpress do
sh 'ruby ./bin/import_wayback_wordpress_posts.rb'
end
task :witc_youtube do
sh 'ruby ./bin/import_witc_missing_youtube_assets.rb'
end
task :wordpress do
sh 'ruby ./bin/import_wordpress_local_snapshots.rb'
end
end
namespace :transcript do
desc 'Audit transcripts for missing files or content'
task :audit do
require_relative 'src/generators/archive_manager'
auditor = Generators::ArchiveManager::TranscriptAuditor.new(Dir.pwd)
report = auditor.run
puts "Transcript Audit"
puts "assets_total=#{report[:assets_total]}"
puts "assets_with_transcript_id=#{report[:assets_with_transcript_id]}"
puts "unique_transcript_ids_used=#{report[:unique_transcript_ids_used]}"
puts "transcript_files=#{report[:transcript_files_count]}"
puts "missing_transcript_files=#{report[:missing_files].size}"
puts "missing_transcript_content=#{report[:missing_content].size}"
puts "invalid_transcript_files=#{report[:invalid_files].size}"
puts "orphan_transcript_files=#{report[:orphan_files].size}"
puts "duplicate_transcript_id_usage=#{report[:duplicate_usage].size}"
unless report[:missing_files].empty?
puts "\nMissing transcript files:"
report[:missing_files].each { |f| puts " - asset=#{f[:asset_id]} transcript_id=#{f[:transcript_id]}" }
end
if report[:missing_files].empty? && report[:missing_content].empty? && report[:invalid_files].empty?
puts "\nTranscript audit passed."
else
warn "\nTranscript audit failed."
exit 1
end
end
desc 'Normalize transcript text (use APPLY=true to save changes)'
task :normalize do
require_relative 'src/generators/archive_manager'
apply = ENV['APPLY'] == 'true'
transcripts_dir = File.join(Dir.pwd, "_data", "transcripts")
paths = Dir.glob(File.join(transcripts_dir, "*.yml")).sort
changed = []
paths.each do |path|
payload = YAML.safe_load(File.read(path), permitted_classes: [Date, Time], aliases: true) || {}
original = payload["content"].to_s
normalized = Generators::ArchiveManager.normalize_transcript(original)
next if normalized == original
changed << path
if apply
payload["content"] = normalized
File.write(path, payload.to_yaml)
end
end
puts "transcript_files=#{paths.size}"
puts "changed=#{changed.size}"
changed.first(20).each { |path| puts " - #{Pathname.new(path).relative_path_from(Dir.pwd)}" }
puts "mode=#{apply ? 'apply' : 'dry-run'}"
end
task :prepare_staging do
sh 'ruby ./bin/prepare_transcript_id_staging.rb'
end
task :report_loops do
sh 'ruby ./bin/report_transcript_loops.rb'
end
desc 'Process a transcript using OpenAI (slug: interview slug, apply: save changes)'
task :process, [:slug] do |_t, args|
require_relative 'src/generators/transcript_processor'
slug = args[:slug]
apply = ENV['APPLY'] == 'true'
abort "Usage: rake transcript:process[slug] (APPLY=true to save)" unless slug
# 1. Load data
interview = YAML.safe_load(File.read('_data/interviews.yml'), permitted_classes: [Date, Time], aliases: true)['items'].find { |i| i['id'] == slug }
abort "Interview not found: #{slug}" unless interview
video_asset = YAML.safe_load(File.read('_data/video_assets.yml'), permitted_classes: [Date, Time], aliases: true)['items'].find { |v| v['id'] == interview['video_asset_id'] }
abort "Video asset not found for: #{slug}" unless video_asset
transcript_id = video_asset['transcript_id']
transcript_path = "_data/transcripts/#{transcript_id}.yml"
abort "Transcript file not found: #{transcript_path}" unless File.exist?(transcript_path)
transcript_payload = YAML.safe_load(File.read(transcript_path), permitted_classes: [Date, Time], aliases: true)
content = transcript_payload['content']
# 2. Process
puts "Processing #{slug} (transcript: #{transcript_id})..."
processor = Generators::TranscriptProcessor.new
result = processor.process(content, interview)
if result['error']
puts "Error processing transcript: #{result['error']}"
puts result['raw_response'] if result['raw_response']
exit 1
end
# 3. Output/Apply
if apply
puts "Applying changes to #{transcript_path}..."
# Preserve existing keys but update/add turns, speaker_map, and insights
transcript_payload['speaker_map'] = result['speaker_map']
transcript_payload['turns'] = result['turns']
transcript_payload['insights'] = result['insights']
# We keep 'content' for now as a fallback/historical record
File.write(transcript_path, transcript_payload.to_yaml)
puts "Done."
else
puts "\n--- DRY RUN RESULT ---"
puts "Speaker Map: #{result['speaker_map']}"
puts "Turns: #{result['turns']&.size || 0}"
puts "Insights: #{result['insights']&.size || 0}"
puts "\nFirst 3 turns:"
result['turns']&.first(3)&.each { |t| puts " #{t['speaker']}: #{t['text'][0..100]}..." }
puts "\nInsights:"
result['insights']&.each { |i| puts " - [#{i['type']}] #{i['statement']}" }
puts "\n(Use APPLY=true to save these changes to the YAML file)"
end
end
desc 'Run the Archive ETLT pipeline (usage: rake transcript:pipeline[stage,id])'
task :pipeline, [:stage, :id] do |_t, args|
cmd = "ruby ./bin/archive/pipeline.rb"
cmd += " #{args[:id]}" if args[:id]
cmd += " --stage=#{args[:stage]}" if args[:stage]
cmd += " --force" if ENV['FORCE'] == 'true'
sh cmd
end
desc 'Index enriched transcripts into zdots-ctx / my vector database'
task :index do
sh 'ruby ./bin/archive/pipeline.rb --stage=index'
end
desc 'Backfill intro/outro boundaries sidecars using theme song detector'
task :boundaries do
sh 'sh -c "cd ~/.config/zsh && bundle exec ./bin/zdots-backfill-boundaries --apply"'
end
desc 'Run forensic quality audit for turn length, interviewer overload, and word count drift'
task :forensic_audit do
sh 'ruby ./bin/final_quality_audit.rb'
end
end
namespace :maintenance do
task :apply_ugtastic_context do
sh 'ruby ./bin/apply_ugtastic_context_to_video_assets.rb'
end
task :merge_duplicates do
sh 'ruby ./bin/merge_duplicate_interview_publications.rb'
end
end
namespace :report do
task :legacy_logs do
sh 'ruby ./bin/report_legacy_domain_logs.rb'
end
task :seo do
sh 'ruby ./bin/report_seo_metadata.rb'
end
end
namespace :enrich do
task :non_transcript do
sh 'ruby ./bin/enrich_non_transcript_metadata.rb'
end
task :transcript do
sh 'ruby ./bin/enrich_transcript_metadata.rb'
end
end
namespace :extract do
task :ugtastic do
sh 'ruby ./bin/extract_ugtastic_context.rb'
end
task :wayback do
sh 'ruby ./bin/extract_wayback_content.rb'
end
end
namespace :discover do
task :wayback do
sh 'ruby ./bin/discover_wayback_posts_from_cdx.rb'
end
end
namespace :semantic do
desc 'Generate semantic graph artifacts'
task :graph do
sh 'ruby ./bin/visualize_semantic_graph.rb'
end
desc 'Generate semantic audit report'
task :audit do
sh 'ruby ./bin/semantic_audit.rb'
end
desc 'Generate semantic snapshot page'
task :snapshot do
sh 'ruby ./bin/generate_semantic_snapshot_page.rb'
end
end
namespace :audit do
desc 'Audit publishable content for privacy and oversharing review candidates'
task :public_surface do
sh 'ruby ./bin/audit_public_surface.rb'
end
desc 'Strict publication gate for privacy and evidence review candidates'
task :public_surface_strict do
sh 'ruby ./bin/audit_public_surface.rb --strict'
end
desc 'Prepare an audit prompt for ChatGPT'
task :prepare, [:slug] do |_t, args|
slug = args[:slug]
abort "Usage: rake audit:prepare[slug]" unless slug
sh "ruby bin/prepare_audit_prompt.rb #{slug}"
end
desc 'Ingest an audit result from the inbox'
task :ingest, [:slug] do |_t, args|
slug = args[:slug]
abort "Usage: rake audit:ingest[slug]" unless slug
inbox_file = "backlog/audit/inbox/#{slug}.yml"
abort "Error: No file found at #{inbox_file}" unless File.exist?(inbox_file)
sh "ruby bin/ingest_audit.rb #{slug} #{inbox_file}"
end
desc 'Prepare the next wave of interviews for audit'
task :prepare_wave do
require 'yaml'
# Find next "To Do" canonical reviews from Backlog.md
backlog = File.read('Backlog.md')
tasks = backlog.scan(/\| \[task-\d+\]\(.*?\) \| Canonical Review \((.*?)\) \| To Do \|/).flatten
# Map of specific task names to their actual slugs to handle the messy ones
slug_overrides = {
'Dickinson & Beehler' => 'interview-with-david-dickinson-and-ross-beehler-general',
'Dave Thomas' => 'dave-thomas-goto-conference-and-community-goto-conference-and-community',
'Gil Tene' => 'interview-with-gil-tene-azul-cto-javaone-rock-star-goto-chicago-2-general',
'Chris Whitaker' => 'interview-with-chris-whitaker-general',
'Dean Wampler' => 'interview-with-dean-wampler-general',
'Zinni, Buda, Howe' => 'interview-with-anthony-zinni-and-jon-buda-and-shay-howe-general',
'Giles Bowkett - Rails' => 'interview-with-giles-bowkett-rails'
}
video_assets = YAML.safe_load(File.read('_data/video_assets.yml'), permitted_classes: [Date, Time], aliases: true)
valid_slugs = []
tasks.each do |task_name|
break if valid_slugs.size >= 5
clean_name = task_name.sub(/ - Duplicate/, '').strip
# Try exact override, or "first-last-general", or "interview-with-first-last-general"
base_slug = clean_name.downcase.gsub(/[^a-z0-9]+/, '-')
slug_candidates = [
slug_overrides[clean_name],
"#{base_slug}-general",
"interview-with-#{base_slug}-general",
"interview-with-#{base_slug}"
].compact
# Find first candidate that has a valid asset mapping and transcript
matched_slug = nil
slug_candidates.each do |candidate|
asset = video_assets['items'].find { |v| v['interview_id'] == candidate || v['id'] == candidate }
if asset && asset['transcript_id']
transcript_path = "_data/transcripts/#{asset['transcript_id']}.yml"
if File.exist?(transcript_path)
matched_slug = candidate
break
end
end
end
valid_slugs << matched_slug if matched_slug
end
if valid_slugs.empty?
puts "No more 'To Do' tasks found that have existing transcript files."
exit 0
end
puts "Preparing Wave 5: #{valid_slugs.join(', ')}"
valid_slugs.each do |slug|
begin
sh "ruby bin/prepare_audit_prompt.rb #{slug}"
rescue => e
puts "Skipping #{slug}: #{e.message}"
end
end
puts "\nWave 5 Prepared in backlog/audit/outbox/"
end
end
desc 'Run local development server'
task :server do
sh './bin/server'
end
desc 'Manage transcripts'
task :transcripts do
sh './bin/transcripts'
end
desc 'Show deployment status'
task :deploy_status do
sh './bin/deploy_status'
end
namespace :deploy do
desc 'Monitor active GitHub Actions deployment with learned metrics and ETA'
task :monitor do
sh 'ruby ./bin/monitor_deployment.rb'
end
end
desc 'Run Playwright smoke checks'
task :smoke do
sh './bin/smoke_playwright.sh'
end
desc 'Print sitemap coverage summary'
task :sitemap do
sh 'ruby ./bin/visualize_sitemap.rb'
end
namespace :transcript do
desc 'Run a single pass of the continuous autonomous virtuous loop'
task :loop do
sh 'ruby bin/autonomous_virtuous_loop.rb --once'
end
desc 'Run continuous background loop daemon'
task :daemon do
sh 'ruby bin/autonomous_virtuous_loop.rb --daemon --interval 300'
end
desc 'Full archive ETLT pipeline check'
task :pipeline, [:stage, :id] do |_t, args|
stage = args[:stage] || 'validate'
id = args[:id]
cmd = "ruby bin/archive/pipeline.rb --stage #{stage}"
cmd += " --id #{id}" if id
sh cmd
end
desc 'Index enriched transcripts into zdots-ctx (pgvector)'
task :index do
sh './bin/transcript_ops.rb --index-enriched'
end
desc 'Backfill theme song intro/outro boundary sidecars'
task :boundaries do
sh './bin/transcript_ops.rb --backfill-boundaries'
end
desc 'Run complete forensic validation audit across all transcripts'
task :forensic_audit do
sh './bin/transcript_ops.rb --forensic-audit'
end
desc 'Export WebVTT captions (.vtt) and YouTube captions sync manifest'
task :export_subtitles do
sh 'ruby bin/export_subtitles.rb'
end
desc 'Run YouTube captions sync CLI dry-run or upload'
task :sync_youtube_captions do
sh 'ruby bin/sync_youtube_captions.rb'
end
desc 'Run 6-vector deep historical research across transcript canon'
task :deep_research do
sh 'ruby bin/deep_research_interview.rb --all'
end
desc 'Compile research priming vocabulary for transcription pipeline enrichment'
task :enrich_pipeline do
sh 'ruby bin/enrich_pipeline_with_research.rb'
end
desc 'Sync research sidecars & priming terms to zdots-ctx (my PostgreSQL database)'
task :sync_zdots_ctx do
sh 'ruby bin/sync_zdots_ctx.rb'
end
desc 'Automate zdots platform AI research queries (zdots-ask & zdots-ctx)'
task :zdots_ai_research do
sh 'ruby bin/zdots_ai_researcher.rb'
end
end
namespace :job do
desc 'Evaluate a job lead (usage: rake job:evaluate[lead_id], add ,true to escalate)'
task :evaluate, %i[lead_id escalate] do |_t, args|
lead_id = args[:lead_id] || 112
flag = args[:escalate] ? ' --escalate' : ''
sh "ruby bin/evaluate_job_lead.rb --lead #{lead_id}#{flag}"
end
desc 'Generate an executive brief for a job lead (usage: rake job:brief[lead_id], add ,true to escalate)'
task :brief, %i[lead_id escalate] do |_t, args|
lead_id = args[:lead_id] || 112
flag = args[:escalate] ? ' --escalate' : ''
sh "ruby bin/evaluate_job_lead.rb --lead #{lead_id}#{flag}"
end
end
namespace :benchmark do
desc 'Run ATS Parser and Keyword Density benchmark suite'
task :ats do
sh 'ruby ./bin/benchmark_ats_keywords.rb'
end
end
namespace :localhost do
desc 'Sync built _site to /opt/homebrew/var/www/just3ws.github.io with proper permissions'
task :sync do
webroot = '/opt/homebrew/var/www/just3ws.github.io'
sh "mkdir -p #{webroot}"
sh "rsync -a --delete _site/ #{webroot}/"
sh "chmod o+x $(dirname #{webroot}) && chmod -R o+rX #{webroot}"
end
end
namespace :audit do
desc 'Run TMI / PII / PHI / *ism audit across the full sitemap (human output, medium+ severity)'
task :tmi do
sh 'ruby bin/tmi_audit_sitemap.rb --severity medium'
end
desc 'Run TMI audit and emit full JSON report to tmp/tmi_audit.json'
task :tmi_json do
sh 'mkdir -p tmp && ruby bin/tmi_audit_sitemap.rb --json --severity medium > tmp/tmi_audit.json'
puts 'Report written to tmp/tmi_audit.json'
end
desc 'TMI audit — hiring surfaces only (strictest gate, all severities)'
task :tmi_hiring do
sh 'ruby bin/tmi_audit_sitemap.rb --url-filter "/(resume|resumes|exports|history)/" --severity low'
end
desc 'Dry-run: find source files missing sitemap:false that have noindex in HTML'
task :sitemap_exclusions_dry do
sh 'ruby bin/tmi_fix_sitemap_exclusions.rb --dry-run --verbose'
end
desc 'Fix: add sitemap:false front matter to all noindex/private source files'
task :fix_sitemap_exclusions do
sh 'ruby bin/tmi_fix_sitemap_exclusions.rb --verbose'
end
desc 'Full automation pipeline: fix exclusions → build → run audit → report'
task :tmi_pipeline do
puts '=== Step 1: Fix sitemap exclusions ==='
sh 'ruby bin/tmi_fix_sitemap_exclusions.rb --verbose'
puts "\n=== Step 2: Rebuild site ==="
sh 'bundle exec jekyll build 2>&1 | tail -3'
puts "\n=== Step 3: Run full TMI audit ==="
sh 'ruby bin/tmi_audit_sitemap.rb --severity medium'
puts "\n=== Step 4: Emit JSON report ==="
sh 'mkdir -p tmp && ruby bin/tmi_audit_sitemap.rb --json --severity medium > tmp/tmi_audit.json'
puts 'Pipeline complete. Report at tmp/tmi_audit.json'
end
desc 'CI gate: fail if any quarantine findings exist on hiring surfaces'
task :tmi_gate do
require 'json'
require 'open3'
out, _err, status = Open3.capture3(
'ruby bin/tmi_audit_sitemap.rb --json --severity medium ' \
'--url-filter "/(resume|resumes|exports|history)/"'
)
data = JSON.parse(out)
quars = data['results'].select { |r| r['decision'] == 'quarantine' }
if quars.empty?
puts "TMI gate: PASS (0 quarantine findings on hiring surfaces)"
else
warn "TMI gate: FAIL — #{quars.size} quarantine finding(s) on hiring surfaces:"
quars.each do |r|
guards = r['findings'].map { |f| f['guard'] }.uniq.join(',')
warn " [#{guards}] #{r['url'].sub('https://www.just3ws.com', '')}"
end
exit 1
end
end
end