agent build

This commit is contained in:
2026-08-28 12:21:44 +05:30
parent b6f8655909
commit f7df96c973
138 changed files with 24164 additions and 207 deletions

View File

@@ -98,6 +98,22 @@ type Intent struct {
// but the caller's own account, and is therefore available to anyone signed
// in.
Reads []Need
// Signal is how loudly the organization's current state asks for this
// reading, from the counts in Context. Zero — and a nil Signal — mean "not
// worth raising unprompted", which is what an intent whose subject nothing
// in the database is doing should say.
//
// It is only consulted by Highlights, the no-query path. Suggest never
// looks at it: a reading the user typed the words for is wanted whether or
// not the data is remarkable, and letting a count veto a typed query would
// make the panel refuse to answer questions it can answer.
//
// Declared here rather than in a table beside the catalogue so that an
// intent and the thing that makes it relevant stay one entry. An intent
// that names no count is never offered unprompted, which is the honest
// default for a reading with nothing to measure.
Signal func(Context) int
}
// permitted reports whether a role may be offered this intent. Every reading
@@ -158,42 +174,48 @@ var catalogue = map[string][]Intent{
Subject: "platform health", Shapes: []string{"stats", "card", "insight"},
Terms: []string{"health", "healthy", "platform", "integrity", "data quality",
"status", "wrong", "broken", "degraded"},
Reads: []Need{postings, applications, interviews, profiles},
Reads: []Need{postings, applications, interviews, profiles},
Signal: func(c Context) int { return when(c.StarvedPositions+c.FlaggedRisks, 9) },
},
{
ID: "workforce-summary", Text: "Summarize the workforce across the platform",
Subject: "the workforce", Shapes: []string{"stats", "table", "progress", "card"},
Terms: []string{"workforce", "scale", "how big", "composition", "headcount",
"people", "how many"},
Reads: []Need{postings, profiles, staff},
Reads: []Need{postings, profiles, staff},
Signal: func(c Context) int { return when(c.Staff, 3) },
},
{
ID: "hiring-operations", Text: "How is hiring operating overall?",
Subject: "hiring activity", Shapes: []string{"flow", "stats", "timeline", "table", "card"},
Terms: []string{"hiring", "operations", "activity", "velocity", "speed",
"throughput", "how fast", "time to hire"},
Reads: []Need{applications, postings},
Reads: []Need{applications, postings},
Signal: func(c Context) int { return when(c.Applications, 2) },
},
{
ID: "pipeline-health", Text: "Where is the hiring pipeline getting stuck?",
Subject: "the hiring pipeline", Shapes: []string{"flow", "stats", "progress", "table", "card"},
Terms: []string{"pipeline", "funnel", "bottleneck", "stuck", "blocked",
"conversion", "stage", "stages", "drop off", "dropoff"},
Reads: []Need{applications},
Reads: []Need{applications},
Signal: func(c Context) int { return when(c.Unscreened+c.Shortlisted+c.Interviewing, 5) },
},
{
ID: "attention-required", Text: "What needs attention right now?",
Subject: "what needs attention", Shapes: []string{"list", "table", "insight"},
Terms: []string{"attention", "urgent", "priority", "action", "unusual",
"anomaly", "anomalous", "risk", "risks", "problem", "problems", "issue"},
Reads: []Need{applications, postings},
Reads: []Need{applications, postings},
Signal: func(c Context) int { return when(c.StarvedPositions+c.Unscreened, 8) },
},
{
ID: "recommendations", Text: "What should I do next?",
Subject: "the recommendations", Shapes: []string{"list", "insight"},
Terms: []string{"recommend", "recommendation", "recommendations", "suggest",
"should", "advice", "next step", "next"},
Reads: []Need{applications, postings},
Reads: []Need{applications, postings},
Signal: func(c Context) int { return when(c.DraftPositions+c.StarvedPositions+c.Unscreened, 6) },
},
},
@@ -205,7 +227,8 @@ var catalogue = map[string][]Intent{
Subject: "the unfinished drafts", Shapes: []string{"list", "table"},
Terms: []string{"draft", "drafts", "unfinished", "incomplete", "unpublished",
"not posted", "half", "position", "positions", "role", "roles"},
Reads: []Need{postings},
Reads: []Need{postings},
Signal: func(c Context) int { return when(c.DraftPositions, 7) },
},
{
ID: "position-strength", Text: "Which position has the strongest pipeline?",
@@ -213,7 +236,8 @@ var catalogue = map[string][]Intent{
Terms: []string{"pipeline", "strength", "strongest", "healthiest", "best",
"conversion", "which position", "compare", "position", "positions",
"role", "roles"},
Reads: []Need{postings, applications},
Reads: []Need{postings, applications},
Signal: func(c Context) int { return when(atLeastTwo(c.ActivePositions), 3) },
},
{
ID: "positions-attention", Text: "Which positions need attention?",
@@ -221,7 +245,8 @@ var catalogue = map[string][]Intent{
Terms: []string{"attention", "risk", "risks", "at risk", "stalled", "stale",
"ageing", "aging", "neglected", "urgent", "slipping", "behind",
"position", "positions", "role", "roles"},
Reads: []Need{postings, applications},
Reads: []Need{postings, applications},
Signal: func(c Context) int { return when(c.StarvedPositions, 9) },
},
{
ID: "hiring-priority", Text: "Which position should I fill first?",
@@ -229,21 +254,24 @@ var catalogue = map[string][]Intent{
Terms: []string{"priority", "prioritise", "prioritize", "fill", "fill first",
"first", "most important", "which position", "vacancy", "vacancies",
"position", "positions", "role", "roles"},
Reads: []Need{postings, applications},
Reads: []Need{postings, applications},
Signal: func(c Context) int { return when(c.UnderfilledActive, 5) },
},
{
ID: "pipeline-health", Text: "Where are the hiring bottlenecks?",
Subject: "the hiring bottlenecks", Shapes: []string{"flow", "stats", "progress", "table"},
Terms: []string{"bottleneck", "bottlenecks", "funnel", "stuck", "blocked",
"stage", "stages", "waiting", "backlog", "pipeline"},
Reads: []Need{applications},
Reads: []Need{applications},
Signal: func(c Context) int { return when(c.Unscreened+c.Interviewing, 4) },
},
{
ID: "hiring-operations", Text: "Summarize hiring activity across all positions",
Subject: "hiring activity", Shapes: []string{"flow", "stats", "timeline", "table", "card"},
Terms: []string{"hiring", "activity", "operations", "throughput", "velocity",
"how many", "posting", "postings", "role", "roles", "position", "positions"},
Reads: []Need{applications, postings},
Reads: []Need{applications, postings},
Signal: func(c Context) int { return when(c.Applications, 2) },
},
{
/* Deliberately NOT carrying "pipeline". This is the Positions page's
@@ -257,7 +285,8 @@ var catalogue = map[string][]Intent{
Subject: "the candidates waiting", Shapes: []string{"list", "table", "stats"},
Terms: []string{"waiting", "candidate", "candidates", "applicant", "applicants",
"review", "screen", "screening", "decision", "queue"},
Reads: []Need{applications},
Reads: []Need{applications},
Signal: func(c Context) int { return when(c.Unscreened, 6) },
},
},
@@ -270,7 +299,8 @@ var catalogue = map[string][]Intent{
Terms: []string{"attention", "waiting", "stalled", "overdue", "action",
"decision", "decide", "urgent", "candidate", "candidates", "applicant",
"applicants"},
Reads: []Need{applications},
Reads: []Need{applications},
Signal: func(c Context) int { return when(c.Unscreened+c.Shortlisted, 6) },
},
{
ID: "top-candidates", Text: "Who are the strongest candidates?",
@@ -278,7 +308,8 @@ var catalogue = map[string][]Intent{
Terms: []string{"strongest", "top", "best", "compare", "shortlist", "rank",
"ranking", "highest", "score", "scores", "scored", "scoring", "who",
"candidate", "candidates", "applicant", "applicants"},
Reads: []Need{applications},
Reads: []Need{applications},
Signal: func(c Context) int { return when(c.Applications-c.Unscreened, 3) },
},
{
ID: "interview-ready", Text: "Who is ready to interview?",
@@ -286,7 +317,8 @@ var catalogue = map[string][]Intent{
Terms: []string{"interview", "interviews", "interviewed", "ready", "schedule",
"next round", "shortlist", "candidate", "candidates", "applicant",
"applicants"},
Reads: []Need{applications, interviews},
Reads: []Need{applications, interviews},
Signal: func(c Context) int { return when(c.Shortlisted, 5) },
},
{
ID: "screening-gaps", Text: "Which candidates have not been scored yet?",
@@ -294,14 +326,16 @@ var catalogue = map[string][]Intent{
Terms: []string{"unscored", "score", "scores", "scoring", "screening", "screen",
"gap", "gaps", "missing", "incomplete", "coverage", "candidate",
"candidates", "applicant", "applicants"},
Reads: []Need{applications},
Reads: []Need{applications},
Signal: func(c Context) int { return when(c.Unscreened, 7) },
},
{
ID: "pipeline-summary", Text: "Summarize the candidate pipeline",
Subject: "the candidate pipeline", Shapes: []string{"flow", "stats", "progress", "table", "card"},
Terms: []string{"pipeline", "funnel", "stage", "stages", "breakdown",
"how many", "where are", "conversion"},
Reads: []Need{applications},
Reads: []Need{applications},
Signal: func(c Context) int { return when(c.Applications, 2) },
},
{
ID: "candidate-risk", Text: "Which candidates carry risk flags?",
@@ -309,7 +343,8 @@ var catalogue = map[string][]Intent{
Terms: []string{"risk", "risks", "risky", "flag", "flags", "flagged", "concern",
"concerns", "integrity", "doubt", "decision", "candidate", "candidates",
"applicant", "applicants"},
Reads: []Need{applications, interviews},
Reads: []Need{applications, interviews},
Signal: func(c Context) int { return when(c.FlaggedRisks, 9) },
},
},
@@ -321,35 +356,40 @@ var catalogue = map[string][]Intent{
Subject: "candidate risk", Shapes: []string{"table", "stats", "insight"},
Terms: []string{"risk", "risks", "flag", "flags", "flagged", "concern",
"integrity", "concentrated"},
Reads: []Need{applications, interviews},
Reads: []Need{applications, interviews},
Signal: func(c Context) int { return when(c.FlaggedRisks, 9) },
},
{
ID: "recruitment-insights", Text: "What do the recruitment numbers show?",
Subject: "the recruitment insights", Shapes: []string{"stats", "table", "insight", "card"},
Terms: []string{"insight", "insights", "recruitment", "quality", "pool",
"stands out", "numbers", "trend", "trends"},
Reads: []Need{applications, profiles},
Reads: []Need{applications, profiles},
Signal: func(c Context) int { return when(c.Applications, 2) },
},
{
ID: "screening-gaps", Text: "Where are the screening gaps?",
Subject: "the screening gaps", Shapes: []string{"table", "stats", "progress"},
Terms: []string{"screening", "screen", "gap", "gaps", "unscored", "coverage",
"missing", "incomplete", "score", "scores"},
Reads: []Need{applications},
Reads: []Need{applications},
Signal: func(c Context) int { return when(c.Unscreened, 7) },
},
{
ID: "hiring-recommendations", Text: "Who should we hire?",
Subject: "the hiring recommendations", Shapes: []string{"list", "table", "insight"},
Terms: []string{"recommend", "recommendation", "recommendations", "hire",
"hiring", "should", "advice", "decision", "who"},
Reads: []Need{applications, profiles},
Reads: []Need{applications, profiles},
Signal: func(c Context) int { return when(c.Shortlisted, 5) },
},
{
ID: "top-candidates", Text: "Compare the top candidates",
Subject: "the top candidates", Shapes: []string{"table", "list", "stats"},
Terms: []string{"compare", "comparison", "top", "best", "strongest",
"shortlist", "rank", "ranking", "side by side"},
Reads: []Need{applications},
Reads: []Need{applications},
Signal: func(c Context) int { return when(c.Applications-c.Unscreened, 3) },
},
},
@@ -361,42 +401,48 @@ var catalogue = map[string][]Intent{
Subject: "the hiring trend", Shapes: []string{"timeline", "flow", "stats", "table"},
Terms: []string{"trend", "trends", "trending", "over time", "month", "monthly",
"week", "weekly", "history", "growth", "change"},
Reads: []Need{applications, postings},
Reads: []Need{applications, postings},
Signal: func(c Context) int { return when(c.Applications, 2) },
},
{
ID: "department-performance", Text: "How is each department performing?",
Subject: "department performance", Shapes: []string{"table", "stats", "progress"},
Terms: []string{"department", "departments", "team", "teams", "category",
"categories", "performance", "performing", "breakdown", "compare"},
Reads: []Need{applications, postings},
Reads: []Need{applications, postings},
Signal: func(c Context) int { return when(atLeastTwo(c.ActivePositions), 3) },
},
{
ID: "pipeline-health", Text: "Where are the hiring bottlenecks?",
Subject: "the hiring bottlenecks", Shapes: []string{"flow", "stats", "progress", "table"},
Terms: []string{"bottleneck", "bottlenecks", "funnel", "pipeline", "conversion",
"stuck", "stage", "stages"},
Reads: []Need{applications},
Reads: []Need{applications},
Signal: func(c Context) int { return when(c.Unscreened+c.Interviewing, 5) },
},
{
ID: "position-conversion", Text: "Which positions convert best?",
Subject: "position conversion", Shapes: []string{"table", "stats", "list"},
Terms: []string{"conversion", "convert", "converts", "position", "positions",
"role", "roles", "rate", "rates", "ratio", "yield"},
Reads: []Need{postings, applications},
Reads: []Need{postings, applications},
Signal: func(c Context) int { return when(atLeastTwo(c.ActivePositions)+c.Hired, 4) },
},
{
ID: "hiring-operations", Text: "How is hiring performing overall?",
Subject: "hiring performance", Shapes: []string{"stats", "flow", "timeline", "card"},
Terms: []string{"hiring", "performance", "operations", "velocity", "speed",
"average", "averages", "time to hire", "throughput"},
Reads: []Need{applications, postings},
Reads: []Need{applications, postings},
Signal: func(c Context) int { return when(c.Applications, 2) },
},
{
ID: "attention-required", Text: "What needs attention in the numbers?",
Subject: "what needs attention", Shapes: []string{"list", "insight", "table"},
Terms: []string{"attention", "outlier", "outliers", "anomaly", "unusual",
"risk", "risks", "worst", "falling"},
Reads: []Need{applications, postings},
Reads: []Need{applications, postings},
Signal: func(c Context) int { return when(c.StarvedPositions, 8) },
},
},
@@ -408,14 +454,16 @@ var catalogue = map[string][]Intent{
Subject: "the audit log", Shapes: []string{"stats", "table", "timeline", "card"},
Terms: []string{"audit", "log", "logs", "event", "events", "activity",
"trail", "record", "records", "how many"},
Reads: []Need{orgActivity},
Reads: []Need{orgActivity},
Signal: func(c Context) int { return when(c.ActivityEvents, 3) },
},
{
ID: "user-activity", Text: "Who has been most active?",
Subject: "activity by user", Shapes: []string{"table", "list", "stats"},
Terms: []string{"user", "users", "who", "account", "accounts", "busiest",
"most active", "behaviour", "behavior", "person"},
Reads: []Need{orgActivity},
Reads: []Need{orgActivity},
Signal: func(c Context) int { return when(c.ActivityEvents, 2) },
},
{
ID: "unusual-activity", Text: "Has anything unusual happened?",
@@ -441,28 +489,32 @@ var catalogue = map[string][]Intent{
Subject: "the talent priorities", Shapes: []string{"list", "table", "stats"},
Terms: []string{"prioritise", "prioritize", "priority", "priorities", "who",
"best", "top", "strongest", "elite", "star", "shortlist", "score", "scores"},
Reads: []Need{profiles},
Reads: []Need{profiles},
Signal: func(c Context) int { return when(c.Profiles, 3) },
},
{
ID: "talent-summary", Text: "Summarize the talent pool",
Subject: "the talent pool", Shapes: []string{"stats", "table", "progress", "card"},
Terms: []string{"pool", "talent", "worker", "workers", "profile", "profiles",
"segment", "segments", "composition", "supply", "how many"},
Reads: []Need{profiles},
Reads: []Need{profiles},
Signal: func(c Context) int { return when(c.Profiles, 2) },
},
{
ID: "talent-verification", Text: "Which profiles are missing verification?",
Subject: "the verification gaps", Shapes: []string{"list", "table", "progress", "stats"},
Terms: []string{"verification", "verify", "verified", "unverified", "gap",
"gaps", "missing", "credential", "credentials", "proof", "evidence"},
Reads: []Need{profiles, evidence},
Reads: []Need{profiles, evidence},
Signal: func(c Context) int { return when(c.UnverifiedProfiles, 7) },
},
{
ID: "talent-availability", Text: "Who is available to start?",
Subject: "availability", Shapes: []string{"list", "table", "stats"},
Terms: []string{"available", "availability", "unavailable", "free", "start",
"capacity", "when", "now", "notice"},
Reads: []Need{profiles},
Reads: []Need{profiles},
Signal: func(c Context) int { return when(c.Profiles, 2) },
},
},
@@ -474,28 +526,32 @@ var catalogue = map[string][]Intent{
Subject: "the hiring outcomes", Shapes: []string{"stats", "table", "progress", "card"},
Terms: []string{"outcome", "outcomes", "result", "results", "quality",
"retention", "worked out", "performance", "department", "departments"},
Reads: []Need{staff, applications},
Reads: []Need{staff, applications},
Signal: func(c Context) int { return when(c.Staff, 3) },
},
{
ID: "hiring-strongest", Text: "Who are our strongest hires?",
Subject: "the strongest hires", Shapes: []string{"list", "table", "stats"},
Terms: []string{"strongest", "best", "top", "star", "highest", "score",
"scores", "standout"},
Reads: []Need{staff, applications},
Reads: []Need{staff, applications},
Signal: func(c Context) int { return when(c.Staff, 2) },
},
{
ID: "hiring-patterns", Text: "What stands out about who we hire?",
Subject: "the hiring patterns", Shapes: []string{"table", "stats", "insight"},
Terms: []string{"pattern", "patterns", "stands out", "trend", "trends",
"common", "typical", "breakdown", "profile"},
Reads: []Need{staff, applications},
Reads: []Need{staff, applications},
Signal: func(c Context) int { return when(c.Staff, 2) },
},
{
ID: "hiring-recent", Text: "Who did we hire recently?",
Subject: "the recent hires", Shapes: []string{"list", "timeline", "table"},
Terms: []string{"recent", "recently", "latest", "last", "new hire", "new hires",
"who did we hire", "this month", "hired"},
Reads: []Need{staff},
Reads: []Need{staff},
Signal: func(c Context) int { return when(c.Hired, 5) },
},
},
@@ -507,14 +563,16 @@ var catalogue = map[string][]Intent{
Subject: "the skill library", Shapes: []string{"stats", "table", "list", "card"},
Terms: []string{"library", "skill", "skills", "catalogue", "catalog", "course",
"courses", "challenge", "challenges", "what do we have", "how many"},
Reads: []Need{courses},
Reads: []Need{courses},
Signal: func(c Context) int { return when(c.Courses, 3) },
},
{
ID: "forge-published", Text: "Which skills are published?",
Subject: "the published skills", Shapes: []string{"list", "table", "stats"},
Terms: []string{"published", "publish", "live", "draft", "drafts", "archived",
"archive", "status", "in service"},
Reads: []Need{courses},
Reads: []Need{courses},
Signal: func(c Context) int { return when(c.Courses, 2) },
},
{
ID: "forge-evaluation", Text: "How is submitted proof evaluated?",
@@ -529,7 +587,8 @@ var catalogue = map[string][]Intent{
Subject: "workforce usage", Shapes: []string{"stats", "progress", "table"},
Terms: []string{"workforce", "usage", "using", "uptake", "adoption", "progress",
"completion", "completed", "training", "learning"},
Reads: []Need{courses, evidence, profiles},
Reads: []Need{courses, evidence, profiles},
Signal: func(c Context) int { return when(c.Profiles, 2) },
},
{
ID: "forge-gaps", Text: "Which skill gaps are still open?",
@@ -556,7 +615,8 @@ var catalogue = map[string][]Intent{
Terms: []string{"compare", "comparison", "benchmark", "benchmarks", "similar",
"typical", "average", "pay", "rate", "rates", "salary", "experience",
"market"},
Reads: []Need{postings},
Reads: []Need{postings},
Signal: func(c Context) int { return when(c.ActivePositions, 3) },
},
{
ID: "position-requirements", Text: "Which credentials are already in use?",
@@ -564,7 +624,8 @@ var catalogue = map[string][]Intent{
Terms: []string{"credential", "credentials", "certification", "certifications",
"requirement", "requirements", "qualification", "qualifications",
"licence", "license", "skill", "skills"},
Reads: []Need{postings, certs},
Reads: []Need{postings, certs},
Signal: func(c Context) int { return when(c.ActivePositions, 2) },
},
{
ID: "position-spec-steps", Text: "How does this form work?",
@@ -602,7 +663,8 @@ var catalogue = map[string][]Intent{
Subject: "my recent activity", Shapes: []string{"timeline", "list", "table"},
Terms: []string{"activity", "recent", "recently", "history", "what have i",
"my actions", "audit", "did i"},
Reads: []Need{ownActivity},
Reads: []Need{ownActivity},
Signal: func(c Context) int { return when(c.ActivityEvents, 3) },
},
{
ID: "profile-actions", Text: "What can I do on this page?",