44 lines
2.3 KiB
Python
44 lines
2.3 KiB
Python
import db, tailor, audit, improve
|
|
|
|
db.init_db()
|
|
# force fast fallback so this test doesn't wait on the cold-loading/saturated LLM
|
|
db.set_setting('llm_timeout', '5')
|
|
import llm
|
|
llm.COOLDOWN = 5
|
|
print("DB init: OK (llm_timeout forced to 5s to exercise fallback)")
|
|
|
|
# classification
|
|
print("classify tech:", tailor.classify_track({"title": "DevOps Engineer", "description": "Linux Docker Python automation networking"}))
|
|
print("classify hydro:", tailor.classify_track({"title": "Head Grower", "description": "hydroponic cultivation IPM greenhouse nutrition"}))
|
|
print("classify driving:", tailor.classify_track({"title": "Delivery Driver", "description": "route fleet logistics warehouse forklift"}))
|
|
|
|
# build_master + combining
|
|
tracks, master = tailor.build_master({"title": "Head Grower", "description": "hydroponic IPM greenhouse"})
|
|
print("hydro tracks:", tracks, "| tech differentiator present:", "Technical Differentiator" in master)
|
|
|
|
tracks2, master2 = tailor.build_master({"title": "Backend Engineer", "description": "Python Flask Docker Linux"})
|
|
print("tech tracks:", tracks2, "| master chars:", len(master2))
|
|
|
|
# keyword score (deterministic)
|
|
s, op = tailor.score_job({"title": "x", "description": "proxmox docker python linux networking automation security"})
|
|
print("keyword score:", s, "|", op[:50])
|
|
|
|
# audit round-trip
|
|
job = db.upsert_job("DevOps Engineer", "Acme", "Seattle", "https://example.com/j1", "test",
|
|
"Linux Docker Python Proxmox networking")
|
|
aid = db.create_application(job, subject="Application: DevOps Engineer — Acme",
|
|
body="Hello,\n\nI'm applying to Acme.\n\nThanks,\nIndiana Holmes\n(425) 280-0023\nindianaholmes1@icloud.com")
|
|
checks = audit.run_audit(aid, db.get_job(job),
|
|
"Application: DevOps Engineer — Acme",
|
|
"Hello,\n\nI'm applying to Acme.\n\nThanks,\nIndiana Holmes\n(425) 280-0023\nindianaholmes1@icloud.com",
|
|
"Targeting: DevOps Engineer at Acme\n\n" + master2)
|
|
print("audit results:")
|
|
for c in checks:
|
|
print(" ", c["item"], "->", c["result"])
|
|
print("all_pass:", audit.all_pass(checks))
|
|
|
|
# library
|
|
print("library:", [(r["track"], r["exists"]) for r in tailor.list_library()])
|
|
print("insights:", improve.insights())
|
|
print("ALL_CORE_TESTS_PASSED")
|